feature: prepared some test cases for fault injection of response codes

This commit is contained in:
uhi22 2023-05-15 22:34:49 +02:00
parent 9d8a7e74f7
commit 5eb34c63ee
3 changed files with 45 additions and 7 deletions

View file

@ -82,6 +82,25 @@ exiHexDemoSupportedApplicationProtocolRequest2="8000ebab9371d34b9b79d189a98989c1
# (7) PreChargeReq # (7) PreChargeReq
# "result": "809a001150400000c80006400000" # "result": "809a001150400000c80006400000"
# 809a0232417b661514a4cb91e0202d0691559529548c0841e0fc1af4507460c0 SessionSetupRes with NewSessionEstablished
# 809a0232417b661514a4cb91e0A02d0691559529548c0841e0fc1af4507460c0 SessionSetupRes with SequenceError
# 809a021a3b7c417774813311a00120024100c4 ServiceDiscoveryRes
# 809a021a3b7c417774813311a0A120024100c4 ServiceDiscoveryRes with SequenceError
# 809a021a3b7c417774813311c000 ServicePaymentSelectionRes
# 809a021a3b7c417774813311c0A0 ServicePaymentSelectionRes with SequenceError
# 809a021a3b7c417774813310c00200 ContractAuthenticationRes
# 809a021a3b7c417774813310c0A200 ContractAuthenticationRes with SequenceError
# 809a0125e6cecc50800001ec00200004051828758405500080000101844138101c2432c04081436c900c0c000041435ecc044606000200 ChargeParameterDiscovery
# 809a0125e6cecd50810001ec00201004051828758405500080000101844138101c2432c04081436c900c0c000041435ecc044606000200 ChargeParameterDiscovery with ServiceSelectionInvalid
# 809a0125e6cecc5020004080000400 CableCheckRes
# 809a0125e6cecc5020804080000400 CableCheckRes with "FAILED"
# 809a0125e6cecc516000408000008284de880800 PreChargeRes
# 809a0125e6cecc516080408000008284de880800 PreChargeRes with "FAILED"
# 809a0125e6cecc51400420400000 PowerDeliveryRes
# 809a0125e6cecc51408420400000 PowerDeliveryRes with "FAILED"
# 809a0125e6cecc50e0004080000082867dc8081818000000040a1b64802030882702038486580800 CurrentDemandRes
# 809a0125e6cecc50e0804080000082867dc8081818000000040a1b64802030882702038486580800 CurrentDemandRes with "FAILED"
# Configuration of the exi converter tool # Configuration of the exi converter tool
if os.name == "nt": if os.name == "nt":

View file

