aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-09-13 23:17:50 +0200
committerHarald Welte <laforge@osmocom.org>2020-10-12 17:19:20 +0200
commit7dcf174098ed967e7e5294f684010ee0e1ec0e67 (patch)
tree3ab089b828b689ee6e41c3f350729470d8782910
parent17bab82de04ef229544509d2cd0569d8b5f2dcb0 (diff)
FRNET: Frame Relay network side emulation
-rw-r--r--fr-net/FRNET_Tests.cfg16
-rw-r--r--fr-net/FRNET_Tests.default15
-rw-r--r--fr-net/FRNET_Tests.ttcn60
-rwxr-xr-xfr-net/gen_links.sh55
-rwxr-xr-xfr-net/regen_makefile.sh9
5 files changed, 155 insertions, 0 deletions
diff --git a/fr-net/FRNET_Tests.cfg b/fr-net/FRNET_Tests.cfg
new file mode 100644
index 00000000..dedd8283
--- /dev/null
+++ b/fr-net/FRNET_Tests.cfg
@@ -0,0 +1,16 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./FRNET_Tests.default"
+
+[LOGGING]
+
+[MODULE_PARAMETERS]
+
+[TESTPORT_PARAMETERS]
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+FRNET_Tests.control
diff --git a/fr-net/FRNET_Tests.default b/fr-net/FRNET_Tests.default
new file mode 100644
index 00000000..e2fe60d7
--- /dev/null
+++ b/fr-net/FRNET_Tests.default
@@ -0,0 +1,15 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+
+[LOGGING]
+#*.FileMask := LOG_ALL
+ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | DEBUG_ENCDEC | USER
+
+[MODULE_PARAMETERS]
+
+[TESTPORT_PARAMETERS]
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
diff --git a/fr-net/FRNET_Tests.ttcn b/fr-net/FRNET_Tests.ttcn
new file mode 100644
index 00000000..6877e233
--- /dev/null
+++ b/fr-net/FRNET_Tests.ttcn
@@ -0,0 +1,60 @@
+module FRNET_Tests {
+
+import from General_Types all;
+import from Osmocom_Types all;
+
+import from NS_Emulation all;
+
+modulepar {
+ NSConfigurations mp_nsconfig := {
+ {
+ provider := {
+ fr := {
+ netdev := "hdlc2",
+ dlci := 123
+ }
+ },
+ nsvci := 123,
+ nsei := 123,
+ role_sgsn := true,
+ handle_sns := false
+ }
+ };
+}
+
+type record GbInstance {
+ NS_CT vc_NS
+ //BSSGP_CT vc_BSSGP,
+ //BssgpConfig cfg
+};
+
+const integer NUM_GB := 1;
+type record length(NUM_GB) of GbInstance GbInstances;
+type record length(NUM_GB) of NSConfiguration NSConfigurations;
+//type record length(NUM_GB) of BssgpCellId BssgpCellIds;
+
+
+type component test_CT {
+ var GbInstances g_gb;
+ port NS_PT NS[NUM_GB];
+};
+
+private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
+ var charstring id_idx := id & int2str(offset);
+ gb.vc_NS := NS_CT.create(id_idx & "-NSemu");
+ //gb_vc_BSSGP := BSSGP_CT.create(id_idx & "-BSSGPemu");
+ //connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP);
+ connect(self:NS[offset], gb.vc_NS:NS_SP);
+ gb.vc_NS.start(NSStart(mp_nsconfig[offset], id_idx));
+ //gb.vc_BSSGP.start(BssgpStart(gb.cfg));
+}
+
+testcase TC_foo() runs on test_CT {
+ f_init_gb(g_gb[0], "gb", 0);
+ while (true) {
+ f_sleep(100.0);
+ }
+}
+
+
+}
diff --git a/fr-net/gen_links.sh b/fr-net/gen_links.sh
new file mode 100755
index 00000000..4ab3ed0c
--- /dev/null
+++ b/fr-net/gen_links.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+BASEDIR=../deps
+
+. ../gen_links.sh.inc
+
+#DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src
+#FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn"
+#gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src
+FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCInterface.cc TCCInterface_ip.h"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src
+FILES="Socket_API_Definitions.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.IPL4asp/src
+FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.NS_v7.3.0/src
+FILES="NS_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.BSSGP_v13.0.0/src
+FILES="BSSGP_EncDec.cc BSSGP_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.LLC_v7.1.0/src
+FILES="LLC_EncDec.cc LLC_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolModules.SNDCP_v7.0.0/src
+FILES="SNDCP_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.TELNETasp/src
+FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.AF_PACKET/src
+FILES="AF_PACKET_PT.cc AF_PACKET_PT.hh AF_PACKET_PortType.ttcn AF_PACKET_PortTypes.ttcn "
+FILES+="FrameRelay_Types.ttcn FrameRelay_CodecPort.ttcn FrameRelay_Emulation.ttcn Q931_Types.ttcn Q933_Types.ttcn "
+gen_links $DIR $FILES
+
+DIR=../library
+FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc GSM_Types.ttcn Osmocom_Types.ttcn "
+FILES+="NS_Provider_IPL4.ttcn NS_Provider_FR.ttcn NS_Emulation.ttcnpp NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
+FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
+FILES+="LLC_Templates.ttcn "
+gen_links $DIR $FILES
+
+ignore_pp_results
diff --git a/fr-net/regen_makefile.sh b/fr-net/regen_makefile.sh
new file mode 100755
index 00000000..0a9f392c
--- /dev/null
+++ b/fr-net/regen_makefile.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+FILES="*.ttcn *.ttcnpp IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc Native_FunctionDefs.cc "
+FILES+="BSSGP_EncDec.cc NS_CodecPort_CtrlFunctDef.cc LLC_EncDec.cc TELNETasp_PT.cc "
+FILES+="AF_PACKET_PT.cc AF_PACKET_PT.hh "
+
+export CPPFLAGS_TTCN3="-DNS_EMULATION_FR"
+
+../regen-makefile.sh FRNET_Tests.ttcn $FILES