esp32_bluetooth_classic_sni.../libs/scapy/contrib/automotive/uds.uts
Matheus Eduardo Garbelini 86890704fd initial commit
todo: add documentation & wireshark dissector
2021-08-31 19:51:03 +08:00

768 lines
18 KiB
Text
Executable file

% Regression tests for the UDS layer
# More information at http://www.secdev.org/projects/UTscapy/
############
############
+ Basic operations
= Load module
load_contrib("automotive.uds")
= Check if positive response answers
dsc = UDS(b'\x10')
dscpr = UDS(b'\x50')
assert dscpr.answers(dsc)
= Check hashret
dsc.hashret() == dscpr.hashret()
= Check if negative response answers
dsc = UDS(b'\x10')
neg = UDS(b'\x7f\x10')
assert neg.answers(dsc)
= CHECK hashret NEG
dsc.hashret() == neg.hashret()
= Check if negative response answers not
dsc = UDS(b'\x10')
neg = UDS(b'\x7f\x11')
assert not neg.answers(dsc)
= Check if positive response answers not
dsc = UDS(b'\x10')
somePacket = UDS(b'\x49')
assert not somePacket.answers(dsc)
= Check UDS_DSC
dsc = UDS(b'\x10\x01')
assert dsc.service == 0x10
assert dsc.diagnosticSessionType == 0x01
= Check UDS_DSC
dsc = UDS()/UDS_DSC(b'\x01')
assert dsc.service == 0x10
assert dsc.diagnosticSessionType == 0x01
= Check UDS_DSCPR
dscpr = UDS(b'\x50\x02beef')
assert dscpr.service == 0x50
assert dscpr.diagnosticSessionType == 0x02
= Check UDS_DSCPR
dscpr = UDS()/UDS_DSCPR(b'\x02beef')
assert dscpr.service == 0x50
assert dscpr.diagnosticSessionType == 0x02
assert dscpr.sessionParameterRecord == b"beef"
= Check UDS_ER
er = UDS(b'\x11\x01')
assert er.service == 0x11
assert er.resetType == 0x01
= Check UDS_ER
er = UDS()/UDS_ER(resetType="hardReset")
assert er.service == 0x11
assert er.resetType == 0x01
= Check UDS_ERPR
erpr = UDS(b'\x51\x01')
assert erpr.service == 0x51
assert erpr.resetType == 0x01
= Check UDS_ERPR
erpr = UDS(b'\x51\x04\x10')
assert erpr.service == 0x51
assert erpr.resetType == 0x04
assert erpr.powerDownTime == 0x10
= Check UDS_SA
sa = UDS(b'\x27\x00c0ffee')
assert sa.service == 0x27
assert sa.securityAccessType == 0x0
assert sa.securityKey == b'c0ffee'
= Check UDS_SA
sa = UDS(b'\x27\x01c0ffee')
assert sa.service == 0x27
assert sa.securityAccessType == 0x1
assert sa.securityAccessDataRecord == b'c0ffee'
= Check UDS_SAPR
sapr = UDS(b'\x67\x01c0ffee')
assert sapr.service == 0x67
assert sapr.securityAccessType == 0x1
assert sapr.securitySeed == b'c0ffee'
= Check UDS_SAPR
sapr = UDS(b'\x67\x00')
assert sapr.service == 0x67
assert sapr.securityAccessType == 0x0
= Check UDS_CC
cc = UDS(b'\x28\x01\xff')
assert cc.service == 0x28
assert cc.controlType == 0x1
assert cc.communicationType0 == 0x3
assert cc.communicationType1 == 0x3
assert cc.communicationType2 == 0xf
= Check UDS_CCPR
ccpr = UDS(b'\x68\x01')
assert ccpr.service == 0x68
assert ccpr.controlType == 0x1
= Check UDS_TP
tp = UDS(b'\x3E\x01')
assert tp.service == 0x3e
assert tp.subFunction == 0x1
= Check UDS_TPPR
tppr = UDS(b'\x7E\x01')
assert tppr.service == 0x7e
assert tppr.zeroSubFunction == 0x1
= Check UDS_ATP
atp = UDS(b'\x83\x01')
assert atp.service == 0x83
assert atp.timingParameterAccessType == 0x1
= Check UDS_ATP
atp = UDS(b'\x83\x04coffee')
assert atp.service == 0x83
assert atp.timingParameterAccessType == 0x4
assert atp.timingParameterRequestRecord == b'coffee'
= Check UDS_ATPPR
atppr = UDS(b'\xc3\x01')
assert atppr.service == 0xc3
assert atppr.timingParameterAccessType == 0x1
= Check UDS_ATPPR
atppr = UDS(b'\xc3\x03coffee')
assert atppr.service == 0xc3
assert atppr.timingParameterAccessType == 0x3
assert atppr.timingParameterResponseRecord == b'coffee'
= Check UDS_SDT
sdt = UDS(b'\x84coffee')
assert sdt.service == 0x84
assert sdt.securityDataRequestRecord == b'coffee'
= Check UDS_SDTPR
sdtpr = UDS(b'\xC4coffee')
assert sdtpr.service == 0xC4
assert sdtpr.securityDataResponseRecord == b'coffee'
= Check UDS_CDTCS
cdtcs = UDS(b'\x85\x00coffee')
assert cdtcs.service == 0x85
assert cdtcs.DTCSettingType == 0
assert cdtcs.DTCSettingControlOptionRecord == b'coffee'
= Check UDS_CDTCSPR
cdtcspr = UDS(b'\xC5\x00')
assert cdtcspr.service == 0xC5
assert cdtcspr.DTCSettingType == 0
= Check UDS_ROE
roe = UDS(b'\x86\x00\x10coffee')
assert roe.service == 0x86
assert roe.eventType == 0
assert roe.eventWindowTime == 16
assert roe.eventTypeRecord == b'coffee'
= Check UDS_ROEPR
roepr = UDS(b'\xC6\x00\x01\x10coffee')
assert roepr.service == 0xC6
assert roepr.eventType == 0
assert roepr.numberOfIdentifiedEvents == 1
assert roepr.eventWindowTime == 16
assert roepr.eventTypeRecord == b'coffee'
= Check UDS_LC
lc = UDS(b'\x87\x01\x02')
assert lc.service == 0x87
assert lc.linkControlType == 0x01
assert lc.baudrateIdentifier == 0x02
= Check UDS_LC
lc = UDS(b'\x87\x02\x02\x03\x04')
assert lc.service == 0x87
assert lc.linkControlType == 0x02
assert lc.baudrateHighByte == 0x02
assert lc.baudrateMiddleByte == 0x03
assert lc.baudrateLowByte == 0x04
= Check UDS_LCPR
lcpr = UDS(b'\xC7\x01')
assert lcpr.service == 0xC7
assert lcpr.linkControlType == 0x01
= Check UDS_RDBI
rdbi = UDS(b'\x22\x01\x02')
assert rdbi.service == 0x22
assert rdbi.identifiers[0] == 0x0102
= Build UDS_RDBI
rdbi = UDS()/UDS_RDBI(identifiers=[0x102])
assert rdbi.service == 0x22
assert rdbi.identifiers[0] == 0x0102
assert bytes(rdbi) == b'\x22\x01\x02'
= Check UDS_RDBI2
rdbi = UDS(b'\x22\x01\x02\x03\x04')
assert rdbi.service == 0x22
assert rdbi.identifiers[0] == 0x0102
assert rdbi.identifiers[1] == 0x0304
assert raw(rdbi) == b'\x22\x01\x02\x03\x04'
= Build UDS_RDBI2
rdbi = UDS()/UDS_RDBI(identifiers=[0x102, 0x304])
assert rdbi.service == 0x22
assert rdbi.identifiers[0] == 0x0102
assert rdbi.identifiers[1] == 0x0304
assert raw(rdbi) == b'\x22\x01\x02\x03\x04'
= Check UDS_RDBIPR
rdbipr = UDS(b'\x62\x01\x02dieselgate')
assert rdbipr.service == 0x62
assert rdbipr.dataIdentifier == 0x0102
assert rdbipr.load == b'dieselgate'
= Check UDS_RMBA
rmba = UDS(b'\x23\x11\x02\x02')
assert rmba.service == 0x23
assert rmba.memorySizeLen == 1
assert rmba.memoryAddressLen == 1
assert rmba.memoryAddress1 == 2
assert rmba.memorySize1 == 2
= Check UDS_RMBA
rmba = UDS(b'\x23\x22\x02\x02\x03\x03')
assert rmba.service == 0x23
assert rmba.memorySizeLen == 2
assert rmba.memoryAddressLen == 2
assert rmba.memoryAddress2 == 0x202
assert rmba.memorySize2 == 0x303
= Check UDS_RMBA
rmba = UDS(b'\x23\x33\x02\x02\x02\x03\x03\x03')
assert rmba.service == 0x23
assert rmba.memorySizeLen == 3
assert rmba.memoryAddressLen == 3
assert rmba.memoryAddress3 == 0x20202
assert rmba.memorySize3 == 0x30303
= Check UDS_RMBA
rmba = UDS(b'\x23\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert rmba.service == 0x23
assert rmba.memorySizeLen == 4
assert rmba.memoryAddressLen == 4
assert rmba.memoryAddress4 == 0x2020202
assert rmba.memorySize4 == 0x3030303
= Check UDS_RMBAPR
rmbapr = UDS(b'\x63muchData')
assert rmbapr.service == 0x63
assert rmbapr.dataRecord == b'muchData'
= Check UDS_RSDBI
rsdbi = UDS(b'\x24\x12\x34')
assert rsdbi.service == 0x24
assert rsdbi.dataIdentifier == 0x1234
= Check UDS_RSDBIPR
rsdbipr = UDS(b'\x64\x12\x34\xffmuchData')
assert rsdbipr.service == 0x64
assert rsdbipr.dataIdentifier == 0x1234
assert rsdbipr.scalingByte == 255
assert rsdbipr.dataRecord == b'muchData'
= Check UDS_RSDBPI
rsdbpi = UDS(b'\x2a\x12\x34coffee')
assert rsdbpi.service == 0x2a
assert rsdbpi.transmissionMode == 0x12
assert rsdbpi.periodicDataIdentifier == 0x34
assert rsdbpi.furtherPeriodicDataIdentifier == b'coffee'
= Check UDS_RSDBPIPR
rsdbpipr = UDS(b'\x6a\xff\x12\x34')
assert rsdbpipr.service == 0x6a
assert rsdbpipr.periodicDataIdentifier == 255
assert rsdbpipr.dataRecord == b'\x12\x34'
= Check UDS_DDDI
dddi = UDS(b'\x2c\x12coffee')
assert dddi.service == 0x2c
assert dddi.definitionMode == 0x12
assert dddi.dataRecord == b'coffee'
= Check UDS_DDDIPR
dddipr = UDS(b'\x6c\x12\x44\x55')
assert dddipr.service == 0x6c
assert dddipr.definitionMode == 0x12
assert dddipr.dynamicallyDefinedDataIdentifier == 0x4455
= Check UDS_WDBI
wdbi = UDS(b'\x2e\x01\x02dieselgate')
assert wdbi.service == 0x2e
assert wdbi.dataIdentifier == 0x0102
assert wdbi.load == b'dieselgate'
= Build UDS_WDBI
wdbi = UDS()/UDS_WDBI(dataIdentifier=0x0102)/Raw(load=b'dieselgate')
assert wdbi.service == 0x2e
assert wdbi.dataIdentifier == 0x0102
assert wdbi.load == b'dieselgate'
assert bytes(wdbi) == b'\x2e\x01\x02dieselgate'
= Check UDS_WDBIPR
wdbipr = UDS(b'\x6e\x01\x02')
assert wdbipr.service == 0x6e
assert wdbipr.dataIdentifier == 0x0102
= Check UDS_WMBA
wmba = UDS(b'\x3d\x11\x02\x02muchData')
assert wmba.service == 0x3d
assert wmba.memorySizeLen == 1
assert wmba.memoryAddressLen == 1
assert wmba.memoryAddress1 == 2
assert wmba.memorySize1 == 2
assert wmba.dataRecord == b'muchData'
= Check UDS_WMBA
wmba = UDS(b'\x3d\x22\x02\x02\x03\x03muchData')
assert wmba.service == 0x3d
assert wmba.memorySizeLen == 2
assert wmba.memoryAddressLen == 2
assert wmba.memoryAddress2 == 0x202
assert wmba.memorySize2 == 0x303
assert wmba.dataRecord == b'muchData'
= Check UDS_WMBA
wmba = UDS(b'\x3d\x33\x02\x02\x02\x03\x03\x03muchData')
assert wmba.service == 0x3d
assert wmba.memorySizeLen == 3
assert wmba.memoryAddressLen == 3
assert wmba.memoryAddress3 == 0x20202
assert wmba.memorySize3 == 0x30303
assert wmba.dataRecord == b'muchData'
= Check UDS_WMBA
wmba = UDS(b'\x3d\x44\x02\x02\x02\x02\x03\x03\x03\x03muchData')
assert wmba.service == 0x3d
assert wmba.memorySizeLen == 4
assert wmba.memoryAddressLen == 4
assert wmba.memoryAddress4 == 0x2020202
assert wmba.memorySize4 == 0x3030303
assert wmba.dataRecord == b'muchData'
= Check UDS_WMBAPR
wmbapr = UDS(b'\x7d\x11\x02\x02')
assert wmbapr.service == 0x7d
assert wmbapr.memorySizeLen == 1
assert wmbapr.memoryAddressLen == 1
assert wmbapr.memoryAddress1 == 2
assert wmbapr.memorySize1 == 2
= Check UDS_WMBAPR
wmbapr = UDS(b'\x7d\x22\x02\x02\x03\x03')
assert wmbapr.service == 0x7d
assert wmbapr.memorySizeLen == 2
assert wmbapr.memoryAddressLen == 2
assert wmbapr.memoryAddress2 == 0x202
assert wmbapr.memorySize2 == 0x303
= Check UDS_WMBAPR
wmbapr = UDS(b'\x7d\x33\x02\x02\x02\x03\x03\x03')
assert wmbapr.service == 0x7d
assert wmbapr.memorySizeLen == 3
assert wmbapr.memoryAddressLen == 3
assert wmbapr.memoryAddress3 == 0x20202
assert wmbapr.memorySize3 == 0x30303
= Check UDS_WMBAPR
wmbapr = UDS(b'\x7d\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert wmbapr.service == 0x7d
assert wmbapr.memorySizeLen == 4
assert wmbapr.memoryAddressLen == 4
assert wmbapr.memoryAddress4 == 0x2020202
assert wmbapr.memorySize4 == 0x3030303
= Check UDS_CDTCI
cdtci = UDS(b'\x14\x44\x02\x03')
assert cdtci.service == 0x14
assert cdtci.groupOfDTCHighByte == 0x44
assert cdtci.groupOfDTCMiddleByte == 0x02
assert cdtci.groupOfDTCLowByte == 0x3
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x44')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x44
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x01\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x01
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x02\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x02
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x0f\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x0f
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x11\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x11
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x12\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x12
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x13\xff')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x13
assert rdtci.DTCStatusMask == 0xff
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x03\xff\xee\xdd\xaa')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x03
assert rdtci.DTCHighByte == 0xff
assert rdtci.DTCMiddleByte == 0xee
assert rdtci.DTCLowByte == 0xdd
assert rdtci.DTCSnapshotRecordNumber == 0xaa
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x04\xff\xee\xdd\xaa')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x04
assert rdtci.DTCHighByte == 0xff
assert rdtci.DTCMiddleByte == 0xee
assert rdtci.DTCLowByte == 0xdd
assert rdtci.DTCSnapshotRecordNumber == 0xaa
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x05\xaa')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x05
assert rdtci.DTCSnapshotRecordNumber == 0xaa
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x06\xff\xee\xdd\xaa')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x06
assert rdtci.DTCHighByte == 0xff
assert rdtci.DTCMiddleByte == 0xee
assert rdtci.DTCLowByte == 0xdd
assert rdtci.DTCExtendedDataRecordNumber == 0xaa
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x07\xaa\xbb')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x07
assert rdtci.DTCSeverityMask == 0xaa
assert rdtci.DTCStatusMask == 0xbb
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x08\xaa\xbb')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x08
assert rdtci.DTCSeverityMask == 0xaa
assert rdtci.DTCStatusMask == 0xbb
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x09\xff\xee\xdd')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x09
assert rdtci.DTCHighByte == 0xff
assert rdtci.DTCMiddleByte == 0xee
assert rdtci.DTCLowByte == 0xdd
= Check UDS_RDTCI
rdtci = UDS(b'\x19\x10\xff\xee\xdd\xaa')
assert rdtci.service == 0x19
assert rdtci.reportType == 0x10
assert rdtci.DTCHighByte == 0xff
assert rdtci.DTCMiddleByte == 0xee
assert rdtci.DTCLowByte == 0xdd
assert rdtci.DTCExtendedDataRecordNumber == 0xaa
= Check UDS_RDTCIPR
rdtcipr = UDS(b'\x59\x01\xff\xee\xdd\xaa')
assert rdtcipr.service == 0x59
assert rdtcipr.reportType == 1
assert rdtcipr.DTCStatusAvailabilityMask == 0xff
assert rdtcipr.DTCFormatIdentifier == 0xee
assert rdtcipr.DTCCount == 0xddaa
= Check UDS_RDTCIPR
rdtcipr = UDS(b'\x59\x02\xff\xee\xdd\xaa')
assert rdtcipr.service == 0x59
assert rdtcipr.reportType == 2
assert rdtcipr.DTCStatusAvailabilityMask == 0xff
assert rdtcipr.DTCAndStatusRecord == b'\xee\xdd\xaa'
= Check UDS_RDTCIPR
rdtcipr = UDS(b'\x59\x03\xff\xee\xdd\xaa')
assert rdtcipr.service == 0x59
assert rdtcipr.reportType == 3
assert rdtcipr.dataRecord == b'\xff\xee\xdd\xaa'
= Check UDS_RC
rc = UDS(b'\x31\x03\xff\xee\xdd\xaa')
assert rc.service == 0x31
assert rc.routineControlType == 3
assert rc.routineIdentifier == 0xffee
assert rc.routineControlOptionRecord == b'\xdd\xaa'
= Check UDS_RCPR
rcpr = UDS(b'\x71\x03\xff\xee\xdd\xaa')
assert rcpr.service == 0x71
assert rcpr.routineControlType == 3
assert rcpr.routineIdentifier == 0xffee
assert rcpr.routineStatusRecord == b'\xdd\xaa'
= Check UDS_RD
rd = UDS(b'\x34\xaa\x11\x02\x02')
assert rd.service == 0x34
assert rd.dataFormatIdentifier == 0xaa
assert rd.memorySizeLen == 1
assert rd.memoryAddressLen == 1
assert rd.memoryAddress1 == 2
assert rd.memorySize1 == 2
= Check UDS_RD
rd = UDS(b'\x34\xaa\x22\x02\x02\x03\x03')
assert rd.service == 0x34
assert rd.dataFormatIdentifier == 0xaa
assert rd.memorySizeLen == 2
assert rd.memoryAddressLen == 2
assert rd.memoryAddress2 == 0x202
assert rd.memorySize2 == 0x303
= Check UDS_RD
rd = UDS(b'\x34\xaa\x33\x02\x02\x02\x03\x03\x03')
assert rd.service == 0x34
assert rd.dataFormatIdentifier == 0xaa
assert rd.memorySizeLen == 3
assert rd.memoryAddressLen == 3
assert rd.memoryAddress3 == 0x20202
assert rd.memorySize3 == 0x30303
= Check UDS_RD
rd = UDS(b'\x34\xaa\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert rd.service == 0x34
assert rd.dataFormatIdentifier == 0xaa
assert rd.memorySizeLen == 4
assert rd.memoryAddressLen == 4
assert rd.memoryAddress4 == 0x2020202
assert rd.memorySize4 == 0x3030303
= Check UDS_RDPR
rdpr = UDS(b'\x74\xaa\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert rdpr.service == 0x74
assert rdpr.routineControlType == 0xaa
assert rdpr.memorySizeLen == 4
assert rdpr.memoryAddressLen == 4
assert rdpr.maxNumberOfBlockLength == b'\x02\x02\x02\x02\x03\x03\x03\x03'
= Check UDS_RU
ru = UDS(b'\x35\xaa\x11\x02\x02')
assert ru.service == 0x35
assert ru.dataFormatIdentifier == 0xaa
assert ru.memorySizeLen == 1
assert ru.memoryAddressLen == 1
assert ru.memoryAddress1 == 2
assert ru.memorySize1 == 2
= Check UDS_RU
ru = UDS(b'\x35\xaa\x22\x02\x02\x03\x03')
assert ru.service == 0x35
assert ru.dataFormatIdentifier == 0xaa
assert ru.memorySizeLen == 2
assert ru.memoryAddressLen == 2
assert ru.memoryAddress2 == 0x202
assert ru.memorySize2 == 0x303
= Check UDS_RU
ru = UDS(b'\x35\xaa\x33\x02\x02\x02\x03\x03\x03')
assert ru.service == 0x35
assert ru.dataFormatIdentifier == 0xaa
assert ru.memorySizeLen == 3
assert ru.memoryAddressLen == 3
assert ru.memoryAddress3 == 0x20202
assert ru.memorySize3 == 0x30303
= Check UDS_RU
ru = UDS(b'\x35\xaa\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert ru.service == 0x35
assert ru.dataFormatIdentifier == 0xaa
assert ru.memorySizeLen == 4
assert ru.memoryAddressLen == 4
assert ru.memoryAddress4 == 0x2020202
assert ru.memorySize4 == 0x3030303
= Check UDS_RUPR
rupr = UDS(b'\x75\xaa\x44\x02\x02\x02\x02\x03\x03\x03\x03')
assert rupr.service == 0x75
assert rupr.routineControlType == 0xaa
assert rupr.memorySizeLen == 4
assert rupr.memoryAddressLen == 4
assert rupr.maxNumberOfBlockLength == b'\x02\x02\x02\x02\x03\x03\x03\x03'
= Check UDS_TD
td = UDS(b'\x36\xaapayload')
assert td.service == 0x36
assert td.blockSequenceCounter == 0xaa
assert td.transferRequestParameterRecord == b'payload'
= Check UDS_TDPR
tdpr = UDS(b'\x76\xaapayload')
assert tdpr.service == 0x76
assert tdpr.blockSequenceCounter == 0xaa
assert tdpr.transferResponseParameterRecord == b'payload'
= Check UDS_RTE
rte = UDS(b'\x37payload')
assert rte.service == 0x37
assert rte.transferRequestParameterRecord == b'payload'
= Check UDS_RTEPR
rtepr = UDS(b'\x77payload')
assert rtepr.service == 0x77
assert rtepr.transferResponseParameterRecord == b'payload'
= Check UDS_IOCBI
iocbi = UDS(b'\x2f\x23\x34\xffcoffee')
assert iocbi.service == 0x2f
assert iocbi.dataIdentifier == 0x2334
assert iocbi.controlOptionRecord == 255
assert iocbi.controlEnableMaskRecord == b'coffee'
= Check UDS_NRC
nrc = UDS(b'\x7f\x22\x33')
assert nrc.service == 0x7f
assert nrc.requestServiceId == 0x22
assert nrc.negativeResponseCode == 0x33