pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27226 )


Change subject: ggsn_tests: Early exit and improve logging on some setverdict 
fail cases
......................................................................

ggsn_tests: Early exit and improve logging on some setverdict fail cases

Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
---
M ggsn_tests/GGSN_Tests.ttcn
1 file changed, 22 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/26/27226/1

diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 48e87bf..675c435 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -337,27 +337,30 @@
                        /*  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 @@
                        }
                        setverdict(pass);
                } else {
-                       setverdict(fail);
+                       Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+                                               "CreatePDPContextResp: cause 
expectancies didn't match");
                }
        }

@@ -388,7 +392,8 @@
                } 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 @@
                                                 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 @@
                                           
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 @@
                                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");
                                }
                        }
                }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27226
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
Gerrit-Change-Number: 27226
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to