Change in ...osmo-ttcn3-hacks[master]: ggsn: Introduce test TC_pdp46_act_deact_apn4

laforge gerrit-no-reply at lists.osmocom.org
Fri Aug 23 06:54:32 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15262 )

Change subject: ggsn: Introduce test TC_pdp46_act_deact_apn4
......................................................................

ggsn: Introduce test TC_pdp46_act_deact_apn4

Related osmo-ggsn.git libgtp fix: I6c6215a4ce478afabc78ffaf5ffb0cf829e41226

Related: OS#4154
Change-Id: Ia1893e0c181307ac1ceb07ee5f496507f7a603c8
---
M ggsn_tests/GGSN_Tests.ttcn
M ggsn_tests/expected-results.xml
2 files changed, 26 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 31c1056..ae92626 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -247,7 +247,7 @@
 	}
 
 	/* send a PDP context activation */
-	function f_pdp_ctx_act(inout PdpContext ctx) runs on GT_CT {
+	function f_pdp_ctx_act(inout PdpContext ctx, OCT1 exp_cause := '80'O) runs on GT_CT {
 		var Gtp1cUnitdata ud;
 		var default d;
 
@@ -260,7 +260,7 @@
 		alt {
 			[] GTPC.receive(tr_GTPC_MsgType(g_peer_c, createPDPContextResponse, ctx.teic)) -> value ud {
 				var CreatePDPContextResponse cpr := ud.gtpc.gtpc_pdu.createPDPContextResponse;
-				if (cpr.cause.causevalue == '80'O) {
+				if (exp_cause == '80'O and exp_cause == cpr.cause.causevalue) {
 					/*  Check if EUA type corresponds to requested type */
 					if (match(ctx.eua, t_EuaIPv4(?)) and
 					    not match(cpr.endUserAddress, tr_EuaIPv4(?))){
@@ -292,6 +292,12 @@
 					ctx.eua := cpr.endUserAddress;
 					ctx.pco_neg := cpr.protConfigOptions;
 					setverdict(pass);
+				} else if (exp_cause != '80'O and exp_cause == cpr.cause.causevalue) {
+					if (ispresent(cpr.endUserAddress)) {
+						log("EUA received on createPDPContextResponse cause=" & oct2str(cpr.cause.causevalue));
+						setverdict(fail);
+					}
+					setverdict(pass);
 				} else {
 					setverdict(fail);
 				}
@@ -1287,6 +1293,22 @@
 		f_pdp_ctx_del(ctxA, '1'B);
 	}
 
+	/* Test IPv4v6 context activation for dynamic IPv4v6 EUA on a v4-only APN */
+	testcase TC_pdp46_act_deact_apn4() runs on GT_CT {
+		f_init();
+		/* A typical MS first attempts v4v6, and if rejected, then tries v4 and v6 separetly */
+		var PdpContext ctx46 := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dynv6Dyn)));
+		f_pdp_ctx_act(ctx46, 'DC'O); /* Cause: Unknown PDP address or PDP type */
+
+		var PdpContext ctx4 := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
+		f_pdp_ctx_act(ctx4, '80'O); /* Normal accept cause */
+
+		var PdpContext ctx6 := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv6Dyn)));
+		f_pdp_ctx_act(ctx6, 'DC'O); /* Cause: Unknown PDP address or PDP type */
+
+		f_pdp_ctx_del(ctx4, '1'B);
+	}
+
 	/* Send a duplicate echo req. osmo-ggsn maintains a queue for sent
 	   responses (60 seconds): If same delete req is sent and duplicate is
 	   detected, saved duplicate response should be sent back. */
@@ -1332,6 +1354,7 @@
 		execute(TC_pdp46_act_deact_pcodns6());
 		execute(TC_pdp46_act_deact_gtpu_access());
 		execute(TC_pdp46_clients_interact());
+		execute(TC_pdp46_act_deact_apn4());
 
 		execute(TC_echo_req_resp());
 		execute(TC_act_deact_retrans_duplicate());
diff --git a/ggsn_tests/expected-results.xml b/ggsn_tests/expected-results.xml
index e57a7df..374cde0 100644
--- a/ggsn_tests/expected-results.xml
+++ b/ggsn_tests/expected-results.xml
@@ -21,6 +21,7 @@
   <testcase classname='GGSN_Tests' name='TC_pdp46_act_deact_pcodns6' time='MASKED'/>
   <testcase classname='GGSN_Tests' name='TC_pdp46_act_deact_gtpu_access' time='MASKED'/>
   <testcase classname='GGSN_Tests' name='TC_pdp46_clients_interact' time='MASKED'/>
+  <testcase classname='GGSN_Tests' name='TC_pdp46_act_deact_apn4' time='MASKED'/>
   <testcase classname='GGSN_Tests' name='TC_echo_req_resp' time='MASKED'/>
   <testcase classname='GGSN_Tests' name='TC_act_deact_retrans_duplicate' time='MASKED'/>
 </testsuite>

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15262
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: Ia1893e0c181307ac1ceb07ee5f496507f7a603c8
Gerrit-Change-Number: 15262
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190823/2f315507/attachment.html>


More information about the gerrit-log mailing list