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

Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
This commit is contained in:
Pau Espin 2022-02-16 17:33:43 +01:00 committed by pespin
parent dd7c075040
commit 8ad031aa9a
1 changed files with 22 additions and 13 deletions

View File

@ -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");
}
}
}