feat: build vehicle data platform and production pipeline
This commit is contained in:
@@ -124,6 +124,28 @@ func TestAutoResponseEchoesRawVINAndOriginalTime(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAutoResponseRejectsEnforcedInvalidPlatformLogin(t *testing.T) {
|
||||
body := []byte{0x1a, 0x07, 0x02, 0x00, 0x26, 0x0f, 0x00, 0x01}
|
||||
body = append(body, fixedASCII("platform-a", 12)...)
|
||||
body = append(body, fixedASCII("wrong-password", 20)...)
|
||||
body = append(body, 0x01)
|
||||
request := buildFrame(0x05, 0xfe, "12345678901234567", body)
|
||||
env, err := ParseFrame(request, 1782914969584, "127.0.0.1:32960")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
env.AuthenticationEnforced = true
|
||||
env.AuthenticationStatus = "rejected"
|
||||
|
||||
response, ok, err := AutoResponse(request, env)
|
||||
if err != nil || !ok {
|
||||
t.Fatalf("AutoResponse() ok=%v err=%v", ok, err)
|
||||
}
|
||||
if response[3] != responseError {
|
||||
t.Fatalf("response flag = 0x%02x, want 0x%02x", response[3], responseError)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseFrameExtractsRealtimeVehicleMileageAndPosition(t *testing.T) {
|
||||
body := []byte{0x1a, 0x06, 0x1e, 0x16, 0x17, 0x39}
|
||||
body = append(body, 0x01)
|
||||
|
||||
Reference in New Issue
Block a user