summaryrefslogtreecommitdiffstats
path: root/ggsn_tests
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-21 16:16:58 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-08-21 16:31:35 +0200
commit22d597ff9452f8ca46409a5d8b15ee2fc7d4a433 (patch)
treea4c3209f1572109b4e1bfe3ac6c31c3a46c83386 /ggsn_tests
parentb7f01781d97a5d87c0835a271b4342c70ad49e77 (diff)
ggsn: Introduce test TC_pdp46_act_deact_apn4
Diffstat (limited to 'ggsn_tests')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn27
-rw-r--r--ggsn_tests/expected-results.xml1
2 files changed, 26 insertions, 2 deletions
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 @@ module GGSN_Tests {
}
/* 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 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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>