@ -78,6 +78,10 @@ class fsmEvse():
# todo: check the request content, and fill response parameters # todo: check the request content, and fill response parameters
msg = addV2GTPHeader(exiEncode("EDa")) # EDa for Encode, Din, SessionSetupResponse msg = addV2GTPHeader(exiEncode("EDa")) # EDa for Encode, Din, SessionSetupResponse
self.addToTrace("responding " + prettyHexMessage(msg)) self.addToTrace("responding " + prettyHexMessage(msg))
if (testsuite_faultinjection_is_triggered(TC_EVSE_ResponseCode_SequenceError_for_SessionSetup)):
# send a SessionSetupResponse with Responsecode SequenceError
msg = addV2GTPHeader("809a0232417b661514a4cb91e0A02d0691559529548c0841e0fc1af4507460c0")
self.addToTrace("responding " + prettyHexMessage(msg))
self.Tcp.transmit(msg) self.Tcp.transmit(msg)
self.publishStatus("Session established") self.publishStatus("Session established")
self.enterState(stateWaitForServiceDiscoveryRequest) self.enterState(stateWaitForServiceDiscoveryRequest)
@ -94,6 +98,9 @@ class fsmEvse():
if (strConverterResult.find("ServiceDiscoveryReq")>0): if (strConverterResult.find("ServiceDiscoveryReq")>0):
# todo: check the request content, and fill response parameters # todo: check the request content, and fill response parameters
msg = addV2GTPHeader(exiEncode("EDb")) # EDb for Encode, Din, ServiceDiscoveryResponse msg = addV2GTPHeader(exiEncode("EDb")) # EDb for Encode, Din, ServiceDiscoveryResponse
if (testsuite_faultinjection_is_triggered(TC_EVSE_ResponseCode_SequenceError_for_ServiceDiscoveryRes)):
# send a ServiceDiscoveryRes with Responsecode SequenceError
msg = addV2GTPHeader("809a021a3b7c417774813311a0A120024100c4")
self.addToTrace("responding " + prettyHexMessage(msg)) self.addToTrace("responding " + prettyHexMessage(msg))
self.Tcp.transmit(msg) self.Tcp.transmit(msg)
self.publishStatus("Services discovered") self.publishStatus("Services discovered")
@ -111,6 +118,9 @@ class fsmEvse():
if (strConverterResult.find("ServicePaymentSelectionReq")>0): if (strConverterResult.find("ServicePaymentSelectionReq")>0):
# todo: check the request content, and fill response parameters # todo: check the request content, and fill response parameters
msg = addV2GTPHeader(exiEncode("EDc")) # EDc for Encode, Din, ServicePaymentSelectionResponse msg = addV2GTPHeader(exiEncode("EDc")) # EDc for Encode, Din, ServicePaymentSelectionResponse
if (testsuite_faultinjection_is_triggered(TC_EVSE_ResponseCode_SequenceError_for_ServicePaymentSelectionRes)):
# send a ServicePaymentSelectionRes with Responsecode SequenceError
msg = addV2GTPHeader("809a021a3b7c417774813311c0A0")
self.addToTrace("responding " + prettyHexMessage(msg)) self.addToTrace("responding " + prettyHexMessage(msg))
self.Tcp.transmit(msg) self.Tcp.transmit(msg)
self.publishStatus("ServicePayment selected") self.publishStatus("ServicePayment selected")

View file

@ -11,13 +11,22 @@
# The list of test cases. Each must have a unique test case ID. # The list of test cases. Each must have a unique test case ID.
TC_NOTHING_TO_TEST = 0 TC_NOTHING_TO_TEST = 0
TC_EVSE_Timeout_during_CableCheck = 1 TC_EVSE_ResponseCode_SequenceError_for_SessionSetup = 1
TC_EVSE_Timeout_during_PreCharge = 2 TC_EVSE_ResponseCode_SequenceError_for_ServiceDiscoveryRes = 2
TC_EVSE_Shutdown_during_PreCharge = 3 TC_EVSE_ResponseCode_SequenceError_for_ServicePaymentSelectionRes = 3
TC_EVSE_Shutdown_during_CurrentDemand = 4 TC_EVSE_ResponseCode_SequenceError_for_ContractAuthenticationRes = 4
TC_EVSE_Malfunction_during_CurrentDemand = 5 TC_EVSE_ResponseCode_ServiceSelectionInvalid_for_ChargeParameterDiscovery = 5
TC_EVSE_Timeout_during_CurrentDemand = 6 TC_EVSE_ResponseCode_Failed_for_CableCheckRes = 6
TC_EVSE_LastTest = 7 TC_EVSE_ResponseCode_Failed_for_PreChargeRes = 7
TC_EVSE_ResponseCode_Failed_for_PowerDeliveryRes = 8
TC_EVSE_ResponseCode_Failed_for_CurrentDemandRes = 9
TC_EVSE_Timeout_during_CableCheck = 10
TC_EVSE_Timeout_during_PreCharge = 11
TC_EVSE_Shutdown_during_PreCharge = 12
TC_EVSE_Shutdown_during_CurrentDemand = 13
TC_EVSE_Malfunction_during_CurrentDemand = 14
TC_EVSE_Timeout_during_CurrentDemand = 15
TC_EVSE_LastTest = 16
# variables # variables