[PATCH] osmo-ttcn3-hacks[master]: MSC: Use VTY to enable/disable authentication + TMSI allocation

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jan 24 21:42:45 UTC 2018


Review at  https://gerrit.osmocom.org/6038

MSC: Use VTY to enable/disable authentication + TMSI allocation

Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617
---
M msc_tests/MSC_Tests.cfg
M msc_tests/MSC_Tests.ttcn
M msc_tests/gen_links.sh
M msc_tests/regen_makefile.sh
4 files changed, 50 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6038/1

diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg
index 2bd9dd2..ab8a2ff 100644
--- a/msc_tests/MSC_Tests.cfg
+++ b/msc_tests/MSC_Tests.cfg
@@ -10,16 +10,27 @@
 "MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING;
 "MSC_Test-GSUP".FileMask := ERROR | WARNING;
 "IPA-CTRL-IPA".FileMask := ERROR | WARNING;
+mtc.FileMask := ERROR | WARNING;
 
 [TESTPORT_PARAMETERS]
 #*.*.udpReuseAddress := "yes";
 "MSC_Test-MNCC".MNCC.socket_type := "SEQPACKET";
+*.MSCVTY.CTRL_MODE := "client"
+*.MSCVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.MSCVTY.CTRL_PORTNUM := "4254"
+*.MSCVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.MSCVTY.CTRL_READMODE := "buffered"
+*.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.MSCVTY.PROMPT1 := "OsmoMSC> "
+
 
 [MODULE_PARAMETERS]
 M3UA_Emulation.tsp_logVerbose := true;
 BSSAP_Adapter.mp_own_pc := 193;		/* 0.23.3 */
 BSSAP_Adapter.mp_peer_pc := 185;	/* 0.23.1 */
 BSSAP_Adapter.mp_sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" };
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoMSC";
 
 [MAIN_CONTROLLER]
 
diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn
index 3c0a460..e0ee84c 100644
--- a/msc_tests/MSC_Tests.ttcn
+++ b/msc_tests/MSC_Tests.ttcn
@@ -20,6 +20,9 @@
 import from Osmocom_CTRL_Types all;
 import from Osmocom_CTRL_Adapter all;
 
+import from TELNETasp_PortType all;
+import from Osmocom_VTY_Functions all;
+
 import from MNCC_Emulation all;
 import from MNCC_Types all;
 
@@ -49,6 +52,8 @@
 
 	/* only to get events from IPA underneath GSUP */
 	port IPA_CTRL_PT GSUP_IPA_EVENT;
+	/* VTY to MSC */
+	port TELNETasp_PT MSCVTY;
 }
 
 modulepar {
@@ -117,6 +122,10 @@
 	f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port);
 	f_init_mncc("MSC_Test");
 	f_init_gsup("MSC_Test");
+
+	map(self:MSCVTY, system:MSCVTY);
+	f_vty_set_prompts(MSCVTY);
+	f_vty_transceive(MSCVTY, "enable");
 }
 
 template PDU_BSSAP ts_BSSAP_BSSMAP := {
@@ -343,6 +352,17 @@
 	T.timeout;
 }
 
+function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
+{
+	/* enter config mode; enter node */
+	f_vty_enter_config(pt);
+	f_vty_transceive(pt, config_node);
+	/* execute command */
+	f_vty_transceive(pt, cmd);
+	/* leave config mode */
+	f_vty_transceive(pt, "end");
+}
+
 private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	g_pars := pars;
 	f_perform_lu(false, true, true);
@@ -350,6 +370,8 @@
 testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
+	f_vty_config(MSCVTY, "msc", "assign-tmsi");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1);
 	vc_conn.done;
@@ -362,6 +384,8 @@
 testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
+	f_vty_config(MSCVTY, "msc", "no assign-tmsi");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2);
 	vc_conn.done;
@@ -391,6 +415,7 @@
 testcase TC_lu_imsi_reject() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3);
 	vc_conn.done;
@@ -421,6 +446,7 @@
 testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4);
 	vc_conn.done;
@@ -433,6 +459,7 @@
 testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication required");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), testcasename(), 5);
 	vc_conn.done;
@@ -475,6 +502,7 @@
 testcase TC_cmserv_imsi_unknown() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 	vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5);
 	vc_conn.done;
 }
@@ -525,6 +553,7 @@
 testcase TC_lu_and_mo_call() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6);
 	vc_conn.done;
@@ -558,6 +587,7 @@
 testcase TC_lu_auth_sai_timeout() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication required");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7);
 	vc_conn.done;
@@ -591,6 +621,7 @@
 testcase TC_lu_auth_sai_err() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication required");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8);
 	vc_conn.done;
@@ -687,6 +718,7 @@
 testcase TC_lu_by_imei() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9);
 	vc_conn.done;
@@ -734,6 +766,7 @@
 testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1);
 	vc_conn.done;
@@ -893,6 +926,7 @@
 testcase TC_emerg_call_imsi() runs on MTC_CT {
 	var BSC_ConnHdlr vc_conn;
 	f_init();
+	f_vty_config(MSCVTY, "network", "authentication optional");
 
 	vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6);
 	vc_conn.done;
diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh
index cfef012..30ebed1 100755
--- a/msc_tests/gen_links.sh
+++ b/msc_tests/gen_links.sh
@@ -70,9 +70,12 @@
 FILES="RTP_EncDec.cc RTP_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=../library
-FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn "
+FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn "
 FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn "
 FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn "
 FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn "
diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh
index ce33695..10ec38f 100755
--- a/msc_tests/regen_makefile.sh
+++ b/msc_tests/regen_makefile.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-FILES="*.ttcn SCCP_EncDec.cc  SCTPasp_PT.cc  TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c"
+FILES="*.ttcn SCCP_EncDec.cc  SCTPasp_PT.cc  TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc *.c"
 
 ../regen-makefile.sh MSC_Tests.ttcn $FILES

-- 
To view, visit https://gerrit.osmocom.org/6038
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list