summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-09-21 22:50:41 +0800
committerHarald Welte <laforge@gnumonks.org>2017-09-21 22:50:41 +0800
commitbb5a19e53c46d78893e63744d4bb7b6d20dfda50 (patch)
tree8d329dadf5adea7109a632eef25f02865f42b0b7
parent21ba5574f9955bbd7925b9a25e50d38e6050fc26 (diff)
ggsn_tests: Remove incomplete user plane testing code
In commit 0b7545dff13394fcaac2a9f904fe6858bca7d661 I accidentially committed incomplete support for user plane (GTP-U) testing to the GGSN test. This code has caused the jenkins tests since August 26th to fail, let's revert it until this is fully implemented + tested.
-rw-r--r--ggsn_tests/GGSN_Tests.cfg14
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn154
2 files changed, 6 insertions, 162 deletions
diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg
index 6954e1d..a7f4681 100644
--- a/ggsn_tests/GGSN_Tests.cfg
+++ b/ggsn_tests/GGSN_Tests.cfg
@@ -11,14 +11,13 @@ LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
system.*.lazy_conn_id_handling := "YES"
[MODULE_PARAMETERS]
-GGSN_Tests.m_bind_ip_gtpc := "172.18.0.202"
-GGSN_Tests.m_bind_ip_gtpu := "172.18.0.202"
-GGSN_Tests.m_ggsn_ip_gtpc := "172.18.0.201"
-GGSN_Tests.m_ggsn_ip_gtpu := "172.18.0.201"
-GGSN_Tests.m_pdn_sock_host_v4 = "172.17.0.2"
+GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1"
+GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1"
+GGSN_Tests.m_ggsn_ip_gtpc := "127.0.23.1"
+GGSN_Tests.m_ggsn_ip_gtpu := "127.0.23.1"
[EXECUTE]
-GGSN_Tests.TC_dummy
+#GGSN_Tests.TC_dummy
GGSN_Tests.TC_pdp4_act_deact
GGSN_Tests.TC_pdp4_act_deact_ipcp
GGSN_Tests.TC_pdp4_act_deact_pcodns
@@ -28,6 +27,3 @@ GGSN_Tests.TC_pdp6_act_deact_pcodns
GGSN_Tests.TC_pdp6_act_deact_icmp6
GGSN_Tests.TC_echo_req_resp
-
-GGSN_Tests.TC_pdp4_act_deact_ipcp_udp
-
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 221b297..dd9acbc 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -11,7 +11,6 @@ module GGSN_Tests {
import from IP_Types all;
import from ICMPv6_Types all;
import from Native_Functions all;
- import from UDP_Types all;
const integer GTP0_PORT := 3386;
const integer GTP1C_PORT := 2123;
@@ -23,10 +22,6 @@ module GGSN_Tests {
charstring m_ggsn_ip_gtpc := "127.0.0.6";
charstring m_ggsn_ip_gtpu := "127.0.0.6";
-
- /* IPv4 address on the external PDN for testing user plane */
- charstring m_pdn_sock_host_v4 := "192.168.0.1";
- integer m_pdn_sock_port_v4 := 5555;
}
type set PdpContext {
@@ -37,7 +32,6 @@ module GGSN_Tests {
ProtConfigOptions pco_neg optional,
EndUserAddress eua,
OCT16 ip6_prefix optional,
- OCT4 ip4_addr optional,
BIT4 nsapi,
/* TEI (Data) local side */
OCT4 teid,
@@ -52,7 +46,6 @@ module GGSN_Tests {
type component GT_CT {
port GTPC_PT GTPC;
port GTPU_PT GTPU;
- port IPL4asp_PT UDP;
var boolean g_initialized := false;
@@ -60,16 +53,11 @@ module GGSN_Tests {
/* FIXME: unify with g_bind_ip + parse from config file */
var OCT4 g_sgsn_ip_c;
var OCT4 g_sgsn_ip_u;
- var OCT4 g_pdn_sock_ip;
/* FIXME: parse remName from config file */
var GtpPeer g_peer_c := { connId := 0, remName := m_ggsn_ip_gtpc, remPort := GTP1C_PORT };
var GtpPeer g_peer_u := { connId := 0, remName := m_ggsn_ip_gtpu, remPort := GTP1U_PORT };
- /* address to which we can bind an IP socket to simulate an internet host */
timer T_default := 3.0;
- /* UDP connection ID for UDP test port */
- var integer g_udp_connId;
-
/* next to-be-sent GTP-C sequence number */
var uint16_t g_c_seq_nr;
/* next to-be-sent GTP-U sequence number */
@@ -84,7 +72,6 @@ module GGSN_Tests {
g_sgsn_ip_c := f_inet_addr(m_bind_ip_gtpc);
g_sgsn_ip_u := f_inet_addr(m_bind_ip_gtpu);
- g_pdn_sock_ip := f_inet_haddr(m_pdn_sock_host_v4);
var Result res;
map(self:GTPC, system:GTPC);
@@ -96,10 +83,6 @@ module GGSN_Tests {
res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, m_bind_ip_gtpu, GTP1U_PORT, {udp:={}});
g_peer_u.connId:= res.connId;
- map(self:UDP, system:IPL4);
- res := IPL4asp_PortType.f_IPL4_listen(UDP, m_pdn_sock_host_v4, m_pdn_sock_port_v4, {udp:={}});
- g_udp_connId := res.connId;
-
g_restart_ctr := f_rnd_octstring(1);
g_c_seq_nr := f_rnd_int(65535);
g_d_seq_nr := f_rnd_int(65535);
@@ -221,7 +204,7 @@ module GGSN_Tests {
template EndUserAddress tr_EuaIPv4(template OCT4 ip_addr) modifies t_EuaIPv4 := {
endUserAddress := {
endUserAddressIPv4 := {
- lengthf := 2+4
+ lengthf := 2+lengthof(ip_addr)
}
}
}
@@ -687,9 +670,6 @@ module GGSN_Tests {
ctx.teid_remote := cpr.teidDataI.teidDataI;
ctx.teic_remote := cpr.teidControlPlane.teidControlPlane;
ctx.eua := cpr.endUserAddress;
- if (match(ctx.eua, tr_EuaIPv4(?))) {
- ctx.ip4_addr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address;
- }
ctx.pco_neg := cpr.protConfigOptions;
setverdict(pass);
} else {
@@ -836,28 +816,6 @@ module GGSN_Tests {
payload := payload
}
- /* template to construct IPv4_packet from input arguments, ready to use in f_IPv4_enc() */
- template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, octetstring payload, LIN1 ttl := 255) := {
- header := {
- ver := 4,
- hlen := 5,
- tos := 0,
- tlen := 0,
- id := f_rnd_int(65535),
- res := '0'B,
- dfrag := '1'B,
- mfrag := '0'B,
- foffset := 0,
- ttl := ttl,
- proto := proto,
- cksum := 0, /* overwritten in encoder */
- srcaddr := srcaddr,
- dstaddr := dstaddr
- },
- ext_headers := omit,
- payload := payload
- }
-
function f_ipv6_link_local(in OCT16 link_id) return OCT16 {
return 'FE80000000000000'O & substr(link_id, 8, 8);
}
@@ -928,103 +886,6 @@ module GGSN_Tests {
T_default.stop;
}
- template ASP_RecvFrom tr_UdpRecvFrom(template ConnectionId id, template HostName remName, template PortNumber remPort,
- template HostName locName, template PortNumber locPort, template octetstring payload) := {
- connId := id,
- remName := remName,
- remPort := remPort,
- locName := locName,
- locPort := locPort,
- proto := { udp := {} },
- userData := ?,
- msg := payload
- }
- function f_gen_UdpRT(template HostName remName, template PortNumber remPort,
- template octetstring payload) runs on GT_CT return template ASP_RecvFrom {
- return tr_UdpRecvFrom(g_udp_connId, remName, remPort, m_pdn_sock_host_v4, m_pdn_sock_port_v4, payload);
- }
-
- template ASP_SendTo ts_UdpSendTo(ConnectionId id, HostName remName, PortNumber remPort, octetstring payload) := {
- connId := id,
- remName := remName,
- remPort := remPort,
- proto := { udp := {} },
- msg := payload
- }
- function f_gen_UdpST(HostName remName, PortNumber remPort, octetstring payload) runs on GT_CT return ASP_SendTo {
- return valueof(ts_UdpSendTo(g_udp_connId, remName, remPort, payload));
- }
-
- template UDP_packet ts_UDP(uint16_t srcport, uint16_t dstport, octetstring payload) := {
- header := {
- srcport := srcport,
- dstport := dstport,
- len := lengthof(payload),
- cksum := 0
- },
- payload := payload
- }
-
- function f_gen_UDP4(OCT4 saddr, uint16_t sport, OCT4 daddr, uint16_t dport, octetstring payload) return octetstring {
- var octetstring udp := f_UDP_enc(valueof(ts_UDP(sport, dport, payload)));
- var UDP_pseudo_header phdr := {
- ipv4 := {
- srcaddr := saddr, dstaddr := daddr, zero := 0,
- proto := 17, plen := 0
- }
- };
- /* compute UDP checksum and patch into UDP binary */
- var OCT2 udpcksum := f_UDP_checksum(f_UDP_pseudo_header_enc(phdr) & udp);
- udp[6] := udpcksum[0];
- udp[7] := udpcksum[1];
- return f_IPv4_enc(valueof(ts_IP4(saddr, daddr, 17, udp)));
- }
-
- function f_gen_UDP6(OCT16 saddr, uint16_t sport, OCT16 daddr, uint16_t dport, octetstring payload) return octetstring {
- var octetstring udp := f_UDP_enc(valueof(ts_UDP(sport, dport, payload)));
- var UDP_pseudo_header phdr := {
- ipv6 := {
- srcaddr := saddr, dstaddr := daddr, plen := 0,
- zero := 0, nextheader := 17
- }
- };
- /* compute UDP checksum and patch into UDP binary */
- var OCT2 udpcksum := f_UDP_checksum(f_UDP_pseudo_header_enc(phdr) & udp);
- udp[6] := udpcksum[0];
- udp[7] := udpcksum[1];
- return f_IPv6_enc(valueof(ts_IP6(saddr, daddr, 17, udp)));
- }
-
- /* Send a packet via GTP (SGSN->GGSN) and confirm it arrives on UDP socket */
- function f_transceive_udp_mo(PdpContext ctx, octetstring udp_payload) runs on GT_CT {
- var uint16_t src_port := 8888;
- /* build packet with UDP and IP header */
- var octetstring ip_packet := f_gen_UDP4(ctx.ip4_addr, src_port, g_pdn_sock_ip, m_pdn_sock_port_v4, udp_payload);
- /* send IP packet wrapped in GTP for given PDP context */
- f_send_gtpu(ctx, ip_packet)
- /* wait for it to arrive on UDP socket */
- T_default.start;
- alt {
- [] UDP.receive(f_gen_UdpRT(f_inet_hntoa(ctx.ip4_addr), src_port, udp_payload)) { setverdict(pass); }
- [] UDP.receive { setverdict(fail); }
- [] T_default.timeout { setverdict(fail); }
- }
- T_default.stop;
- }
-
- function f_transceive_udp_mt(PdpContext ctx, octetstring udp_payload) runs on GT_CT {
- var uint16_t dst_port := 7777;
- var octetstring ip_packet := f_gen_UDP4(g_pdn_sock_ip, m_pdn_sock_port_v4, ctx.ip4_addr, dst_port, udp_payload);
- /* Send IP packet in GGSN -> MS direction */
- UDP.send(f_gen_UdpST(f_inet_hntoa(ctx.ip4_addr), dst_port, udp_payload));
- T_default.start;
- alt {
- [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ctx.teid, ?)) { /* FIXME: check for ip_packet */}
- [] T_default.timeout { setverdict(fail); }
- }
- T_default.stop;
- }
-
/* Test IPv6 context activation for dynamic IPv6 EUA without request of IPv6 DNS */
testcase TC_pdp6_act_deact() runs on GT_CT {
f_init();
@@ -1088,19 +949,6 @@ module GGSN_Tests {
f_pdp_ctx_del(ctx, '1'B);
}
- /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP + UDP user data */
- testcase TC_pdp4_act_deact_ipcp_udp() runs on GT_CT {
- f_init();
- var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
- ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP);
- f_pdp_ctx_act(ctx);
- for (var integer i := 0; i < 10; i := i + i) {
- var octetstring payload := f_rnd_octstring(512);
- f_transceive_udp_mo(ctx, payload);
- }
- f_pdp_ctx_del(ctx, '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));