[PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Jan 31 13:49:38 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6205

to look at the new patch set (#2).

ggsn_tests: Add test to validate if different pdp ctx can talk each other

It seems due to the current network configuration, pdp v4 ctx can talk
each other while pdp v6 ctx cannot.

Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a
---
M ggsn_tests/GGSN_Tests.cfg
M ggsn_tests/GGSN_Tests.ttcn
2 files changed, 84 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/6205/2

diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg
index bf82057..67fcbd4 100644
--- a/ggsn_tests/GGSN_Tests.cfg
+++ b/ggsn_tests/GGSN_Tests.cfg
@@ -27,10 +27,12 @@
 GGSN_Tests.TC_pdp4_act_deact_ipcp
 GGSN_Tests.TC_pdp4_act_deact_pcodns
 GGSN_Tests.TC_pdp4_act_deact_gtpu_access
+GGSN_Tests.TC_pdp6_clients_interact
 
 GGSN_Tests.TC_pdp6_act_deact
 GGSN_Tests.TC_pdp6_act_deact_pcodns
 GGSN_Tests.TC_pdp6_act_deact_icmp6
 GGSN_Tests.TC_pdp6_act_deact_gtpu_access
+GGSN_Tests.TC_pdp4_clients_interact
 
 GGSN_Tests.TC_echo_req_resp
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index b802564..28f461c 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -747,6 +747,18 @@
 		}
 	}
 
+	/* template for an ICMPv6 echo request */
+	template PDU_ICMP tr_ICMPv4_ERQ := {
+		echo := {
+			type_field := 8,
+			code := 0,
+			checksum := ?,
+			identifier := ?,
+			sequence_number := ?,
+			data := ?
+		}
+	}
+
 	/* template for an ICMPv4 echo reply */
 	template PDU_ICMP tr_ICMPv4_ERP(template octetstring data := *) := {
 		echo_reply := {
@@ -910,6 +922,18 @@
 		}
 	}
 
+	/* template for an ICMPv6 echo request */
+	template PDU_ICMPv6 tr_ICMPv6_ERQ := {
+		echoRequest := {
+			typeField := 128,
+			code := 0,
+			checksum := ?,
+			identifier := ?,
+			sequenceNr := ?,
+			data := ?
+		}
+	}
+
 	/* template for receiving/matching an ICMPv6 echo reply */
 	template PDU_ICMPv6 tr_ICMPv6_ERP(template octetstring data := *) := {
 		echoReply := {
@@ -1038,6 +1062,11 @@
 		T_default.stop;
 	}
 
+	/* Wait for ICMPv4 echo request from GTP */
+	function f_wait_icmp4_echo_request(PdpContext ctx) runs on GT_CT {
+		f_wait_icmp4(ctx, tr_ICMPv4_ERQ);
+	}
+
 	/* Wait for ICMPv4 echo reply (or unreachable) from GTP */
 	function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT {
 		f_wait_icmp4(ctx, (tr_ICMPv4_ERP, tr_ICMPv4_DU));
@@ -1074,6 +1103,11 @@
 	/* wait for GGSN to send us an ICMPv6 router advertisement */
 	function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT {
 		f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64));
+	}
+
+	/* Wait for ICMPv6 echo request from GTP */
+	function f_wait_icmp6_echo_request(PdpContext ctx) runs on GT_CT {
+		f_wait_icmp6(ctx, tr_ICMPv6_ERQ);
 	}
 
 	/* Wait for ICMPv6 echo reply (or unreachable) from GTP */
@@ -1183,6 +1217,37 @@
 		f_pdp_ctx_del(ctx, '1'B);
 	}
 
+	/* Validate if different clients (pdp ctx) can reach one another through GGSN. */
+	testcase TC_pdp6_clients_interact() runs on GT_CT {
+		f_init();
+		var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn)));
+		var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn)));
+		f_pdp_ctx_act(ctxA);
+		f_send_gtpu(ctxA, f_icmpv6_rs_for_pdp(ctxA));
+		f_wait_rtr_adv(ctxA);
+		f_send_gtpu(ctxA, f_gen_icmpv6_neigh_solicit_for_pdp(ctxA));
+
+		f_pdp_ctx_act(ctxB);
+		f_send_gtpu(ctxB, f_icmpv6_rs_for_pdp(ctxB));
+		f_wait_rtr_adv(ctxB);
+		f_send_gtpu(ctxB, f_gen_icmpv6_neigh_solicit_for_pdp(ctxB));
+
+		var OCT16 addrA_ll := f_ipv6_link_local(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address);
+		var OCT16 addrB_ll := f_ipv6_link_local(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address);
+		var OCT16 addrA_glob := f_ipv6_global(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address);
+		var OCT16 addrB_glob := f_ipv6_global(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address);
+
+		/* Validate if clients can interact using ll addr. */
+		f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_ll, addrB_ll));
+		f_wait_gtpu_fail(ctxB);
+
+		/* Validate if clients can interact using global addr. */
+		f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_glob, addrB_glob));
+		f_wait_gtpu_fail(ctxB);
+
+		f_pdp_ctx_del(ctxA, '1'B);
+	}
+
 	/* Test PDP context activation for dynamic IPv4 EUA without DNS request */
 	testcase TC_pdp4_act_deact() runs on GT_CT {
 		f_init();
@@ -1263,6 +1328,21 @@
 		f_pdp_ctx_del(ctx, '1'B);
 	}
 
+	/* Validate if different clients (pdp ctx) can reach one another through GGSN. */
+	testcase TC_pdp4_clients_interact() runs on GT_CT {
+		f_init();
+		var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
+		var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
+		f_pdp_ctx_act(ctxA);
+		f_pdp_ctx_act(ctxB);
+		var OCT4 addrA := ctxA.eua.endUserAddress.endUserAddressIPv4.ipv4_address;
+		var OCT4 addrB := ctxB.eua.endUserAddress.endUserAddressIPv4.ipv4_address;
+		f_send_gtpu(ctxA, f_gen_icmpv4_echo(addrA, addrB));
+		f_wait_icmp4_echo_request(ctxB);
+
+		f_pdp_ctx_del(ctxA, '1'B);
+	}
+
 	testcase TC_echo_req_resp() runs on GT_CT {
 		f_init();
 		f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr));
@@ -1280,11 +1360,13 @@
 		execute(TC_pdp4_act_deact_ipcp());
 		execute(TC_pdp4_act_deact_pcodns());
 		execute(TC_pdp4_act_deact_gtpu_access());
+		execute(TC_pdp4_clients_interact());
 
 		execute(TC_pdp6_act_deact());
 		execute(TC_pdp6_act_deact_pcodns());
 		execute(TC_pdp6_act_deact_icmp6());
 		execute(TC_pdp6_act_deact_gtpu_access());
+		execute(TC_pdp6_clients_interact());
 
 		execute(TC_echo_req_resp());
 	}

-- 
To view, visit https://gerrit.osmocom.org/6205
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list