diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-02-16 17:33:43 +0100 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2022-02-17 18:52:42 +0000 |
commit | 8ad031aa9a71a4e01362af083c8cbe9774315a0a (patch) | |
tree | b55fe8454a548aeda649b213fe370b55f004b025 | |
parent | dd7c075040b8678e9f6bf6605e5b70880918ebe2 (diff) |
ggsn_tests: Early exit and improve logging on some setverdict fail cases
Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
-rw-r--r-- | ggsn_tests/GGSN_Tests.ttcn | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 48e87bf9..675c435a 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -337,27 +337,30 @@ module GGSN_Tests { /* Check if EUA type corresponds to requested type */ if (match(ctx.eua, t_EuaIPv4(?)) and not match(cpr.endUserAddress, tr_EuaIPv4(?))){ - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "EUAv4 expectancies didn't match"); } if (match(ctx.eua, t_EuaIPv6(?)) and not match(cpr.endUserAddress, tr_EuaIPv6(?))) { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "EUAv6 expectancies didn't match"); } if (match(ctx.eua, t_EuaIPv4v6(?, ?)) and not match(cpr.endUserAddress, tr_EuaIPv4v6(?, ?))) { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "EUAv4v6 expectancies didn't match"); } /* Check if PCO response corresponds to request */ if (ispresent(ctx.pco_req)) { if (match(ctx.pco_req, ts_PCO_IPv4_DNS_CONT) and not match(cpr.protConfigOptions, tr_PCO_IPv4_DNS_CONT_resp(?))) { - log("IPv4 DNS Container requested, but missing"); - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "IPv4 DNS Container requested, but missing"); } if (match(ctx.pco_req, ts_PCO_IPv6_DNS) and not match(cpr.protConfigOptions, tr_PCO_IPv6_DNS_resp(?))) { - log("IPv6 DNS Container requested, but missing"); - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "IPv6 DNS Container requested, but missing"); } } ctx.teid_remote := cpr.teidDataI.teidDataI; @@ -372,7 +375,8 @@ module GGSN_Tests { } setverdict(pass); } else { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "CreatePDPContextResp: cause expectancies didn't match"); } } @@ -388,7 +392,8 @@ module GGSN_Tests { } else if (exp_cause != '80'O and exp_cause == upr.cause.causevalue) { setverdict(pass); } else { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "UpdatePDPContextResp: cause expectancies didn't match"); } } @@ -409,8 +414,8 @@ module GGSN_Tests { req_type, req_num)); } [] DIAMETER_UNIT.receive(PDU_DIAMETER:?) -> value rx_dia { - setverdict(fail, "Received unexpected DIAMETER ", rx_dia); - self.stop; + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Received unexpected DIAMETER ", rx_dia)); } } @@ -452,13 +457,16 @@ module GGSN_Tests { ud.gtpc.gtpc_pdu.deletePDPContextRequest.cause.causevalue == valueof(expect_cause)) { setverdict(pass); } else { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "DeletePDPContextReq: cause expectancies didn't match"); } if (expect_teardown == ispresent(ud.gtpc.gtpc_pdu.deletePDPContextRequest.tearDownIndicator)) { setverdict(pass); } else { setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "DeletePDPContextReq: tearDownIndicator expectancies didn't match"); } } } @@ -490,7 +498,8 @@ module GGSN_Tests { if (ud.gtpc.gtpc_pdu.deletePDPContextResponse.cause.causevalue == expect_causevalue) { setverdict(pass); } else { - setverdict(fail); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + "DeletePDPContextResp: cause expectancies didn't match"); } } } |