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
This commit is contained in:
Pau Espin 2018-01-30 17:20:22 +01:00
parent 3d9338fb92
commit 6c7285d682
2 changed files with 84 additions and 0 deletions

View File

@ -27,10 +27,12 @@ GGSN_Tests.TC_pdp4_act_deact
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

View File

@ -747,6 +747,18 @@ module GGSN_Tests {
}
}
/* 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 @@ module GGSN_Tests {
}
}
/* 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 @@ module GGSN_Tests {
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));
@ -1076,6 +1105,11 @@ module GGSN_Tests {
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 */
function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT {
f_wait_icmp6(ctx, (tr_ICMPv6_ERP,tr_ICMPv6_DU));
@ -1183,6 +1217,37 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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 @@ module GGSN_Tests {
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());
}