RAW_NS: rework NS connection to use NS_Provider
Previous RAW_NS only supported NS over UDP because
it handled the UDP connection on it's own.
Because of this there was no cleanup function for the tests
because no virtual component were started.
Using the new NS_Provider allows to use the same tests over
UDP and FR with no changes.
Change-Id: I8a3b6c72798a75f434f54229fdbfc802cd13967e
diff --git a/sgsn/SGSN_Tests_NS.ttcn b/sgsn/SGSN_Tests_NS.ttcn
index cce32cc..9ef2dfb 100644
--- a/sgsn/SGSN_Tests_NS.ttcn
+++ b/sgsn/SGSN_Tests_NS.ttcn
@@ -13,7 +13,6 @@
import from Osmocom_Types all;
import from Osmocom_Gb_Types all;
import from Osmocom_VTY_Functions all;
-import from NS_CodecPort all;
import from NS_Types all;
import from RAW_NS all;
import from SGSN_Tests all;
@@ -23,31 +22,31 @@
testcase TC_NS_connect_reset() runs on RAW_Test_CT {
f_init_vty();
- f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 10);
+ f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock enabled");
/* Send a NS-ALIVE */
f_outgoing_ns_reset();
f_sleep(1.0);
- f_cleanup();
+ f_clean_ns_codec();
}
testcase TC_NS_connect_alive() runs on RAW_Test_CT {
f_init_vty();
- f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0, tc_offset := 20);
+ f_init_ns_codec(mp_nsconfig[0], guard_secs := 10.0);
f_vty_config(SGSNVTY, "ns", "encapsulation udp use-reset-block-unblock disabled");
/* Send a NS-ALIVE */
- NSCP[0].send(t_NS_Send(g_ns_conn_id[0], t_NS_ALIVE));
+ NSCP[0].send(t_NS_ALIVE);
alt {
- [] NSCP[0].receive(t_NS_RecvFrom(t_NS_ALIVE_ACK));
- [] NSCP[0].receive(t_NS_RecvFrom(tr_NS_STATUS(*))) { setverdict(fail); }
+ [] NSCP[0].receive(t_NS_ALIVE_ACK);
+ [] NSCP[0].receive(tr_NS_STATUS(*)) { setverdict(fail); }
[] NSCP[0].receive { repeat; }
}
f_sleep(1.0);
- f_cleanup();
+ f_clean_ns_codec();
}
control {
diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh
index 47baa54..8cffa17 100755
--- a/sgsn/gen_links.sh
+++ b/sgsn/gen_links.sh
@@ -84,7 +84,7 @@
DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc "
-FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp PCUIF_Types.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc "
+FILES+="NS_Provider_IPL4.ttcn NS_Emulation.ttcnpp PCUIF_Types.ttcn "
FILES+="BSSGP_Emulation.ttcnpp Osmocom_Gb_Types.ttcn "
FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn "
FILES+="Osmocom_VTY_Functions.ttcn "
@@ -92,7 +92,7 @@
FILES+="RAN_Emulation.ttcnpp RAN_Adapter.ttcnpp SCCP_Templates.ttcn "
# IPA_Emulation + dependencies
FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc Native_Functions.ttcn Native_FunctionDefs.cc GSUP_Types.ttcn GSUP_Emulation.ttcn "
-FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn IPCP_Types.ttcn RAW_NS.ttcn "
+FILES+="GTP_CodecPort.ttcn GTP_CodecPort_CtrlFunct.ttcn GTP_CodecPort_CtrlFunctDef.cc GTP_Emulation.ttcn GTP_Templates.ttcn IPCP_Types.ttcn RAW_NS.ttcnpp "
gen_links $DIR $FILES
ignore_pp_results
diff --git a/sgsn/regen_makefile.sh b/sgsn/regen_makefile.sh
index 55ff26f..e160379 100755
--- a/sgsn/regen_makefile.sh
+++ b/sgsn/regen_makefile.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-FILES="*.ttcn *.ttcnpp *.asn BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc NS_CodecPort_CtrlFunctDef.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc SCCP_EncDec.cc SCTPasp_PT.cc RANAP_EncDec.cc "
+FILES="*.ttcn *.ttcnpp *.asn BSSGP_EncDec.cc LLC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RLCMAC_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc IPA_CodecPort_CtrlFunctDef.cc GTPU_EncDec.cc GTPC_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc SCCP_EncDec.cc SCTPasp_PT.cc RANAP_EncDec.cc "
export CPPFLAGS_TTCN3="-DIPA_EMULATION_GSUP -DIPA_EMULATION_CTRL -DUSE_MTP3_DISTRIBUTOR -DRAN_EMULATION_RANAP -DBSSGP_EM_L3"