summaryrefslogtreecommitdiffstats
path: root/ggsn_tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-18 22:53:30 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-19 11:50:08 +0200
commitddeecbb4eded046f7a03f6012a1af20e7e3b7e13 (patch)
treef20bc98e9db4c73cad44f11f6f594e3aff13715a /ggsn_tests
parent99ef9a446c8af63df0e66686d683304e0780dad0 (diff)
GGSN_Tests: Make SGSN and GGSN addresses configurable via modulepar
Diffstat (limited to 'ggsn_tests')
-rw-r--r--ggsn_tests/GGSN_Tests.cfg6
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn26
-rwxr-xr-xggsn_tests/gen_links.sh2
-rwxr-xr-xggsn_tests/regen_makefile.sh2
4 files changed, 26 insertions, 10 deletions
diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg
index 87cd456..07f0b43 100644
--- a/ggsn_tests/GGSN_Tests.cfg
+++ b/ggsn_tests/GGSN_Tests.cfg
@@ -5,6 +5,12 @@ ConsoleMask := DEBUG | LOG_ALL | MATCHING | DEBUG_TESTPORT
*.*.lazy_conn_id_handling := "YES"
system.*.lazy_conn_id_handling := "YES"
+[MODULE_PARAMETERS]
+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_pdp4_act_deact
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index b3e26d5..ecc7d7a 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -10,12 +10,19 @@ module GGSN_Tests {
import from GTPU_Types all;
import from IP_Types all;
import from ICMPv6_Types all;
+ import from Native_Functions all;
const integer GTP0_PORT := 3386;
const integer GTP1C_PORT := 2123;
const integer GTP1U_PORT := 2152;
- const charstring g_bind_ip_c := "127.23.42.1";
- const charstring g_bind_ip_u := g_bind_ip_c;
+
+ modulepar {
+ charstring m_bind_ip_gtpc := "127.23.42.1";
+ charstring m_bind_ip_gtpu := "127.23.42.1";
+
+ charstring m_ggsn_ip_gtpc := "127.0.0.6";
+ charstring m_ggsn_ip_gtpu := "127.0.0.6";
+ }
type set PdpContext {
hexstring imsi,
@@ -44,11 +51,11 @@ module GGSN_Tests {
var OCT1 g_restart_ctr := '01'O;
/* FIXME: unify with g_bind_ip + parse from config file */
- var OCT4 g_sgsn_ip_c := '7f172a01'O;
- var OCT4 g_sgsn_ip_u := '7f172a01'O;
+ var OCT4 g_sgsn_ip_c;
+ var OCT4 g_sgsn_ip_u;
/* FIXME: parse remName from config file */
- var GtpPeer g_peer_c := { connId := 0, remName := "127.0.0.6", remPort := GTP1C_PORT };
- var GtpPeer g_peer_u := { connId := 0, remName := "127.0.0.6", remPort := GTP1U_PORT };
+ 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 };
timer T_default := 3.0;
/* next to-be-sent GTP-C sequence number */
@@ -63,14 +70,17 @@ module GGSN_Tests {
}
g_initialized := true;
+ g_sgsn_ip_c := f_inet_addr(m_bind_ip_gtpc);
+ g_sgsn_ip_u := f_inet_addr(m_bind_ip_gtpu);
+
var Result res;
map(self:GTPC, system:GTPC);
- res := GTP_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, g_bind_ip_c, GTP1C_PORT, {udp:={}});
+ res := GTP_CodecPort_CtrlFunct.f_IPL4_listen(GTPC, m_bind_ip_gtpc, GTP1C_PORT, {udp:={}});
log("GTP1C ConnectionID: ", res.connId);
g_peer_c.connId := res.connId;
map(self:GTPU, system:GTPU);
- res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, g_bind_ip_u, GTP1U_PORT, {udp:={}});
+ res := GTP_CodecPort_CtrlFunct.f_GTPU_listen(GTPU, m_bind_ip_gtpu, GTP1U_PORT, {udp:={}});
g_peer_u.connId:= res.connId;
g_restart_ctr := f_rnd_octstring(1);
diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh
index 549e272..d0f410a 100755
--- a/ggsn_tests/gen_links.sh
+++ b/ggsn_tests/gen_links.sh
@@ -16,7 +16,7 @@ gen_links() {
#gen_links $DIR $FILES
DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src
-FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h"
+FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h Native_Functions.ttcn Native_FunctionDefs.cc"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src
diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh
index c367c12..dd98dcc 100755
--- a/ggsn_tests/regen_makefile.sh
+++ b/ggsn_tests/regen_makefile.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc"
+FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc"
ttcn3_makefilegen -f GGSN_Tests.ttcn $FILES
sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile