[M] Change in osmo-ttcn3-hacks[master]: WIP: asterisk: Initial IMS registration

2024-05-08 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36756?usp=email )

Change subject: WIP: asterisk: Initial IMS registration
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36756?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Idbb390e34ab3d008009a0f1b182c4165c86100e4
Gerrit-Change-Number: 36756
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


[M] Change in osmo-ttcn3-hacks[master]: WIP: asterisk: Initial IMS registration

2024-05-08 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36759?usp=email )


Change subject: WIP: asterisk: Initial IMS registration
..

WIP: asterisk: Initial IMS registration

Change-Id: Idb3b19ccd82cad25948106b2c72aa424d7f79cd8
---
M asterisk/Asterisk_Tests.ttcn
M asterisk/IMS_ConnectionHandler.ttcn
2 files changed, 202 insertions(+), 2 deletions(-)



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

diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn
index 08a5f65..67e73e0 100644
--- a/asterisk/Asterisk_Tests.ttcn
+++ b/asterisk/Asterisk_Tests.ttcn
@@ -37,6 +37,7 @@

charstring mp_local_ims_host := "127.0.0.3";
integer mp_local_ims_port := 5060;
+   charstring mp_ims_imsi := "23801090828";

/* Asterisk AMI: */
charstring mp_ami_remote_host := "127.0.0.1";
@@ -45,6 +46,7 @@
integer mp_ami_local_port := 0;
charstring mp_ami_user := "test_user";
charstring mp_ami_secret := "1234";
+   charstring mp_volte_ims_outbound_registration := "volte_ims";
 }

 type component test_CT {
@@ -74,6 +76,15 @@
return valueof(pars);
 }

+function f_init_IMS_ConnHdlrPars(integer idx := 1) runs on test_CT return 
IMS_ConnHdlrPars {
+   var template (value) IMS_CallPars cp := 
t_IMS_CallPars(mp_local_sip_host, 1234 + 2*idx);
+   var template (value) IMS_ConnHdlrPars pars := 
t_IMS_Pars(mp_local_ims_host,
+
mp_local_ims_port,
+mp_ims_imsi,
+cp := cp);
+   return valueof(pars);
+}
+
 /* Initialize connection towards Asterisk AMI */
 private function f_init_ami() runs on test_CT {
var charstring id := "Asterisk_Tests_AMI_EMU";
@@ -139,6 +150,22 @@
return vc_conn;
 }

+function f_start_handler_IMS(ims_void_fn fn, IMS_ConnHdlrPars pars)
+runs on test_CT return IMS_ConnHdlr {
+   var IMS_ConnHdlr vc_conn;
+   var charstring id := testcasename() & "-IMS_ConnHdlr-" & pars.user;
+
+   vc_conn := IMS_ConnHdlr.create(id) alive;
+
+   connect(vc_conn:SIP, vc_IMS:CLIENT);
+   connect(vc_conn:SIP_PROC, vc_IMS:CLIENT_PROC);
+
+   connect(vc_conn:COORD, self:IMS_COORD);
+
+   vc_conn.start(f_ims_handler_init(fn, id, pars));
+   return vc_conn;
+}
+
 /* Test SIP registration of local clients */
 private function f_TC_internal_registration(charstring id) runs on SIPConnHdlr 
{

@@ -322,12 +349,49 @@
setverdict(pass);
 }

+/* Test SIP registration of local clients */
+private function f_TC_ims_registration(charstring id) runs on IMS_ConnHdlr {
+   
f_create_sip_expect(valueof(ts_SipUrl_from_Addr_Union(g_pars.registrar_sip_record.addr)));
+   as_IMS_register();
+   setverdict(pass);
+}
+testcase TC_ims_registration() runs on test_CT {
+   var IMS_ConnHdlrPars pars;
+   var IMS_ConnHdlr vc_conn;
+   f_init();
+   pars := f_init_IMS_ConnHdlrPars();
+   vc_conn := f_start_handler_IMS(refers(f_TC_ims_registration), pars);
+
+   /* Clear events: */
+   AMI_CLIENT.clear;
+   /* Trigger registration: */
+   f_ami_action_PJSIPRegister(AMI_CLIENT, 
mp_volte_ims_outbound_registration);
+   /* TODO: Rx "Event: AuthRequest" */
+   /* TODO: Tx "Action: AuthResponse" */
+   /* TODO: Rx "Response: Success" */
+   /* TODO: once registration is successful, rx:
+* Event: Registry
+* ChannelType: pjsip
+* Username: 
+* Domain: 
+* Status: 
+* Cause:  */
+
+/* TODO: test "Action: PJSIPUnregister" */
+
+/* TODO: in another test emulating a call, test "Action: 
DedicatedBearerStatus" */
+
+   vc_conn.done;
+   f_shutdown();
+}
+
 control {
execute( TC_internal_registration() );
execute( TC_internal_call_momt() );
execute( TC_internal_call_all_2registered() );
execute( TC_internal_call_all_3registered() );
execute( TC_internal_call_all_4registered() );
+   execute( TC_ims_registration() );
 }

 }
diff --git a/asterisk/IMS_ConnectionHandler.ttcn 
b/asterisk/IMS_ConnectionHandler.ttcn
index a1baeb4..cded5fc 100644
--- a/asterisk/IMS_ConnectionHandler.ttcn
+++ b/asterisk/IMS_ConnectionHandler.ttcn
@@ -43,8 +43,8 @@

 type record IMS_ConnHdlrPars {
float t_guard,
-   charstring remote_sip_host,
-   uint16_t remote_sip_port,
+   charstring remote_sip_host optional,
+   uint16_t remote_sip_port optional,
charstring user,
charstring display_name,
charstring password,
@@ -66,6 +66,10 @@
/* Whether to expect CANCEL instead of ACK as answer to our OK */
boolean exp_cancel
 }
+template (value) IMS_CallParsMT t_IMS_CallParsMT := {
+   

[M] Change in osmo-ttcn3-hacks[master]: WIP: asterisk: Initial IMS registration

2024-05-08 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36756?usp=email )


Change subject: WIP: asterisk: Initial IMS registration
..

WIP: asterisk: Initial IMS registration

Change-Id: Idbb390e34ab3d008009a0f1b182c4165c86100e4
---
M asterisk/AMI_Functions.ttcn
M asterisk/Asterisk_Tests.ttcn
M asterisk/IMS_ConnectionHandler.ttcn
3 files changed, 211 insertions(+), 6 deletions(-)



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

diff --git a/asterisk/AMI_Functions.ttcn b/asterisk/AMI_Functions.ttcn
index a144239..1223051 100644
--- a/asterisk/AMI_Functions.ttcn
+++ b/asterisk/AMI_Functions.ttcn
@@ -26,7 +26,7 @@
 }

 const charstring AMI_FIELD_ACTION := "Action";
-const charstring AMI_FIELD_ACTION_ID := "ActionId";
+const charstring AMI_FIELD_ACTION_ID := "ActionID";
 const charstring AMI_FIELD_USERNAME := "Username";
 const charstring AMI_FIELD_SECRET := "Secret";
 const charstring AMI_FIELD_RESPONSE := "Response";
@@ -115,16 +115,21 @@
  * Secret: 
  */
 template (value) AMI_Msg
-ts_AMI_Action_Login(charstring username, charstring secret) := {
+ts_AMI_Action_Login(charstring username,
+   charstring secret,
+   template (value) charstring action_id := "0001") := {
ts_AMI_Field_Action("Login"),
+   ts_AMI_Field_ActionId(action_id),
ts_AMI_Field_Username(username),
ts_AMI_Field_Secret(secret)
 };

 template (present) AMI_Msg
 tr_AMI_Action_Login(template(present) charstring username := ?,
-   template(present) charstring secret := ?) := superset(
+   template(present) charstring secret := ?,
+   template (present) charstring action_id := ?) := superset(
tr_AMI_Field_Action("Login"),
+   tr_AMI_Field_ActionId(action_id),
tr_AMI_Field_Username(username),
tr_AMI_Field_Secret(secret)
 );
@@ -466,7 +471,8 @@
 }

 function f_ami_action_login(AMI_Msg_PT pt, charstring username, charstring 
secret) {
-   f_ami_transceive_match_response_success(pt, 
ts_AMI_Action_Login(username, secret));
+   var charstring reg_action_id := f_gen_action_id();
+   f_ami_transceive_match_response_success(pt, 
ts_AMI_Action_Login(username, secret, reg_action_id));
 }

 function f_ami_action_PJSIPRegister(AMI_Msg_PT pt, charstring register) {
diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn
index 08a5f65..acaafb8 100644
--- a/asterisk/Asterisk_Tests.ttcn
+++ b/asterisk/Asterisk_Tests.ttcn
@@ -37,6 +37,7 @@

charstring mp_local_ims_host := "127.0.0.3";
integer mp_local_ims_port := 5060;
+   charstring mp_ims_imsi := "0010102";

/* Asterisk AMI: */
charstring mp_ami_remote_host := "127.0.0.1";
@@ -45,6 +46,7 @@
integer mp_ami_local_port := 0;
charstring mp_ami_user := "test_user";
charstring mp_ami_secret := "1234";
+   charstring mp_volte_ims_outbound_registration := "volte_ims";
 }

 type component test_CT {
@@ -74,6 +76,15 @@
return valueof(pars);
 }

+function f_init_IMS_ConnHdlrPars(integer idx := 1) runs on test_CT return 
IMS_ConnHdlrPars {
+   var template (value) IMS_CallPars cp := 
t_IMS_CallPars(mp_local_sip_host, 1234 + 2*idx);
+   var template (value) IMS_ConnHdlrPars pars := 
t_IMS_Pars(mp_local_ims_host,
+
mp_local_ims_port,
+mp_ims_imsi,
+cp := cp);
+   return valueof(pars);
+}
+
 /* Initialize connection towards Asterisk AMI */
 private function f_init_ami() runs on test_CT {
var charstring id := "Asterisk_Tests_AMI_EMU";
@@ -139,6 +150,22 @@
return vc_conn;
 }

+function f_start_handler_IMS(ims_void_fn fn, IMS_ConnHdlrPars pars)
+runs on test_CT return IMS_ConnHdlr {
+   var IMS_ConnHdlr vc_conn;
+   var charstring id := testcasename() & "-IMS_ConnHdlr-" & pars.user;
+
+   vc_conn := IMS_ConnHdlr.create(id) alive;
+
+   connect(vc_conn:SIP, vc_SIP:CLIENT);
+   connect(vc_conn:SIP_PROC, vc_SIP:CLIENT_PROC);
+
+   connect(vc_conn:COORD, self:IMS_COORD);
+
+   vc_conn.start(f_ims_handler_init(fn, id, pars));
+   return vc_conn;
+}
+
 /* Test SIP registration of local clients */
 private function f_TC_internal_registration(charstring id) runs on SIPConnHdlr 
{

@@ -322,12 +349,48 @@
setverdict(pass);
 }

+/* Test SIP registration of local clients */
+private function f_TC_ims_registration(charstring id) runs on IMS_ConnHdlr {
+   as_IMS_register();
+   setverdict(pass);
+}
+testcase TC_ims_registration() runs on test_CT {
+   var IMS_ConnHdlrPars pars;
+   var IMS_ConnHdlr vc_conn;
+   f_init();
+   pars := f_init_IMS_ConnHdlrPars();
+   vc_conn := 

[M] Change in osmo-ttcn3-hacks[master]: WIP: asterisk: Introduce test TC_internal_call_momt

2024-04-08 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36541?usp=email )


Change subject: WIP: asterisk: Introduce test TC_internal_call_momt
..

WIP: asterisk: Introduce test TC_internal_call_momt

Related: SYS#6782
Change-Id: I7621ee867202b74a40e40516cdca673781cb1f51
---
M asterisk/Asterisk_Tests.ttcn
1 file changed, 61 insertions(+), 1 deletion(-)



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

diff --git a/asterisk/Asterisk_Tests.ttcn b/asterisk/Asterisk_Tests.ttcn
index dab9400..a0b3756 100644
--- a/asterisk/Asterisk_Tests.ttcn
+++ b/asterisk/Asterisk_Tests.ttcn
@@ -31,8 +31,16 @@
integer mp_remote_sip_port := 5060;
 }

+type port Coord_PT message
+{
+   inout charstring;
+} with { extension "internal" };
+private const charstring COORD_CMD_REGISTERED := "COORD_CMD_REGISTERED";
+private const charstring COORD_CMD_START := "COORD_CMD_START";
+
 type component test_CT {
var SIP_Emulation_CT vc_SIP;
+   port Coord_PT COORD;
 }

 type component ConnHdlr extends SIP_ConnHdlr {
@@ -40,6 +48,8 @@
timer g_Tguard;
var PDU_SIP_Request g_rx_sip_req;
var PDU_SIP_Response g_rx_sip_resp;
+
+   port Coord_PT COORD;
 }

 type record ConnHdlrPars {
@@ -138,6 +148,8 @@
connect(vc_conn:SIP, vc_SIP:CLIENT);
connect(vc_conn:SIP_PROC, vc_SIP:CLIENT_PROC);

+   connect(vc_conn:COORD, self:COORD);
+
vc_conn.start(f_handler_init(fn, id, pars));
return vc_conn;
 }
@@ -276,7 +288,6 @@
// f_SIP_deregister();
setverdict(pass);
 }
-
 testcase TC_internal_registration() runs on test_CT {
var ConnHdlrPars pars;
var ConnHdlr vc_conn;
@@ -286,6 +297,44 @@
vc_conn.done;
 }

+/* Successful SIP MO-MT Call between local clients: */
+private function f_TC_internal_call_mo(charstring id) runs on ConnHdlr {
+
+   f_SIP_register();
+
+   COORD.send(COORD_CMD_REGISTERED);
+
+   setverdict(pass);
+}
+private function f_TC_internal_call_mt(charstring id) runs on ConnHdlr {
+
+   f_SIP_register();
+
+   COORD.send(COORD_CMD_REGISTERED);
+
+   setverdict(pass);
+}
+testcase TC_internal_call_momt() runs on test_CT {
+   var ConnHdlrPars pars[2];
+   var ConnHdlr vc_conn[2];
+   f_init();
+   pars[0] := f_init_ConnHdlrPars(idx := 1);
+   pars[1] := f_init_ConnHdlrPars(idx := 2);
+
+   vc_conn[0] := f_start_handler(refers(f_TC_internal_call_mo), pars[0]);
+   vc_conn[1] := f_start_handler(refers(f_TC_internal_call_mt), pars[1]);
+
+   interleave {
+   [] COORD.receive(COORD_CMD_REGISTERED) from vc_conn[0];
+   [] COORD.receive(COORD_CMD_REGISTERED) from vc_conn[1];
+   }
+
+   COORD.send(COORD_CMD_START) to vc_conn[0];
+
+   vc_conn[0].done;
+   vc_conn[1].done;
+}
+
 testcase TC_selftest() runs on test_CT {
f_sip_digest_selftest();
setverdict(pass);
@@ -293,6 +342,7 @@

 control {
execute( TC_internal_registration() );
+   execute( TC_internal_call_momt() );
 }

 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36541?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7621ee867202b74a40e40516cdca673781cb1f51
Gerrit-Change-Number: 36541
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: WIP

2024-04-06 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36533?usp=email )


Change subject: WIP
..

WIP

Change-Id: I12ce55a6ba20ec5d0e17d8e225a002b391dc5285
---
M pgw/PGW_Tests.ttcn
1 file changed, 10 insertions(+), 1 deletion(-)



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

diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn
index a1850a0..5d7eaa0 100644
--- a/pgw/PGW_Tests.ttcn
+++ b/pgw/PGW_Tests.ttcn
@@ -270,7 +270,7 @@
vc_S6b.start(DIAMETER_Emulation.main(ops, pars, id));

f_diameter_wait_capability(Gx_UNIT);
-   f_diameter_wait_capability(Gy_UNIT);
+   //f_diameter_wait_capability(Gy_UNIT);
f_diameter_wait_capability(S6b_UNIT);
/* Give some time for our emulation to get out of SUSPECT list of SUT 
(3 watchdong ping-pongs):
 * RFC6733 sec 5.1

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36533?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I12ce55a6ba20ec5d0e17d8e225a002b391dc5285
Gerrit-Change-Number: 36533
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: WIP

2024-03-19 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36353?usp=email )

Change subject: WIP
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36353?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I262de7280763791348848fbc52d0ea3ac096d23a
Gerrit-Change-Number: 36353
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: abandon


[S] Change in osmo-ttcn3-hacks[master]: WIP

2024-03-19 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36353?usp=email )


Change subject: WIP
..

WIP

Change-Id: I262de7280763791348848fbc52d0ea3ac096d23a
---
M pgw/PGW_Tests.ttcn
1 file changed, 11 insertions(+), 0 deletions(-)



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

diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn
index ae65c4f..937f2ae 100644
--- a/pgw/PGW_Tests.ttcn
+++ b/pgw/PGW_Tests.ttcn
@@ -604,6 +604,7 @@
avp := f_DIAMETER_get_avp(rx_gy, c_AVP_Code_DCC_NONE_CC_Request_Number);
req_num := valueof(avp.avp_data.avp_DCC_NONE_CC_Request_Number);

+   log("PESPIN: Tx tx_dia res_code: ", g_pars.gy.cca_res_code);
if (g_pars.gy.cca_res_code != cca_res_code_success) {
tx_dia := ts_DIA_Gy_CCA(rx_gy.hop_by_hop_id, 
rx_gy.end_to_end_id, sess_id,
g_pars.gy.cca_res_code, req_type, 
req_num);
@@ -614,6 +615,7 @@
tx_dia := ts_DIA_Gy_CCA(rx_gy.hop_by_hop_id, 
rx_gy.end_to_end_id, sess_id,
g_pars.gy.cca_res_code, req_type, 
req_num);
}
+   log("PESPIN: Tx tx_dia: ", tx_dia);
return tx_dia;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36353?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I262de7280763791348848fbc52d0ea3ac096d23a
Gerrit-Change-Number: 36353
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[M] Change in osmo-ttcn3-hacks[master]: WIP

2024-03-03 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36099?usp=email )

Change subject: WIP
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36099?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6dfed05adb332c29404997ea7dc93ec3dabfc43a
Gerrit-Change-Number: 36099
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


[M] Change in osmo-ttcn3-hacks[master]: WIP

2024-02-28 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36099?usp=email )


Change subject: WIP
..

WIP

Change-Id: I6dfed05adb332c29404997ea7dc93ec3dabfc43a
---
M start-testsuite.sh
M stp/STP_Tests.ttcn
M stp/STP_Tests_M3UA.ttcn
M ttcn3-tcpdump-start.sh
M ttcn3-tcpdump-stop.sh
5 files changed, 141 insertions(+), 33 deletions(-)



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

diff --git a/start-testsuite.sh b/start-testsuite.sh
index 4b88501..6ffacd2 100755
--- a/start-testsuite.sh
+++ b/start-testsuite.sh
@@ -50,8 +50,8 @@
 ulimit -n 10

 # below is for the debian packages
-TTCN3_BIN_DIR="${TTCN3_BIN_DIR:-/usr/bin}"
-TITAN_LIBRARY_PATH="${TITAN_LIBRARY_PATH:-/usr/lib/titan:/usr/ttcn3/lib}"
+TTCN3_BIN_DIR="${TTCN3_DIR}/bin"
+TITAN_LIBRARY_PATH="${TTCN3_DIR}/lib"
 LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SUITE_DIR:$TITAN_LIBRARY_PATH" 
"$TTCN3_BIN_DIR/ttcn3_start" $SUITE $CFG $TEST

 expected="$SUITE_DIR/expected-results.xml"
diff --git a/stp/STP_Tests.ttcn b/stp/STP_Tests.ttcn
index e2e5336..8c6a065 100644
--- a/stp/STP_Tests.ttcn
+++ b/stp/STP_Tests.ttcn
@@ -60,6 +60,34 @@
}
 }

+/* Test routing of SCCP between an M3UA-o-SCTP and an M3UA-o-TCP */
+testcase TC_m3ua_tcp() runs on IPA_M3UA_CT {
+   var OCT4 rctx_sender := int2oct(1023, 4);
+   var OCT4 pc_sender := int2oct(23, 4);
+   var OCT4 pc_receiver := int2oct(5, 4);
+
+   f_init_m3ua();
+   f_init_ipa();
+
+   f_connect_ipa(3);
+   f_M3UA_asp_up_act(0, omit, omit); // TODO: rctx
+
+   /* send a well-formed, encoded SCCP message via M3UA */
+   var octetstring data := f_rnd_octstring_rnd_len(100);
+   var SCCP_PAR_Address called := valueof(ts_SccpAddr_GT('1234'H));
+   var SCCP_PAR_Address calling := valueof(ts_SccpAddr_GT('5678'H));
+   var PDU_SCCP sccp := valueof(ts_SCCP_UDT(called, calling, data));
+   var octetstring sccp_enc := enc_PDU_SCCP(sccp);
+   var template (value) M3UA_Protocol_Data tx_pd;
+   tx_pd := ts_M3UA_protocol_data(pc_sender, pc_receiver, c_M3UA_SI_SCCP, 
'00'O, '00'O, '00'O, sccp_enc);
+   f_M3UA_send(0, ts_M3UA_DATA(rctx_sender, tx_pd), 1);
+
+   /* expect to receive it via IPA */
+   // f_IPA_exp(3, sccp_enc);
+
+   f_clear_m3ua();
+}
+
 /* Test routing of SCCP between an M3UA and an IPA ASP */
 testcase TC_m3ua_to_ipa() runs on IPA_M3UA_CT {
var OCT4 rctx_sender := int2oct(1023, 4);
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 5af894a..8592d4a 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -45,41 +45,47 @@
M3uaConfigs mp_m3ua_configs := {
/* as-sender: One ASP within AS */
{
-   remote_sctp_port := 2905,
-   local_sctp_port := ,
+   use_tcp := false,
+   remote_port := 2905,
+   local_port := ,
point_code := 23,
routing_ctx := 1023
},
/* as-receiver: Two ASP within AS */
{
-   remote_sctp_port := 2905,
-   local_sctp_port := 1,
+   use_tcp := false,
+   remote_port := 2905,
+   local_port := 1,
point_code := 42,
routing_ctx := 1042
}, {
-   remote_sctp_port := 2905,
-   local_sctp_port := 10001,
+   use_tcp := false,
+   remote_port := 2905,
+   local_port := 10001,
point_code := 42,
routing_ctx := 1042
},
/* as-client: One ASP within AS */
{
-   remote_sctp_port := 2906,
-   local_sctp_port := 10002,
+   use_tcp := false,
+   remote_port := 2906,
+   local_port := 10002,
point_code := 55,
routing_ctx := 1055
},
/* as-client60-norctx */
{
-   remote_sctp_port := 2907,
-   local_sctp_port := 11060,
+   use_tcp := false,
+   remote_port := 2907,
+   local_port := 11060,
point_code := 60,
routing_ctx := -
},
/* as-client61-norctx */
{
-   remote_sctp_port := 2907,
-   local_sctp_port := 11061,
+   use_tcp := false,
+   remote_port := 2907,
+   local_port := 11061,
  

[S] Change in osmo-ttcn3-hacks[master]: WIP

2024-02-23 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36075?usp=email )


Change subject: WIP
..

WIP

Change-Id: I38e469edf0e00feca5a648035b64645e2c905937
---
M pgw/PGW_Tests.ttcn
1 file changed, 38 insertions(+), 0 deletions(-)



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

diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn
index bd32760..489abdd 100644
--- a/pgw/PGW_Tests.ttcn
+++ b/pgw/PGW_Tests.ttcn
@@ -686,6 +686,18 @@

 }

+/* create a session on the PGW on a S2b interface (from ePDG)*/
+private function f_s2b_create_session() runs on PGW_Session_CT {
+   var template (value) FullyQualifiedTEID fteid_c_ie, fteid_u_ie;
+
+   fteid_c_ie := ts_GTP2C_FTEID(FTEID_IF_S2b_ePDG_GTPC, g_pars.teic_local, 
0,
+   f_inet_addr(mp_local_hostname_c), omit);
+   fteid_u_ie := ts_GTP2C_FTEID(FTEID_IF_S2bU_ePDG_GTPU, 
g_pars.bearer.teid_local, 5,
+   f_inet_addr(mp_local_hostname_u), omit);
+   f_create_session(fteid_c_ie, fteid_u_ie);
+
+}
+
 /* delete the session from the PGW */
 private function f_delete_session(template (omit) GTP2C_Cause tx_cause := omit,
  template (present) OCT4 exp_teid,
@@ -934,6 +946,22 @@
vc_conn.done;
 }

+/* create a session, expect it to succeed */
+private function f_TC_s2b_createSession() runs on PGW_Session_CT {
+   f_s2b_create_session();
+   setverdict(pass);
+}
+testcase TC_s2b_createSession() runs on PGW_Test_CT {
+   var PGW_Session_CT vc_conn;
+   var SessionPars pars := valueof(t_SessionPars('001010123456789'H,
+ "tun22",
+ msisdn := omit,
+ rat_type := 3));
+   f_init();
+   vc_conn := f_start_handler(refers(f_TC_s2b_createSession), pars);
+   vc_conn.done;
+}
+
 control {
execute( TC_tx_echo() );
execute( TC_createSession() );
@@ -942,6 +970,7 @@
execute( TC_createSession_deleteSession() );
execute( TC_deleteSession_unknown() );
execute( TC_gy_charging_cc_time() );
+   execute( TC_s2b_createSession() );
 }



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36075?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I38e469edf0e00feca5a648035b64645e2c905937
Gerrit-Change-Number: 36075
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[M] Change in osmo-ttcn3-hacks[master]: WIP: mme: 2g->4g

2024-01-09 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35513?usp=email )


Change subject: WIP: mme: 2g->4g
..

WIP: mme: 2g->4g

Change-Id: I6f8f077b99e83e6467d2b0c05148b81dbcf2ede4
---
M mme/MME_Tests.ttcn
1 file changed, 178 insertions(+), 32 deletions(-)



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

diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index f4f41e2..1b4b548 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -856,6 +856,37 @@
}
 }

+
+/* 3GPP TS 23.401 D.3.5, TS 23.003 2.8.2.1 */
+private function guti2rai_ptmsi(in NAS_EPS_Types.GUTI guti, out 
RoutingAreaIdentity rai, out OCT4 ptmsi, out OCT3 ptmsi_sig) runs on ConnHdlr {
+   var bitstring mtmsi_bits := oct2bit(guti.mTMSI);
+   var bitstring ptmsi_bits;
+   var bitstring ptmsi_sig_bits;
+
+   rai := valueof(ts_RoutingAreaIdentity(guti.mccDigit1 & guti.mccDigit2 & 
guti.mccDigit3,
+ guti.mncDigit3 & guti.mncDigit1 & 
guti.mncDigit2,
+ guti.mMEGI, guti.mMEC));
+   /* 3GPP TS 23.003 2.8.2.0: "P-TMSI shall be of 32 bits length where the 
two topmost bits are
+* reserved and always set to '11'. Hence, for a UE which may handover 
to GERAN/UTRAN (based on
+* subscription and UE capabilities), the corresponding bits in the 
M-TMSI are set to '11'"
+*/
+   ptmsi_bits := '11'B & substr(mtmsi_bits, 2, 6) & oct2bit(guti.mMEC) & 
substr(mtmsi_bits, 16, 16);
+   ptmsi_sig_bits := substr(mtmsi_bits, 8, 8) & oct2bit(''O);
+   ptmsi := bit2oct(ptmsi_bits);
+   ptmsi_sig := bit2oct(ptmsi_sig_bits);
+   /* TODO: The UE shall fill the remaining 2 octets of the  according to clauses 9.1.1, 9.4.1, 10.2.1, or
+* 10.5.1 of 3GPP TS.33.401 [89] , as appropriate, for RAU/Attach 
procedures.*/
+   /* TODO: 3GPP TS 33.401 9.1.1 The 16 least significant bits available in
+* the P-TMSI signature field shall be filled with the truncated 
NAS-token
+* according to 3GPP TS 23.003 [3].The truncated NAS-token is defined 
as the 16
+* least significant bits of the NAS-token.
+* The NAS-token is derived as specified in Annex A.9. The UE shall use 
the uplink NAS COUNT value that it would use
+* in the next NAS message to calculate the NAS-token and increase the 
stored uplink NAS COUNT value by 1.*/
+   /* TODO: mMEC "also copied into the 8 Most Significant Bits of the NRI 
field within the P-TMSI" */
+}
+/* Test UE attached to EUTRAN reselecting a GERAN cell. In this scenario, the
+ * new SGSN will attempt to obtain information of the UE from the old SGSN 
(MME)
+ * through Gn interface using SGSN Context Request/Response procedure 
(OS#6294). */
 private function f_gtp_sgsn_context_4g_to_2g(OCT4 new_sgsn_local_teid := 
'12345678'O) runs on ConnHdlr {
var template (value) GTPC_PDUs SGSNContextReqPDU;
var RoutingAreaIdentity rai;
@@ -880,10 +911,10 @@
setverdict(pass);
}
[] GTP.receive {
-   setverdict(fail, "unexpected GTPC message from MME");
+Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("unexpected GTPC message from MME"));
}
[] T.timeout {
-   setverdict(fail, "no SGSN Context Response from MME");
+Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("no 
SGSN Context Response from MME"));
}
}

@@ -893,6 +924,43 @@

 }

+private altstep as_gtp_sgsn_context_2g_to_4g(OCT4 new_sgsn_teid := 
'ABABABAB'O, GTP_Templates.GTP_RATType rat_type := GTP_RAT_TYPE_EUTRAN) runs on 
ConnHdlr {
+   var Gtp1cUnitdata gtpc_pdu;
+
+   [] GTP.receive(tr_GTPC_SGSNContextReq(g_gn_iface_peer, 
tr_SGSNContextReqPDU(rat_type := int2oct(enum2int(rat_type), 1 -> value 
gtpc_pdu {
+   var template (value) PDP_Context_GTPC pdp_ctx;
+   var template (value) GTPC_PDUs SGSNContextRespPDU;
+   var Gtp1cUnitdata gtpc_pdu_ack;
+   var OCT4 old_mme_remote_teid := 
gtpc_pdu.gtpc.gtpc_pdu.sgsn_ContextRequest.teidControlPlane.teidControlPlane;
+
+   const OCT16 ck := '740d62df9803eebde5120acf358433d0'O;
+   const OCT16 ik := '11329aae8e8d2941bb226b2061137c58'O;
+
+   pdp_ctx := 
ts_PDP_Context_GTPC(f_inet_addr(g_pars.ue_pars.ue_ip),
+  f_inet_addr(mp_gn_local_ip),
+  c_NAS_defaultAPN,
+  ggsn_teic := '12345678'O,
+  ggsn_teid := '87654321'O);
+   SGSNContextRespPDU := 
ts_SGSNContextRespPDU(GTP_CAUSE_REQUEST_ACCEPTED,
+  

[M] Change in osmo-ttcn3-hacks[master]: WIP

2023-10-17 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34782?usp=email )

Change subject: WIP
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34782?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3b9b45eb4eed88ea5c1ba2b870c03b04f7f4c3b2
Gerrit-Change-Number: 34782
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: abandon


[M] Change in osmo-ttcn3-hacks[master]: WIP

2023-10-17 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34782?usp=email )


Change subject: WIP
..

WIP

Change-Id: I3b9b45eb4eed88ea5c1ba2b870c03b04f7f4c3b2
---
M epdg/EPDG_Tests.ttcn
M library/DIAMETER_Templates.ttcn
2 files changed, 128 insertions(+), 1 deletion(-)



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

diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn
index 69a3d9b..2006632 100644
--- a/epdg/EPDG_Tests.ttcn
+++ b/epdg/EPDG_Tests.ttcn
@@ -316,6 +316,26 @@
}
 }

+/* Diameter SWx SAR + SAA. */
+private altstep as_DIA_SWx_SA_success() runs on EPDG_ConnHdlr {
+   var PDU_DIAMETER rx_dia;
+   var template (omit) AVP avp;
+   var octetstring sess_id;
+   [] SWx.receive(tr_DIA_SWx_SAR(g_pars.imsi)) -> value rx_dia {
+   avp := f_DIAMETER_get_avp(rx_dia, 
c_AVP_Code_BASE_NONE_Session_Id);
+   sess_id := valueof(avp.avp_data.avp_BASE_NONE_Session_Id);
+   /* Send SAA to translator; expect it to show up on GSUP side */
+   SWx.send(ts_DIA_SWx_SAA(g_pars.imsi,
+   sess_id := sess_id,
+   hbh_id := rx_dia.hop_by_hop_id,
+   ete_id := rx_dia.end_to_end_id));
+   setverdict(pass);
+   }
+   [] SWx.receive(PDU_DIAMETER:?) -> value rx_dia {
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("Unexpected Diameter msg rx: ", rx_dia));
+   }
+}
+
 /* GSUP AuthInfo Req + Resp, triggers SWx MAR + MAA. */
 private function f_GSUP_AI_success() runs on EPDG_ConnHdlr {
var GSUP_PDU rx_gsup;
@@ -337,8 +357,25 @@
setverdict(pass);
 }

+/* GSUP LU Req + Resp, triggers SWx SAR + SAA (Server Assignment). */
+private function f_GSUP_LU_success() runs on EPDG_ConnHdlr {
+   var GSUP_PDU rx_gsup;
+   var template octetstring destination_name := *;
+   GSUP.send(ts_GSUP_UL_REQ(g_pars.imsi));
+   as_DIA_SWx_SA_success();
+   /* Expect a positive response back to the translator; expect AIA */
+   alt {
+   [] GSUP.receive(tr_GSUP_UL_RES(g_pars.imsi, destination_name));
+   [] GSUP.receive(GSUP_PDU:?) -> value rx_gsup {
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("Unexpected GSUP msg rx: ", rx_gsup));
+   }
+   }
+   setverdict(pass);
+}
+
 private function f_TC_authinfo_normal(charstring id) runs on EPDG_ConnHdlr {
f_GSUP_AI_success();
+   f_GSUP_LU_success();
 }

 testcase TC_authinfo_normal() runs on MTC_CT {
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index cb010d7..100159c 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -1031,7 +1031,7 @@
}
 }

-/* TS 29.272 7.3.36 Service-Selection (refers to RFC 5778) */
+/* Service-Selection, TS 29.272 7.3.36, TS 29.273 5.2.3.5, (RFC 5778) */
 template (present) GenericAVP tr_AVP_ServiceSelection(template (present) 
charstring apn := ?) := {
avp := {
avp_header := 
tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection),
@@ -2258,6 +2258,24 @@
}
 }

+/* Server-Assignment-Type, 3GPP TS 29.273 8.2.3.12, 3GPP TS 29.229 6.3.15 */
+template (present) GenericAVP tr_AVP_3GPP_ServerAssignmentType(template 
(present) CxDx_3GPP_Server_Assignment_Type t := ?) := {
+   avp := {
+   avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Assignment_Type),
+   avp_data := {
+   avp_CxDx_3GPP_Server_Assignment_Type := t
+   }
+   }
+}
+template (value) GenericAVP ts_AVP_3GPP_ServerAssignmentType(template (value) 
CxDx_3GPP_Server_Assignment_Type t) := {
+   avp := {
+   avp_header := 
ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Assignment_Type),
+   avp_data := {
+   avp_CxDx_3GPP_Server_Assignment_Type := t
+   }
+   }
+}
+
 /*
  * SWx 3GPP TS 29.273
  */
@@ -2364,4 +2382,67 @@
ts_AVP_3GPP_SIPNumAuthDataItems(1)
});

+/* Server-Assignment-Request,
+ * 3GPP TS 29.273 8.1.2.2.2 UE/PDN Registration/DeRegistration Notification
+ * 3GPP TS 29.273 8.2.2.3 Non-3GPP IP Access Registration Procedure */
+template (present) PDU_DIAMETER
+tr_DIA_SWx_SAR(template (present) hexstring imsi := ?,
+  template (present) octetstring sess_id := ?,
+  template (present) charstring orig_host :=  ?,
+  template (present) charstring orig_realm := ?,
+  template (present) charstring dest_realm := ?,
+  template (present) UINT32 hbh_id := ?,
+  template (present) UINT32 ete_id := ?,
+  template (present) CxDx_3GPP_Server_Assignment_Type 

[S] Change in osmo-ttcn3-hacks[master]: WIP

2023-09-26 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34535?usp=email )

Change subject: WIP
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34535?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Idd821049315ae4d0cf83f551d5fc1f2961545291
Gerrit-Change-Number: 34535
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: abandon


[S] Change in osmo-ttcn3-hacks[master]: WIP

2023-09-26 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34535?usp=email )


Change subject: WIP
..

WIP

Change-Id: Idd821049315ae4d0cf83f551d5fc1f2961545291
---
M pcu/PCU_Tests.ttcn
1 file changed, 10 insertions(+), 1 deletion(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 012a0be..6917404 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1953,7 +1953,7 @@
var GprsMS ms;
const integer N3105_MAX := 2;
var integer N3105 := 0;
-   timer T_3195 := 1.0;
+   timer T_3195 := 1.0 + 0.1; /* 0.1: some extra time to avoid race 
conditions between test and IUT */
var integer num_poll_recv := 0;
var template RlcmacDlBlock dl_block_exp;


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34535?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Idd821049315ae4d0cf83f551d5fc1f2961545291
Gerrit-Change-Number: 34535
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively

2023-08-04 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069 )


Change subject: WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively
..

WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively

Change-Id: I5e72cbf4bcc2fc4fa305861bd7cf08e00ef7df1d
---
M pcu/GPRS_Components.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 30 insertions(+), 8 deletions(-)



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

diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index c894cc9..2765a04 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -1069,7 +1069,7 @@
}
 }
 
-altstep as_ms_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH,
+altstep as_ms_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH_DT,
 template GsmRrMessage t_imm_ass := ?,
 template (present) TsTrxBtsNum nr := ts_TsTrxBtsNum,
 out GsmRrMessage rr_imm_ass)
@@ -1081,14 +1081,12 @@
rr_imm_ass := data_msg.rr_msg;
log("Rx Immediate Assignment: ", rr_imm_ass);
/* Send DATA.cnf back to the IUT (only needed for PCH) */
-   if (data_msg.raw.sapi == PCU_IF_SAPI_PCH_DT) {
-   f_pcuif_tx_data_cnf(data_msg);
-   }
+   f_pcuif_tx_data_cnf(data_msg);
setverdict(pass);
}
 }

-function f_pcuif_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH,
+function f_pcuif_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH_DT,
template GsmRrMessage t_imm_ass := ?,
template (present) TsTrxBtsNum nr := tr_TsTrxBtsNum)
 runs on MS_BTS_IFACE_CT return GsmRrMessage {
@@ -1139,7 +1137,7 @@
if (is_11bit != 0) { ra := 127; }

/* Expect Immediate (TBF) Assignment on the same TS/TRX/BTS */
-   return f_pcuif_rx_imm_ass(PCU_IF_SAPI_AGCH, tr_IMM_TBF_ASS(false, ra, 
fn), nr);
+   return f_pcuif_rx_imm_ass(PCU_IF_SAPI_AGCH_DT, tr_IMM_TBF_ASS(false, 
ra, fn), nr);
 }

 /* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
@@ -1182,7 +1180,7 @@

var BTS_CCCH_Block data_msg;
BTS.receive(tr_PCUIF_DATA_RR(nr.bts_nr,
-tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := 
PCU_IF_SAPI_PCH),
+tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := 
PCU_IF_SAPI_PCH_DT),
 tr_PAG_REQ1(tr_MI_LV(mi1 -> value 
data_msg;
rr_pag_req1 := data_msg.rr_msg;
log("Rx Paging Request Type1: ", rr_pag_req1);
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index d844736..a9d7fd3 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -4858,7 +4858,22 @@

/* SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, f_rnd_octstring(12)));
-   f_ms_exp_dl_tbf_ass_ccch(ms);
+
+   /* The PCU will send an IMMEDIATE ASSIGNMENT message on the AGCH. It
+* should be noted that IMMEDIATE ASSIGNMENT messages for DL TBFs are
+* commonly sent on the PCH. However in this case the IMSI is not
+* known to the PCU and hence no paging group can be calculated. The
+* PCU is then forced to use the AGCH.
+*
+* As a background information to this it should be noted that this
+* works because the IMSI is commonly unknown during a GMM ATTACH
+* REQUEST. In this phase the MS is in non-DRX mode, which means that
+* it listens on all CCCH blocks (PCH and AGCH)
+*
+* See also: 3gpp TS 44.060, section 5.5.1.5 and
+ *   3gpp TS 45.002, section 6.5.3, 6.5.6
+ */
+   f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_AGCH_DT);

f_TC_pcuif_fh_check_imm_ass(valueof(info_ind), ms.dl_tbf.rr_imm_ass);
f_shutdown(__BFILE__, __LINE__, final := true);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5e72cbf4bcc2fc4fa305861bd7cf08e00ef7df1d
Gerrit-Change-Number: 34069
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
Attention is currently required from: fixeria.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(2 comments)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/928b894e_406bfddb
PS2, Line 1067: setverdict(pass)
> There is already `setverdict(pass)` below, this one is redundant.
yes I thought so too, but just wanted to make sure it doesn't fail because of 
that


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/b2e7fc91_33d8c529
PS2, Line 1078: vc_conn.done
> have to say though... […]
Alright my idea didn't fix anything it seems. I'm having a hard time debugging 
this, also because I can't find the log output coded in the `.ttcn3` file via 
`log()`.

There seems to be all kinds of log data (e.g., output from the SGSN, packet 
dumps, logs in the folder `sgsn-tester` etc.) but I can't find a file with the 
log outputs coded in `SGSN_Tests.ttcn` (fairly certain I couldn't do so 
previously either - I think with another test) and I'm pretty certain the ttcn 
code has arrived at one of the log commands (since I don't have a debugger like 
gdb to wrap around the tester all I can do is try to guess until where the code 
is run...).

I might try looking at the pcap again, but so far the output is fairly 
confusing for me since I don't know the procedure.

Hmmm I just noticed the `log()` output is in the pcap through `GSMTAP 
libosmocore logging` (?)



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Mon, 26 Jun 2023 22:33:56 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
Attention is currently required from: fixeria.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(1 comment)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/886a61ec_b2cd1285
PS2, Line 1078: vc_conn.done
> Ah I think I know what's wrong. […]
have to say though... if it is what I think, then I don't understand why the 
test gets a 'skipped' in Jenkins (because it's a failure and not the absence of 
a verdict)



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Mon, 26 Jun 2023 20:45:52 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
Attention is currently required from: fixeria.

arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(1 comment)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/7bcc77ec_90a04ef4
PS2, Line 1078: vc_conn.done
> AFAICS, osmo-sgsn is sending `GMM IDENTITY REQUEST: mi_type=IMEI`, but the 
> testsuite does not respon […]
Ah I think I know what's wrong. I'll try something as soon as I'm home



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Mon, 26 Jun 2023 20:43:59 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread fixeria
Attention is currently required from: arehbein.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(1 comment)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/3f2f2c1b_2ef0d748
PS2, Line 1078: vc_conn.done
> I gave this patch a try, and it fails due to `Tguard timeout` on my machine :/
AFAICS, osmo-sgsn is sending `GMM IDENTITY REQUEST: mi_type=IMEI`, but the 
testsuite does not respond.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: arehbein 
Gerrit-Comment-Date: Mon, 26 Jun 2023 16:44:56 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread fixeria
Attention is currently required from: arehbein.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(1 comment)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/a2f682ed_55af26e5
PS2, Line 1078: vc_conn.done
> Oh, this indeed looks like a bug.
I gave this patch a try, and it fails due to `Tguard timeout` on my machine :/



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: arehbein 
Gerrit-Comment-Date: Mon, 26 Jun 2023 16:42:16 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread fixeria
Attention is currently required from: arehbein.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 2:

(2 comments)

File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/10964bef_8b9c03f7
PS2, Line 1067: setverdict(pass)
There is already `setverdict(pass)` below, this one is redundant.


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465/comment/997b7833_19348716
PS2, Line 1078: vc_conn.done
Oh, this indeed looks like a bug.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: arehbein 
Gerrit-Comment-Date: Mon, 26 Jun 2023 16:01:29 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465

to look at the new patch set (#2).

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..

WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

Currently not working (?) see my comment below on Gerrit

Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 15 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/65/33465/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )

Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..


Patch Set 1:

(1 comment)

This change is ready for review.

Patchset:

PS1:
Somehow haven't yet managed to run my local code on docker-playground due
to changes in docker-playground a few months ago
(I think; it's kind of hard to tell because there are now multiple places
in the repo specifying a URL for osmo-ttcn3-hacks.. I was pretty sure I had
made the right changes everywhere to point docker-playground to my local copy),
or,
this fix doesn't work and I'm currently clueless (because I've seen other tests 
do
the same; the problem is that the timer timeout event seems to be causing
the test to fail, although I need the timeout as a passing condition).As stated 
in the commit message I think this should work, but I haven't yet gotten to 
test it locally.

Would be glad for some pointers... or maybe it's the call to/arguments for 
`f_start_handler()` ?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 26 Jun 2023 15:51:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

2023-06-26 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465 )


Change subject: WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing
..

WIP: sgsn: Fix TC_attach_timeout_after_pdp_act failing

Somehow haven't yet managed to run my local code on docker-playground due
to changes in docker-playground a few months ago
(I think; it's kind of hard to tell because there are now multiple places
in the repo specifying a URL for osmo-ttcn3-hacks.. I was pretty sure I had
made the right changes everywhere to point docker-playground to my local copy),
or,
this fix doesn't work and I'm currently clueless (because I've seen other tests 
do
the same; the problem is that the timer timeout event seems to be causing
the test to fail, although I need the timeout as a passing condition).

Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 23 insertions(+), 1 deletion(-)



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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 7cdf72c..193da7d 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -1063,7 +1063,9 @@
[] BSSGP[ran_index].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) 
{
setverdict(fail, "Received ", gmm_attach_repeats + 1, 
"th ATTACH ACCEPT")
}
-   [] t_receive_GMM_ATTACH_ACCEPT.timeout { }
+   [] t_receive_GMM_ATTACH_ACCEPT.timeout {
+   setverdict(pass)
+   }
}

setverdict(pass);
@@ -1073,6 +1075,7 @@
var BSSGP_ConnHdlr vc_conn;
f_init();
vc_conn := f_start_handler(refers(f_TC_attach_timeout_after_pdp_act), 
testcasename(), g_gb, 21);
+   vc_conn.done;
f_cleanup();
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33465
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Gerrit-Change-Number: 33465
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


[M] Change in osmo-ttcn3-hacks[master]: WIP: ASCI related BTS tests

2023-06-09 Thread jolly
jolly has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142 )

Change subject: WIP: ASCI related BTS tests
..


Abandoned

This was accidentally in my branch.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3a93fa486a48957367d2c727cc0a8eea33d3bf11
Gerrit-Change-Number: 33142
Gerrit-PatchSet: 2
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-MessageType: abandon


[M] Change in osmo-ttcn3-hacks[master]: WIP: bsc: ASCI Assignment test (VBS/VGCS)

2023-06-06 Thread laforge
laforge has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32555 )

Change subject: WIP: bsc: ASCI Assignment test (VBS/VGCS)
..


Abandoned

integrated into https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33150
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32555
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9b824a08d3948dc01e4748d4a4d61b889d31e5ff
Gerrit-Change-Number: 32555
Gerrit-PatchSet: 6
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: jolly 
Gerrit-MessageType: abandon


[M] Change in osmo-ttcn3-hacks[master]: WIP: ASCI related BTS tests

2023-06-02 Thread Jenkins Builder
Attention is currently required from: jolly.

Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142 )

Change subject: WIP: ASCI related BTS tests
..


Patch Set 2:

(1 comment)

File bts/BTS_Tests_ASCI.ttcn:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7763):
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142/comment/b1d5d1ce_ecf042c2
PS2, Line 5:  * (C) 2021 by sysmocom - s.m.f.c. GmbH 
's.m.f.c.' may be misspelled - perhaps 's.f.m.c.'?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3a93fa486a48957367d2c727cc0a8eea33d3bf11
Gerrit-Change-Number: 33142
Gerrit-PatchSet: 2
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Fri, 02 Jun 2023 09:55:25 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: WIP: ASCI related BTS tests

2023-06-01 Thread Jenkins Builder
Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142 )

Change subject: WIP: ASCI related BTS tests
..


Patch Set 1:

(1 comment)

File bts/BTS_Tests_ASCI.ttcn:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7737):
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142/comment/fe8e7e41_819106b5
PS1, Line 5:  * (C) 2021 by sysmocom - s.m.f.c. GmbH 
's.m.f.c.' may be misspelled - perhaps 's.f.m.c.'?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3a93fa486a48957367d2c727cc0a8eea33d3bf11
Gerrit-Change-Number: 33142
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-CC: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Thu, 01 Jun 2023 14:21:03 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: WIP: ASCI related BTS tests

2023-06-01 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142 )


Change subject: WIP: ASCI related BTS tests
..

WIP: ASCI related BTS tests

Change-Id: I3a93fa486a48957367d2c727cc0a8eea33d3bf11
---
M bts/BTS_Tests.ttcn
A bts/BTS_Tests_ASCI.ttcn
2 files changed, 93 insertions(+), 0 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 34afaca..1f0ba32 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -74,6 +74,7 @@
 import from TELNETasp_PortType all;
 import from BTS_Tests_LAPDm all;

+friend module BTS_Tests_ASCI;
 friend module BTS_Tests_SMSCB;
 friend module BTS_Tests_VAMOS;
 friend module BTS_Tests_virtphy;
diff --git a/bts/BTS_Tests_ASCI.ttcn b/bts/BTS_Tests_ASCI.ttcn
new file mode 100644
index 000..4bf0f8d
--- /dev/null
+++ b/bts/BTS_Tests_ASCI.ttcn
@@ -0,0 +1,83 @@
+module BTS_Tests_ASCI {
+
+/* Integration Tests for OsmoBTS
+ *
+ * (C) 2021 by sysmocom - s.m.f.c. GmbH 
+ * Author: Vadim Yanitskiy 
+ *
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This module contains VAMOS specific test cases.
+ */
+
+import from Misc_Helpers all;
+import from General_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from L1CTL_PortType all;
+import from L1CTL_Types all;
+import from LAPDm_Types all;
+import from IPA_Emulation all;
+import from GSM_RR_Types all;
+import from L3_Templates all;
+
+import from MobileL3_CommonIE_Types all;
+
+import from RSL_Emulation all;
+import from RSL_Types all;
+
+import from BTS_Tests all;
+
+
+
+/* convert from boolean value to BIT1 */
+private function bool2bit1(boolean inp) return BIT1 {
+   if (inp) {
+   return '1'B;
+   } else {
+   return '0'B;
+   }
+}
+
+/* encode a VBS/VGCS call reference into it's OCT5 representation */
+private function f_enc_gcr(integer call_ref, boolean is_group_call, boolean 
ack_required := false)
+return OCT5
+{
+   var DescriptiveGroupOrBroadcastCallReference_V v := {
+   binaryCodingOfGroupOrBroadcastCallReference := 
int2bit(call_ref, 27),
+   sF := bool2bit1(is_group_call),
+   aF := bool2bit1(ack_required),
+   callPriority := '000'B,
+   cipheringInformation := ''B,
+   spare := ''B
+   }
+   return bit2oct(encvalue(v));
+}
+
+testcase TC_vbs_notification() runs on test_CT {
+
+   f_init_l1ctl();
+   f_l1_tune(L1CTL);
+
+   var OCT5 gcr := f_enc_gcr(2342, false, false);
+   var OCT3 chan_desc := '234266'O;
+
+   RSL_CCHAN.send(ts_ASP_RSL_UD(ts_RSL_NOTIF_CMD_START(gcr, chan_desc)));
+
+   /* FIXME: expect receiving something on PCH */
+   f_sleep(5.0);
+
+}
+
+control {
+   execute( TC_vbs_notification() );
+
+}
+
+
+}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33142
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3a93fa486a48957367d2c727cc0a8eea33d3bf11
Gerrit-Change-Number: 33142
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-CC: laforge 
Gerrit-MessageType: newchange


[M] Change in osmo-ttcn3-hacks[master]: WIP: bsc: ASCI Assignment test (VBS/VGCS)

2023-04-30 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32555 )


Change subject: WIP: bsc: ASCI Assignment test (VBS/VGCS)
..

WIP: bsc: ASCI Assignment test (VBS/VGCS)

Change-Id: I9b824a08d3948dc01e4748d4a4d61b889d31e5ff
---
M bsc/BSC_Tests.ttcn
A bsc/BSC_Tests_ASCI.ttcn
2 files changed, 159 insertions(+), 1 deletion(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 878083e..4e72383 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -23,6 +23,7 @@
 friend module BSC_Tests_VAMOS;
 friend module BSC_Tests_CBSP;
 friend module BSC_Tests_LCLS;
+friend module BSC_Tests_ASCI;

 import from Misc_Helpers all;
 import from General_Types all;
@@ -106,7 +107,7 @@
  * BTS 2 has BSIC 12, TSC = (BSIC & 7) = 4.
  * BTS 2 has BSIC 12, TSC = (BSIC & 7) = 4.
  */
-private const BtsParams c_BtsParams[NUM_BTS_CFG] := {
+friend const BtsParams c_BtsParams[NUM_BTS_CFG] := {
/* BTS0 */ { trx_num := 1, tsc := 2 },
/* BTS1 */ { trx_num := 1, tsc := 3 },
/* BTS2 */ { trx_num := 4, tsc := 4 },
diff --git a/bsc/BSC_Tests_ASCI.ttcn b/bsc/BSC_Tests_ASCI.ttcn
new file mode 100644
index 000..27538a7
--- /dev/null
+++ b/bsc/BSC_Tests_ASCI.ttcn
@@ -0,0 +1,148 @@
+module BSC_Tests_ASCI {
+
+/* Integration Tests for OsmoBSC
+ * (C) 2023 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This test suite tests OsmoBSC while emulating both multiple BTS + MS as
+ * well as the MSC. See README for more details.
+ */
+
+import from General_Types all;
+import from Osmocom_Types all;
+import from GSM_Types all;
+import from Misc_Helpers all;
+
+import from BSC_Tests all;
+import from BSSAP_Types all;
+import from BSSAP_CodecPort all;
+import from BSSMAP_Templates all;
+import from RSL_Types all;
+import from RSL_Emulation all;
+import from MGCP_Emulation all;
+
+import from MobileL3_CommonIE_Types all;
+import from MobileL3_Types all;
+import from L3_Templates all;
+import from GSM_RR_Types all;
+
+import from MSC_ConnectionHandler all;
+import from RAN_Adapter all;
+import from RAN_Emulation all;
+
+
+function f_gen_asci_ass_req(integer bssap_idx := 0,
+   template (value) BSSMAP_IE_ChannelType ch_type := 
ts_BSSMAP_IE_ChannelType,
+   template (value) OCT1 ass_requirement := '00'O,
+   template (value) BSSMAP_IE_CellIdentifier cell_id 
:= ts_CellID_LAC_CI(1, 0),
+   template (value) GroupCallRef group_call_ref := 
'2342'O,
+   charstring aoip_tla :="1.2.3.4")
+runs on MSC_ConnHdlr return template (value) PDU_BSSAP {
+   if (mp_bssap_cfg[bssap_idx].transport == BSSAP_TRANSPORT_AoIP) {
+   var template (value) BSSMAP_IE_AoIP_TransportLayerAddress tla :=
+f_ts_BSSMAP_IE_AoIP_TLA(aoip_tla, 2342);
+   return ts_BSSMAP_VGCS_VBS_AssignmentReq(ch_type, 
ass_requirement, cell_id,
+   group_call_ref, 
omit, tla);
+   } else {
+   var template (value) BSSMAP_IE_CircuitIdentityCode cic := 
ts_BSSMAP_IE_CIC(0,1);
+   return ts_BSSMAP_VGCS_VBS_AssignmentReq(ch_type, 
ass_requirement, cell_id,
+   group_call_ref, 
cic, omit);
+   }
+}
+
+
+private function f_tc_asci_assignment(charstring id) runs on MSC_ConnHdlr {
+   var PDU_BSSAP rx_bssap;
+   /* Hack: the proper way would be to wait for the BSSMAP VGCS Assignment 
Result and extract the
+* actual assigned chan_nr from it. But osmo-bsc starts acting on the 
lchan even before we get a
+* chance to evaluate the BSSMAP Handover Request ACK. So we need to 
assume that osmo-bsc will
+* activate TS 1 and already set up this lchan's RSL emulation
+* before we get started. */
+   var RslChannelNr new_chan_nr := valueof(t_RslChanNr0(1, 
RSL_CHAN_NR_Bm_ACCH));
+   f_rslem_register(0, new_chan_nr);
+   g_chan_nr := new_chan_nr;
+   var uint3_t expect_target_tsc := c_BtsParams[0].tsc;
+   f_sleep(1.0);
+
+   f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
+   f_MscConnHdlr_init(g_pars.media_nr, "127.0.0.2", "127.0.0.3", FR_AMR);
+   var default as_media := activate(as_Media());
+
+   /* TODO: Encryption */
+   var template (value) BSSMAP_IE_ChannelType ch_type := 
ts_BSSMAP_IE_ChannelType;
+   var template (value) BSSMAP_IE_CellIdentifier cell_id := 
ts_CellID_LAC_CI(1, 0);
+   var template (value) PDU_BSSAP ass_req := f_gen_asci_ass_req(ch_type := 
ch_type, cell_id := cell_id);
+   if (false) {/* 

[L] Change in osmo-ttcn3-hacks[master]: WIP: BSSMAP_Templates: Add VBS/VGCS related templates

2023-04-21 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/32405 )


Change subject: WIP: BSSMAP_Templates: Add VBS/VGCS related templates
..

WIP: BSSMAP_Templates: Add VBS/VGCS related templates

As we want to test VBS/VGCS related aspects of BSC and/or MSC soon,
we will need related templates to construct and match related messages
and IEs.

Change-Id: I949f731de794b22292b01d0ddf9a75a9e7e7e71d
---
M library/BSSMAP_Templates.ttcn
1 file changed, 491 insertions(+), 3 deletions(-)



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

diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index 02aad9f..7dc5ce7 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -2,7 +2,7 @@

 /* BSSMAP Templates, building on top of BSSAP_Types from Ericsson.
  *
- * (C) 2017-2019 by Harald Welte 
+ * (C) 2017-2023 by Harald Welte 
  * contributions by sysmocom - s.f.m.c. GmbH
  * All rights reserved.
  *
@@ -396,13 +396,13 @@
 }


-template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) 
:= {
+template (value) BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(template 
(value) octetstring l3info) := {
elementIdentifier := '17'O,
lengthIndicator := 0,
layer3info := l3info
 }

-template BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template octetstring 
l3info) := {
+template (present) BSSMAP_IE_Layer3Information tr_BSSMAP_IE_L3Info(template 
(present) octetstring l3info) := {
elementIdentifier := '17'O,
lengthIndicator := ?,
layer3info := l3info
@@ -1962,6 +1962,481 @@
rTC := '00'B /* Response Time is not specified */
 }

+
+/* 3.2.2.55 */
+template (value) BSSMAP_IE_GroupCallReference
+ts_BSSMAP_IE_GroupCallRef(template (value) GroupCallRef group_call_ref) :={
+   elementIdentifier := '37'O,
+   lengthIndicator := 0, // overwritten
+   descrGroupbroadcastCallRef := group_call_ref
+}
+template (present) BSSMAP_IE_GroupCallReference
+tr_BSSMAP_IE_GroupCallRef(template (present) GroupCallRef group_call_ref) :={
+   elementIdentifier := '37'O,
+   lengthIndicator := 0, // overwritten
+   descrGroupbroadcastCallRef := group_call_ref
+}
+
+/* 3.2.2.88 */
+template (value) BSSMAP_IE_VGCS_FeatureFlags
+ts_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 
tcp) := {
+   elementIdentifier := '69'O,
+   lengthIndicator := 0, // overwritten
+   TP_Ind := tp_ind,
+   AS_Ind := as_ind,
+   BSS_Res := bss_res,
+   tCP := tcp,
+   spare := '000'B
+};
+template (present) BSSMAP_IE_VGCS_FeatureFlags
+tr_BSSMAP_IE_VGCS_FeatureFlags(BIT1 tp_ind, BIT2 as_ind, BIT1 bss_res, BIT1 
tcp) := {
+   elementIdentifier := '69'O,
+   lengthIndicator := ?,
+   TP_Ind := tp_ind,
+   AS_Ind := as_ind,
+   BSS_Res := bss_res,
+   tCP := tcp,
+   spare := ?
+};
+
+/* 3.2.2.98 */
+template (value) BSSMAP_IE_ApplicationData
+ts_BSSMAP_IE_ApplicationData(template (value) OCT9 adi) := {
+   elementIdentifier := '78'O,
+   lengthIndicator := 0, // overwritten
+   applicationDataInfo := adi
+};
+template (present) BSSMAP_IE_ApplicationData
+tr_BSSMAP_IE_ApplicationData(template (present) OCT9 adi) := {
+   elementIdentifier := '78'O,
+   lengthIndicator := ?,
+   applicationDataInfo := adi
+};
+
+/* 3.2.2.99 */
+template (value) BSSMAP_IE_DataIdentity
+ts_BSSMAP_IE_DataIdentity(template (value) DataIdentity data_id) := {
+   elementIdentifier := '79'O,
+   lengthIndicator := 0, // overwritten
+   dataIdentityInfo := data_id
+};
+template (present) BSSMAP_IE_DataIdentity
+tr_BSSMAP_IE_DataIdentity(template (present) DataIdentity data_id) := {
+   elementIdentifier := '79'O,
+   lengthIndicator := ?,
+   dataIdentityInfo := data_id
+};
+
+/* 3.2.2.52 */
+template (value) BSSMAP_IE_AssignmentRequirement
+ts_BSSMAP_IE_AssRequirement(template (value) OCT1 ass_rqm) := {
+   elementIdentifier := '33'O,
+   assignmentRequirement := ass_rqm
+}
+template (present) BSSMAP_IE_AssignmentRequirement
+tr_BSSMAP_IE_AssRequirement(template (present) OCT1 ass_rqm) := {
+   elementIdentifier := '33'O,
+   assignmentRequirement := ass_rqm
+}
+
+/* 3.2.2.89 */
+template (value) BSSMAP_IE_TalkerPriority
+ts_BSSMAP_IE_TalkerPriority(template (value) BIT2 prio) := {
+   elementIdentifier := '6A'O,
+   priority := prio,
+   spare := '00'B
+}
+template (value) BSSMAP_IE_TalkerPriority
+tr_BSSMAP_IE_TalkerPriority(template (value) BIT2 prio) := {
+   elementIdentifier := '6A'O,
+   priority := prio,
+   spare := '00'B
+}
+
+/* 3.2.2.90 */
+template (value) BSSMAP_IE_EmergencySetIndication
+ts_BSSMAP_IE_EmergencySetIndication := {
+   elementIdentifier := '6B'O
+}
+template (present) BSSMAP_IE_EmergencySetIndication

Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-12 Thread arehbein
arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..


Patch Set 2:

(1 comment)

Patchset:

PS2:
> No idea on how this ended up merged sorry. Pushing the "done" button 
> shouldn't merge them. […]
I do remember that it wasn't blocked even though I forgot the 'refs/for/heads', 
maybe if a change has been pushed for review previously, it doesn't get blocked 
the next time you push it (and lead to an auto-merge?)?

I mean there's still the option that I clicked the button unconsciously but I'm 
pretty certain I did not.

This is just puzzling me



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 12 Dec 2022 11:19:52 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-12 Thread pespin
Attention is currently required from: arehbein.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..


Patch Set 2:

(1 comment)

Patchset:

PS2:
> I really don't know what happened here. […]
No idea on how this ended up merged sorry. Pushing the "done" button shouldn't 
merge them. I suspect you pushed to master directly from your git repo, but I'd 
expect that to be blocked?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: arehbein 
Gerrit-Comment-Date: Mon, 12 Dec 2022 11:14:01 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-12 Thread arehbein
arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..


Patch Set 2:

(1 comment)

Patchset:

PS2:
> I'm not following here. […]
I really don't know what happened here. I don't recall clicking the 'submit' 
buttons three times in a row on three different pages (not even on one page), 
the last thing I remember w.r.t. this is pushing a second patchset to fix the 
module param. variable names. And marking your comment on that as 'done' in my 
reply. Does that lead to Gerrit automerge or anything like that? Or maybe it 
happened because I pushed the second patchset not to 'refs/for/heads' but 
normally (?). I opened a revert of all three commits, I suppose that  needs 
votes from others to go through.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 12 Dec 2022 11:12:00 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size NSEI IE

2022-12-12 Thread arehbein
arehbein has created a revert of this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430 )

Change subject: WIP: ns: Add test for SNS Size NSEI IE
..
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
Gerrit-Change-Number: 30430
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: revert


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-12 Thread arehbein
arehbein has created a revert of this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: revert


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of NSVCs IE

2022-12-12 Thread arehbein
arehbein has created a revert of this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432 )

Change subject: WIP: ns: Add test for SNS Size Num. of NSVCs IE
..
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
Gerrit-Change-Number: 30432
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: revert


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-12 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..


Patch Set 2:

(1 comment)

Patchset:

PS2:
I'm not following here. Why does this shows up as "merged" if it has no +2, and 
it still says "WIP" in the commit description?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 12 Dec 2022 10:34:07 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size NSEI IE

2022-12-10 Thread arehbein
arehbein has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430 )

Change subject: WIP: ns: Add test for SNS Size NSEI IE
..


Patch Set 2:

(1 comment)

File ns/NS_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430/comment/51d9abf0_029702af
PS1, Line 70:   NsIEI ns_iei_num_ipv4_ep := NS_IEI_NUM_IPv4_EP;
> all module parameter must start with "mp_" so that they can easily be 
> identfiied.
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
Gerrit-Change-Number: 30430
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Sat, 10 Dec 2022 14:32:03 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of NSVCs IE

2022-12-10 Thread arehbein
arehbein has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432 )

Change subject: WIP: ns: Add test for SNS Size Num. of NSVCs IE
..

WIP: ns: Add test for SNS Size Num. of NSVCs IE

Related: OS#5208
Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
---
M ns/NS_Tests.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)



diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index f57302f..2b703fc 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -640,6 +640,31 @@
f_clean_ns_codec();
 }

+testcase TC_sns_sgsn_sns_size_outgoing_invalid_num_of_nsvcs() runs on 
RAW_Test_CT {
+   f_init_vty();
+   f_init_ns_codec(mp_nsconfig);
+   /* Assumption: No connections to other NSEs for SUT and testcomponent */
+   const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints;
+   const integer IDX := 0;
+   /* Template that would be accepted, only missing the number of IP 
endpoints
+* (since there are no ternary operators in TTCN-3...) */
+   var template (omit) PDU_NS ts_base_SNS_SIZE_configured :=
+   ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 
num_of_nsvcs,
+   num_v4 := omit, num_v6 := omit);
+   var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX];
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.nSEI_NS := 
ts_NS_IE_NSEI(g_nsconfig.nsei);
+   f_set_num_of_ip_endpoints(ts_base_SNS_SIZE_configured, 
g_nsconfig.nsvc[0].provider.ip.address_family);
+   /* Assumption: No connections to other NSEs for SUT and testcomponent 
and thus no other endpoints */
+   const integer required_max_num_of_nsvcs := num_of_nsvcs;
+   const uint16_t invalid_max_num_of_nsvcs := required_max_num_of_nsvcs - 
1;
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.maxNumberOfNSVCs := 
ts_SNS_IE_MaxNumOfNSVCs(invalid_max_num_of_nsvcs);
+   const NsCause cause := NS_CAUSE_INVALID_NR_OF_NSVCS;
+   f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause);
+   f_clean_ns_codec();
+}
+
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig);
@@ -1181,6 +1206,7 @@
execute( TC_sns_sgsn_size_after_success() );
execute( 
TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() );
execute( TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() );
+   execute( 
TC_sns_sgsn_sns_size_outgoing_invalid_num_of_nsvcs() );
}
}
 }

null--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
Gerrit-Change-Number: 30432
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-10 Thread arehbein
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431

to look at the new patch set (#2).

Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..

WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

Related: OS#5208
Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
---
M ns/NS_Tests.ttcn
1 file changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/31/30431/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size NSEI IE

2022-12-10 Thread arehbein
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430

to look at the new patch set (#2).

Change subject: WIP: ns: Add test for SNS Size NSEI IE
..

WIP: ns: Add test for SNS Size NSEI IE

Related: OS#5208
Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
---
M ns/NS_Tests.ttcn
1 file changed, 51 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/30/30430/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
Gerrit-Change-Number: 30430
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size procedure

2022-12-10 Thread arehbein
arehbein has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314 )

Change subject: WIP: ns: Add test for SNS Size procedure
..


Abandoned

Replaced by three separate patches, this was just preliminary
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ica8f6334afadb741180eeb5eb40d8192e61a2e67
Gerrit-Change-Number: 30314
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: arehbein 
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

2022-12-01 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431 )


Change subject: WIP: ns: Add test for SNS Size Num. of IP Endpoints IE
..

WIP: ns: Add test for SNS Size Num. of IP Endpoints IE

Related: OS#5208
Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
---
M ns/NS_Tests.ttcn
1 file changed, 32 insertions(+), 0 deletions(-)



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

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 3ebdbf3..64ab5dc 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -609,6 +609,37 @@
f_clean_ns_codec();
 }

+testcase TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() runs on RAW_Test_CT {
+   f_init_vty();
+   f_init_ns_codec(mp_nsconfig);
+   const integer IDX := 0;
+   const integer NUM_IP := 1;
+   log("f_outgoing_sns_size_invalid_num_of_ip_eps(idx=", IDX, ")");
+   var NsCause cause;
+   /* Assumption: No connections to other NSEs for SUT and testcomponent */
+   const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints;
+   /* Template that would be accepted, only missing the number of IP 
endpoints
+* (since there are no ternary operators in TTCN-3...) */
+   var template (omit) PDU_NS ts_base_SNS_SIZE_configured :=
+   ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 
num_of_nsvcs,
+   num_v4 := omit, num_v6 := omit);
+   /* Send IP4 endpoints when IP6 is configured and vice versa, in effect 
sending an unsupported type of NS-VC endpoints. */
+   if (g_nsconfig.nsvc[0].provider.ip.address_family == AF_INET) {
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP6_Endpoints 
:=
+   {iEI := int2oct(enum2int(ns_iei_num_ipv6_ep), 1), 
numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+   cause := NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS;
+   } else {
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.numberOfIP4_Endpoints 
:=
+   {iEI := int2oct(enum2int(ns_iei_num_ipv4_ep), 1), 
numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+   cause := NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS;
+   }
+   f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause);
+   setverdict(pass);
+   f_clean_ns_codec();
+}
+
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig);
@@ -1149,6 +1180,7 @@
execute( TC_sns_sgsn_size_correct_port() );
execute( TC_sns_sgsn_size_after_success() );
execute( 
TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() );
+   execute( TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() );
}
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30431
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I85c2dc201ba485d7bfdcc70e1a5f8a890023c435
Gerrit-Change-Number: 30431
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size NSEI IE

2022-12-01 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430 )


Change subject: WIP: ns: Add test for SNS Size NSEI IE
..

WIP: ns: Add test for SNS Size NSEI IE

Related: OS#5208
Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
---
M ns/NS_Tests.ttcn
1 file changed, 51 insertions(+), 0 deletions(-)



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

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 722f8ec..3ebdbf3 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -67,6 +67,9 @@
}
}
};
+   NsIEI ns_iei_num_ipv4_ep := NS_IEI_NUM_IPv4_EP;
+   NsIEI ns_iei_num_ipv6_ep := NS_IEI_NUM_IPv6_EP;
+   NsIEI ns_iei_nsei := NS_IEI_NSEI;
 }

 type component RAW_Test_CT extends RAW_NS_CT {
@@ -559,6 +562,53 @@
 /* 48.016 SNS test cases */

 /* do a succesful SNS configuration */
+function f_send_expect(in integer NSCP_IDX, in template (omit) PDU_NS pdu,
+  in NsCause c) runs on RAW_Test_CT {
+   log("Expected cause: ", c);
+   NSCP[NSCP_IDX].send(pdu);
+   f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig.nsei, c), NSCP_IDX);
+}
+
+function f_set_num_of_ip_endpoints(inout template (omit) PDU_NS base, 
AddressFamily af) runs on RAW_Test_CT {
+   const integer NUM_IP := 1;
+   if (af == AF_INET) {
+   base.pDU_SNS_Size.numberOfIP4_Endpoints :=
+   {iEI := int2oct(enum2int(ns_iei_num_ipv4_ep), 1),
+numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+   } else {
+   base.pDU_SNS_Size.numberOfIP4_Endpoints :=
+   {iEI := int2oct(enum2int(ns_iei_num_ipv6_ep), 1),
+numberOfIP_Endpoints := int2oct(NUM_IP, 2)};
+   }
+}
+
+/* Send SNS Size PDUs with invalid IEs */
+testcase TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() runs on RAW_Test_CT {
+   f_init_vty();
+   f_init_ns_codec(mp_nsconfig);
+   const integer IDX := 0;
+   /* Assumption: No connections to other NSEs for SUT and testcomponent */
+   const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints;
+   /* Template that would be accepted, only missing the number of IP 
endpoints
+* (since there are no ternary operators in TTCN-3...) */
+   var template (omit) PDU_NS ts_base_SNS_SIZE_configured :=
+   ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 
num_of_nsvcs,
+   num_v4 := omit, num_v6 := omit);
+   var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX];
+
+   f_set_num_of_ip_endpoints(ts_base_SNS_SIZE_configured, 
g_nsconfig.nsvc[0].provider.ip.address_family);
+   /* Syntactical error here: length of 1 (has to be >=2) */
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.nSEI_NS :=
+   {iEI := int2oct(enum2int(ns_iei_nsei), 1), ext := '0'B, 
lengthIndicator := {length1 := 1},
+nSEI := int2oct(g_nsconfig.nsei, 2)};
+   const NsCause cause := NS_CAUSE_INVALID_ESSENTIAL_IE;
+   f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause);
+   setverdict(pass);
+   f_clean_ns_codec();
+}
+
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig);
@@ -1098,6 +1148,7 @@
execute( TC_sns_sgsn_add_change_del() );
execute( TC_sns_sgsn_size_correct_port() );
execute( TC_sns_sgsn_size_after_success() );
+   execute( 
TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() );
}
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30430
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3584b7b048031c798cee9566c4cc8694bf6002ac
Gerrit-Change-Number: 30430
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size Num. of NSVCs IE

2022-12-01 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432 )


Change subject: WIP: ns: Add test for SNS Size Num. of NSVCs IE
..

WIP: ns: Add test for SNS Size Num. of NSVCs IE

Related: OS#5208
Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
---
M ns/NS_Tests.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)



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

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 64ab5dc..a87058b 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -640,6 +640,31 @@
f_clean_ns_codec();
 }

+testcase TC_sns_sgsn_sns_size_outgoing_invalid_num_of_nsvcs() runs on 
RAW_Test_CT {
+   f_init_vty();
+   f_init_ns_codec(mp_nsconfig);
+   /* Assumption: No connections to other NSEs for SUT and testcomponent */
+   const integer sgsn_ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer ip4_endpoints := lengthof(mp_nsconfig.nsvc);
+   const integer num_of_nsvcs := sgsn_ip4_endpoints * ip4_endpoints;
+   const integer IDX := 0;
+   /* Template that would be accepted, only missing the number of IP 
endpoints
+* (since there are no ternary operators in TTCN-3...) */
+   var template (omit) PDU_NS ts_base_SNS_SIZE_configured :=
+   ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 
num_of_nsvcs,
+   num_v4 := omit, num_v6 := omit);
+   var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX];
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.nSEI_NS := 
ts_NS_IE_NSEI(g_nsconfig.nsei);
+   f_set_num_of_ip_endpoints(ts_base_SNS_SIZE_configured, 
g_nsconfig.nsvc[0].provider.ip.address_family);
+   /* Assumption: No connections to other NSEs for SUT and testcomponent 
and thus no other endpoints */
+   const integer required_max_num_of_nsvcs := num_of_nsvcs;
+   const uint16_t invalid_max_num_of_nsvcs := required_max_num_of_nsvcs - 
1;
+   ts_base_SNS_SIZE_configured.pDU_SNS_Size.maxNumberOfNSVCs := 
ts_SNS_IE_MaxNumOfNSVCs(invalid_max_num_of_nsvcs);
+   const NsCause cause := NS_CAUSE_INVALID_NR_OF_NSVCS;
+   f_send_expect(IDX, ts_base_SNS_SIZE_configured, cause);
+   f_clean_ns_codec();
+}
+
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
f_init_vty();
f_init_ns_codec(mp_nsconfig);
@@ -1181,6 +1206,7 @@
execute( TC_sns_sgsn_size_after_success() );
execute( 
TC_sns_sgsn_sns_size_syntactically_wrong_NSEI() );
execute( TC_sns_sgsn_sns_size_invalid_num_of_ip_eps() );
+   execute( 
TC_sns_sgsn_sns_size_outgoing_invalid_num_of_nsvcs() );
}
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30432
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic69c461cdb854a1b7abd27c56d70c3cbe32e6eb7
Gerrit-Change-Number: 30432
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: ns: Add test for SNS Size procedure

2022-11-25 Thread arehbein
arehbein has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314 )


Change subject: WIP: ns: Add test for SNS Size procedure
..

WIP: ns: Add test for SNS Size procedure

Related: OS#5208

Change-Id: Ica8f6334afadb741180eeb5eb40d8192e61a2e67
---
M ns/NS_Tests.ttcn
1 file changed, 35 insertions(+), 0 deletions(-)



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

diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
index 722f8ec..565945c 100644
--- a/ns/NS_Tests.ttcn
+++ b/ns/NS_Tests.ttcn
@@ -558,6 +558,40 @@

 /* 48.016 SNS test cases */

+/* Send an SNS Size(-ish) PDU, i.e. an SNS Size or an SNS Size with erroneous 
payload */
+function f_outgoing_sns_size_wrong_ip_family(template (omit) PDU_NS base)
+runs on RAW_NS_CT {
+   const integer IDX := 0;
+   const integer NUM_IP := 1;
+   log("f_outgoing_sns_sizeish_pdu(idx=", IDX, ")");
+   var NSVCConfiguration nsvc_cfg := g_nsconfig.nsvc[IDX];
+   var template (omit) NsCause cause := omit;
+
+   if (nsvc_cfg.provider.ip.address_family == AF_INET) {
+   base.pDU_SNS_Size.numberOfIP6_Endpoints :=
+   {iEI := '09'O, numberOfIP_Endpoints := 
int2oct(valueof(NUM_IP), 2)};
+   cause := NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS;
+   } else {
+   base.pDU_SNS_Size.numberOfIP4_Endpoints :=
+   {iEI := '08'O, numberOfIP_Endpoints := 
int2oct(valueof(NUM_IP), 2)};
+   cause := NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS;
+   }
+   log("expected cause: ", cause);
+   NSCP[IDX].send(base);
+   f_ns_exp(tr_SNS_SIZE_ACK(g_nsconfig.nsei, cause), IDX);
+}
+
+testcase TC_sgsn_sns_size_payload() runs on RAW_Test_CT {
+   f_init_ns_codec(mp_nsconfig);
+   /* Template that would be accepted, only missing the number of IP 
endpoints
+* (since there are no ternary operators in TTCN-3...) */
+   template (omit) PDU_NS ts_base_SNS_SIZE_configured := 
ts_SNS_SIZE(g_nsconfig.nsei, rst_flag := true, max_nsvcs := 1,
+ 
num_v4 := omit, num_v6 := omit);
+   f_outgoing_sns_size_wrong_ip_family(ts_base_SNS_SIZE_configured);
+   setverdict(pass);
+   f_clean_ns_codec();
+}
+
 /* do a succesful SNS configuration */
 testcase TC_sns_bss_config_success() runs on RAW_Test_CT {
f_init_vty();
@@ -1098,6 +1132,7 @@
execute( TC_sns_sgsn_add_change_del() );
execute( TC_sns_sgsn_size_correct_port() );
execute( TC_sns_sgsn_size_after_success() );
+   execute( TC_sgsn_sns_size_payload() );
}
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ica8f6334afadb741180eeb5eb40d8192e61a2e67
Gerrit-Change-Number: 30314
Gerrit-PatchSet: 1
Gerrit-Owner: arehbein 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: TODO

2022-10-04 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28911 )

Change subject: WIP: TODO
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28911
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibecc128677d25f7d19a47f8a8a8a80a62b3c707a
Gerrit-Change-Number: 28911
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: TODO

2022-08-03 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28911 )


Change subject: WIP: TODO
..

WIP: TODO

Change-Id: Ibecc128677d25f7d19a47f8a8a8a80a62b3c707a
---
M cbc/CBC_Tests.ttcn
1 file changed, 10 insertions(+), 0 deletions(-)



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

diff --git a/cbc/CBC_Tests.ttcn b/cbc/CBC_Tests.ttcn
index fd88775..267290b 100644
--- a/cbc/CBC_Tests.ttcn
+++ b/cbc/CBC_Tests.ttcn
@@ -669,4 +669,14 @@
execute( TC_concurrent_cbs_msg_mme() );
 }

+/* TODO:
+ * + Test CBC resends active message upon cell failure:
+ * 1- Set a state with an ongoing CBS message in the MME
+ * 2- MME sends Failure Report Indication (cell is down)
+ * 3- MME sends Restart indication (cell is up and ready again)
+ * 4- CBC should then re-send a Write-Replace for that cell (setting cell list 
to that one only?)
+ *
+ * + Test ETWS message, only CBS tested so far. Look at TS 23.041 9.4.1.2.2
+ */
+
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28911
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibecc128677d25f7d19a47f8a8a8a80a62b3c707a
Gerrit-Change-Number: 28911
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP

2022-08-01 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28883 )


Change subject: WIP
..

WIP

Change-Id: Ifcdcddc7dccb5439126a5fa29bb540669ed25908
---
M cbc/CBC_Tests.ttcn
M cbc/MME_ConnectionHandler.ttcn
M library/sbcap/SBC_AP_Templates.ttcn
3 files changed, 105 insertions(+), 2 deletions(-)



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

diff --git a/cbc/CBC_Tests.ttcn b/cbc/CBC_Tests.ttcn
index 76fc3be..f39b487 100644
--- a/cbc/CBC_Tests.ttcn
+++ b/cbc/CBC_Tests.ttcn
@@ -115,7 +115,9 @@
cbc_host := cbc_host,
cbc_sbcap_port := cbc_sbcap_port,
start_fn := refers(f_MME_ConnHdlr_start_fn_void),
-   exp_cbs_msg := omit
+   exp_cbs_msg := omit,
+   write_replace_warning_ind_cause := omit,
+   bcast_cell_id_list := omit
};
return pars;
 }
@@ -298,6 +300,12 @@

 private function f_mme_create_and_delete() runs on MME_ConnHdlr {
f_sbcap_handle_write_replace_warn_req(g_pars.exp_cbs_msg, 0);
+   if (ispresent(g_pars.write_replace_warning_ind_cause) and
+   ispresent(g_pars.bcast_cell_id_list)) {
+   f_sbcap_tx_write_replace_warn_ind(0, g_pars.exp_cbs_msg,
+ 
g_pars.write_replace_warning_ind_cause,
+ g_pars.bcast_cell_id_list)
+   }
f_sbcap_handle_stop_warn_req(0, g_pars.exp_cbs_msg);
 }

@@ -411,10 +419,32 @@
f_shutdown_helper();
 }

+/* Create and delete message with MME available. MME reports
+ * Write-Replace-Warning-Indication and Stop-Warning-Indication to CBC
+ */
+testcase TC_ecbe_create_delete_mme_indication() runs on test_CT {
+   var template (value) CellId_Broadcast_List bcast_cell_id_li;
+   var template (value) CBS_Message msg := t_CBSmsg(48, 16752);
+
+   f_init(num_bsc := 0, num_mme := 1);
+
+   bcast_cell_id_li := {
+   
ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 
1234))
+   };
+   g_pars_MME[0].start_fn := refers(f_mme_create_and_delete);
+   g_pars_MME[0].exp_cbs_msg := valueof(msg);
+   g_pars_MME[0].write_replace_warning_ind_cause := 
SBC_AP_Cause_message_accepted;
+   g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li);
+   f_start();
+   f_create_and_delete(valueof(msg));
+   f_shutdown_helper();
+}
+
 /* Create and delete message with both BSC and MME available */
 testcase TC_ecbe_create_delete_bsc_and_mme() runs on test_CT {
f_init(num_bsc := 1, num_mme := 1);
var template (value) BSSMAP_FIELD_CellIdentificationList 
cell_list_success;
+   var template (value) CellId_Broadcast_List bcast_cell_id_li;
var template (value) CBS_Message msg := t_CBSmsg(43, 16752);

cell_list_success := ts_BSSMAP_CIL_CGI({
@@ -425,8 +455,14 @@
g_pars_BSC[0].start_fn := refers(f_bsc_create_and_delete);
g_pars_BSC[0].exp_cbs_msg := valueof(msg);
g_pars_BSC[0].cell_list_success := valueof(cell_list_success);
+
+   bcast_cell_id_li := {
+   
ts_SBCAP_CellId_Broadcast_List_Item(ts_SBCAP_ECGI(f_enc_mcc_mnc('901'H, '70'H), 
1234))
+   };
g_pars_MME[0].start_fn := refers(f_mme_create_and_delete);
g_pars_MME[0].exp_cbs_msg := valueof(msg);
+   g_pars_MME[0].write_replace_warning_ind_cause := 
SBC_AP_Cause_message_accepted;
+   g_pars_MME[0].bcast_cell_id_list := valueof(bcast_cell_id_li);
f_start();
f_create_and_delete(valueof(msg));
f_shutdown_helper();
@@ -440,6 +476,7 @@
execute( TC_ecbe_create_delete_lac() );
execute( TC_ecbe_create_delete_ci() );
execute( TC_ecbe_create_delete_lai() );
+   execute( TC_ecbe_create_delete_mme_indication() );
execute( TC_ecbe_create_delete_bsc_and_mme() );
 }

diff --git a/cbc/MME_ConnectionHandler.ttcn b/cbc/MME_ConnectionHandler.ttcn
index 055aaa3..fec358c 100644
--- a/cbc/MME_ConnectionHandler.ttcn
+++ b/cbc/MME_ConnectionHandler.ttcn
@@ -35,7 +35,9 @@
charstring cbc_host,
integer cbc_sbcap_port,
void_fn start_fn,
-   CBS_Message exp_cbs_msg optional
+   CBS_Message exp_cbs_msg optional,
+   SBC_AP_Cause write_replace_warning_ind_cause optional,
+   CellId_Broadcast_List bcast_cell_id_list optional
 };

 function f_MME_ConnHdlr_main(charstring id, MME_ConnHdlrPars pars) runs on 
MME_ConnHdlr {
@@ -53,6 +55,17 @@
f_SBC_AP_send(tx, idx);
 }

+function f_sbcap_tx_write_replace_warn_ind(integer idx := 0, CBS_Message msg,
+  SBC_AP_Cause cause,
+  template (value) 
CellId_Broadcast_List bcast_cell_id_li)
+runs on MME_ConnHdlr {
+   var template (value) SBC_AP_PDU tx;
+   tx := 

Change in osmo-ttcn3-hacks[master]: WIP: more work towards HNBGW_Tests

2022-02-11 Thread daniel
daniel has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27110 )

Change subject: WIP: more work towards HNBGW_Tests
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27110
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I99ddd30fd2a27f2025928006db79388625e26b01
Gerrit-Change-Number: 27110
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: more work towards HNBGW_Tests

2022-02-09 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27110 )


Change subject: WIP: more work towards HNBGW_Tests
..

WIP: more work towards HNBGW_Tests

Change-Id: I99ddd30fd2a27f2025928006db79388625e26b01
---
M hnbgw/HNBGW_Tests.ttcn
D hnbgw/MSC_ConnHdlr.ttcn
M hnbgw/gen_links.sh
M hnbgw/osmo-hnbgw.cfg
M hnbgw/osmo-stp.cfg
M hnbgw/regen_makefile.sh
A library/RUA_Emulation.ttcn
7 files changed, 790 insertions(+), 181 deletions(-)



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

diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 750c927..59cda1a 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -15,6 +15,7 @@

 import from Misc_Helpers all;
 import from General_Types all;
+import from GSM_Types all;
 import from Osmocom_Types all;
 import from IPL4asp_Types all;

@@ -31,23 +32,24 @@
 import from TELNETasp_PortType all;

 import from HNBAP_Templates all;
+import from HNBAP_PDU_Descriptions all;
+
 import from RUA_IEs all;
 import from RUA_Templates all;
-import from HNBAP_PDU_Descriptions all;
+import from RUA_Emulation all;

 import from Iuh_Emulation all;

 import from RANAP_Types all;
+import from RANAP_PDU_Descriptions all;
+import from RANAP_PDU_Contents all;
+import from RANAP_IEs all;
+import from RANAP_Templates all;
+
 import from RAN_Adapter all;

-import from BSSAP_Types all;
 import from RAN_Adapter all;
 import from RAN_Emulation all;
-import from BSSAP_CodecPort all;
-import from IPA_Emulation all;
-import from IPA_CodecPort all;
-import from IPA_Types all;
-

 import from MGCP_Emulation all;
 import from MGCP_Types all;
@@ -55,8 +57,6 @@
 import from MGCP_CodecPort all;
 import from SDP_Types all;

-import from MSC_ConnHdlr all;
-
 modulepar {
/* IP address at which the HNodeB can be reached */
charstring mp_hnodeb_ip := "127.0.0.1";
@@ -83,16 +83,68 @@
RAN_Configuration mp_sgsn_cfg := {
transport := RANAP_TRANSPORT_IuCS,
sccp_service_type := "mtp3_itu",
-   sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
-   own_pc := 185,  /* 0.23.1 first MSC emulation */
+   sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" },
+   own_pc := 185,  /* 0.23.1 first SGSN emulation */
own_ssn := 142,
peer_pc := 189, /* 0.23.5 osmo-hnbgw */
peer_ssn := 142,
sio := '83'O,
-   rctx := 1
+   rctx := 2
};
 }

+function MSC_UnitdataCallback(RANAP_PDU ranap) runs on RAN_Emulation_CT return 
template RANAP_PDU {
+// FIXME
+return ts_RANAP_Reset(ts_RanapCause_om_intervention, cs_domain);
+}
+
+const RanOps MSC_RanOps := {
+ranap_create_cb := refers(RAN_Emulation.RanapExpectedCreateCallback),
+ranap_unitdata_cb := refers(MSC_UnitdataCallback),
+ps_domain := false,
+decode_dtap := false,
+role_ms := false,
+protocol := RAN_PROTOCOL_RANAP,
+transport := RANAP_TRANSPORT_IuCS,
+use_osmux := false,
+sccp_addr_local := omit,
+sccp_addr_peer := omit
+}
+
+type record TestHdlrParams {
+   integer hnb_idx,
+hexstring imsi,
+   boolean ps_domain,
+   HnbConfig hnb optional
+};
+
+/* We extend:
+   * RUA_ConnHdlr (for the Iuh side, emulating the HNB)
+   * RAN_ConnHdlr (for the Iu side, emulating the MSC)
+   * MGCP_ConnHdlr (for the MGCP side, emulating the MGW)
+ */
+type component ConnHdlr extends RAN_ConnHdlr, MGCP_ConnHdlr, RUA_ConnHdlr {
+   var integer g_sccp_conn_id;
+
+   var TestHdlrParams g_pars;
+   timer g_Tguard;
+}
+
+
+const MGCPOps MSC_MGCPOps := {
+create_cb := refers(MGCP_Emulation.ExpectedCreateCallback),
+unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback)
+}
+
+function f_create_ranap_exp(octetstring l3_enc) runs on ConnHdlr {
+BSSAP_PROC.call(RAN_register:{l3_enc, self}) {
+[] BSSAP_PROC.getreply(RAN_register:{?, ?}) {};
+}
+}
+
+
+const integer NUM_HNB := 1;
+
 const hexstring ranap_cm_service_req := 
'0013404006000340010f4006f11028b6003a4008f1100010400e0d052411035758a605f44e9d4aef004f40031c0056400500f1100017'H;
 const hexstring ranap_auth_req := 
'0014403202001040262505120217dc146aeac56cb5ff6d5fb51f47f19220108ca5a6d0c811b9e9272498872764003b400100'H;
 const hexstring ranap_auth_resp := 
'00144014010010400d0c0554ccbdd0302104002f3ae4'H;
@@ -100,20 +152,27 @@
 const hexstring ranap_rab_ass_req := 
'0059010036405201003500487824cd80102fa7201a2cf44c080a02800051400027202814006740222814003c4000503d02000227c03500010a0901a200401f4a400100'H;
 const hexstring iu_release_compl := '2001000300'H;

+type record HnbConfig {
+   LocationAreaIdentification lai,

Change in osmo-ttcn3-hacks[master]: WIP

2021-10-08 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25726 )

Change subject: WIP
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25726
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I918c9af9ca5b1049ef5b59637a198d7aa8345176
Gerrit-Change-Number: 25726
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP

2021-10-08 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25726 )


Change subject: WIP
..

WIP

Change-Id: I918c9af9ca5b1049ef5b59637a198d7aa8345176
---
M bts/BTS_Tests.ttcn
1 file changed, 2 insertions(+), 0 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index cf47d33..6e37650 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1211,6 +1211,8 @@

/* First, configure both SI5 and SI6 to be transmitted */
RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5, si5));
+   RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5bis, ''O));
+   RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_5ter, ''O));
RSL.send(ts_RSL_SACCH_FILL(RSL_SYSTEM_INFO_6, si6));

f_l1_tune(L1CTL);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25726
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I918c9af9ca5b1049ef5b59637a198d7aa8345176
Gerrit-Change-Number: 25726
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: Implement SystemInformation13 Rest Octets types

2021-02-17 Thread pespin
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22802

to look at the new patch set (#2).

Change subject: WIP: Implement SystemInformation13 Rest Octets types
..

WIP: Implement SystemInformation13 Rest Octets types

Change-Id: Id8845ebe28a9a6ed79d2d408dc7c1ad8a275b809
---
M bsc/BSC_Tests.ttcn
M library/GSM_RestOctets.ttcn
M library/GSM_SystemInformation.ttcn
M library/RLCMAC_CSN1_Types.ttcn
4 files changed, 134 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/02/22802/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22802
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id8845ebe28a9a6ed79d2d408dc7c1ad8a275b809
Gerrit-Change-Number: 22802
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: Implement SystemInformation13 Rest Octets types

2021-02-09 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22802 )


Change subject: WIP: Implement SystemInformation13 Rest Octets types
..

WIP: Implement SystemInformation13 Rest Octets types

Change-Id: Id8845ebe28a9a6ed79d2d408dc7c1ad8a275b809
---
M bsc/BSC_Tests.ttcn
M library/GSM_RestOctets.ttcn
M library/GSM_SystemInformation.ttcn
3 files changed, 41 insertions(+), 4 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 52b4906..e2c17e6 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -165,8 +165,7 @@
SI2quaterRestOctetsList si2quater optional,
SystemInformationType3 si3 optional,
SystemInformationType4 si4 optional,
-   /* TODO: replace with proper decoding of SI13, implement SI13 in 
GSM_SystemInformation.ttcn */
-   octetstring si13 optional,
+   SystemInformationType13 si13 optional,
SystemInformationType5 si5 optional,
SystemInformationType5bis si5bis optional,
SystemInformationType5ter si5ter optional,
@@ -371,7 +370,9 @@
s := omit
}
},
-   si13 := '9000185A6FC9E08410AB2B2B2B2B2B2B2B2B2B2B'O,
+   si13 := {
+   rest_octets := '9000185A6FC9E08410AB2B2B2B2B2B2B2B2B2B2B'O
+   },
si5 := {
bcch_freq_list := '1000'O
},
diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn
index d47e510..ec817eb 100644
--- a/library/GSM_RestOctets.ttcn
+++ b/library/GSM_RestOctets.ttcn
@@ -692,6 +692,30 @@
variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
 };

+/* 10.5.2.37b SI 13 Rest Octets (O & S) */
+type record SI13RestOctets {
+   BIT1presence, // L/H
+
+
+   SelectionParamsOpt  sel_params,
+   PowerOffsetOpt  pwr_offset,
+   GPRSIndicatorOptgprs_ind,
+   BIT1s_presence, // L/H
+   /* TODO: optional "Rest Octets S" part */
+   bitstring   s optional
+} with {
+
+   variant (presence) "CSN.1 L/H"
+
+
+   variant (s_presence) "CSN.1 L/H"
+   variant (s) "PRESENCE(s_presence = '1'B)"
+
+   /* The TITAN's RAW encoder generates an octet-aligned octetstring,
+* so we should make sure that unused bits contain proper padding. */
+   variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
+};
+
 /* Selection Parameters */
 type record SelectionParams {
boolean cbq,
@@ -777,6 +801,11 @@
 external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets
with { extension "prototype(convert) decode(RAW)" };

+external function enc_SI13RestOctets(in SI13RestOctets ro) return octetstring
+   with { extension "prototype(convert) encode(RAW)" };
+external function dec_SI13RestOctets(in octetstring stream) return 
SI13RestOctets
+   with { extension "prototype(convert) decode(RAW)" };
+

 /* Basic templates to be extended in place */
 template (value) SI3RestOctets ts_SI3RestOctets := {
diff --git a/library/GSM_SystemInformation.ttcn 
b/library/GSM_SystemInformation.ttcn
index 85abb7f..86ff817 100644
--- a/library/GSM_SystemInformation.ttcn
+++ b/library/GSM_SystemInformation.ttcn
@@ -160,7 +160,7 @@
rach_control := ?,
rest_octets := ?
};
-
+

/* 44.018 9.1.36 */
type record SystemInformationType4 {
@@ -196,6 +196,11 @@
RestOctets  rest_octets length(0..7)
} with { variant "" };

+   /* 44.018 9.1.43a */
+   type record SystemInformationType13 {
+   SI13RestOctets  rest_octets
+   } with { variant "" };
+
type union SystemInformationUnion {
SystemInformationType1  si1,
SystemInformationType2  si2,
@@ -208,6 +213,7 @@
SystemInformationType5bis   si5bis,
SystemInformationType5ter   si5ter,
SystemInformationType6  si6,
+   SystemInformationType13 si13,
octetstring other
} with { variant "" };

@@ -225,6 +231,7 @@
  si5bis, header.message_type = 
SYSTEM_INFORMATION_TYPE_5bis;
  si5ter, header.message_type = 
SYSTEM_INFORMATION_TYPE_5ter;
  si6, header.message_type = 
SYSTEM_INFORMATION_TYPE_6;
+ si13, header.message_type = 
SYSTEM_INFORMATION_TYPE_13;
  other, OTHERWISE;
)" };


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22802
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: 

Change in osmo-ttcn3-hacks[master]: WIP: pcu: ACK Pkt Cell Change Continue

2021-02-02 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22627 )


Change subject: WIP: pcu: ACK Pkt Cell Change Continue
..

WIP: pcu: ACK Pkt Cell Change Continue

Related: OS#4909
Change-Id: I73aaa80e73b2abb06fd0084433122337dc9c4e3f
---
M pcu/PCU_Tests.ttcn
1 file changed, 31 insertions(+), 8 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index e44e204..1d4e129 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -3597,10 +3597,9 @@
f_shutdown(__BFILE__, __LINE__, final := true);
 }

-private function f_skip_dummy(integer max_num_iter)
+private function f_skip_dummy(integer max_num_iter, out uint32_t sched_fn)
 runs on RAW_PCU_Test_CT return RlcmacDlBlock {
var RlcmacDlBlock dl_block;
-   var uint32_t sched_fn;
var integer i := 0;
while (true) {
f_rx_rlcmac_dl_block(dl_block, sched_fn);
@@ -3628,7 +3627,7 @@
var octetstring exp_si_chunk;
var GlobalTfi gtfi := { is_dl_tfi := false, tfi := ms.ul_tbf.tfi };

-   dl_block := f_skip_dummy(50);
+   dl_block := f_skip_dummy(50, sched_fn);

while (true) {
var template RlcmacDlCtrlMsg exp_msg; exp_msg :=
@@ -3745,7 +3744,11 @@
setverdict(fail, "Rx unexpected DL block: ", dl_block);
f_shutdown(__BFILE__, __LINE__);
}
-
+   /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET 
CONTROL ACK */
+   if (dl_block.ctrl.mac_hdr.rrbp_valid) {
+   sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp);
+   f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+   }
 }

 /* Verify PCU handles outbound Network Assisted Cell Change Cell Change (NACC, 
TS 44.060 sec 8.8). */
@@ -3936,11 +3939,16 @@
f_ms_tx_ul_block(ms, ts_RLC_UL_CTRL_ACK(cell_chf_notif), 0, nr := 
f_ms_tx_TsTrxBtsNum(ms));

/* Wait until we receive something non-dummy */
-   dl_block := f_skip_dummy(0);
+   dl_block := f_skip_dummy(0, sched_fn);
/* Make sure it is a Pkt Cell Chg Continue */
if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, 
tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) {
setverdict(fail, "Rx unexpected DL block: ", dl_block);
}
+   /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET 
CONTROL ACK */
+   if (dl_block.ctrl.mac_hdr.rrbp_valid) {
+   sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp);
+   f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+   }

f_shutdown(__BFILE__, __LINE__, final := true);
 }
@@ -4000,11 +4008,16 @@
f_ctrl_exp_get(IPA_CTRL, ctrl_var, omit);

/* Wait until we receive something non-dummy */
-   dl_block := f_skip_dummy(0);
+   dl_block := f_skip_dummy(0, sched_fn);
/* Make sure it is a Pkt Cell Chg Continue */
if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, 
tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) {
setverdict(fail, "Rx unexpected DL block: ", dl_block);
}
+   /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET 
CONTROL ACK */
+   if (dl_block.ctrl.mac_hdr.rrbp_valid) {
+   sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp);
+   f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+   }

f_shutdown(__BFILE__, __LINE__, final := true);
 }
@@ -4064,11 +4077,16 @@
f_ctrl_exp_get(IPA_CTRL, ctrl_var, "foobar-error");

/* Wait until we receive something non-dummy */
-   dl_block := f_skip_dummy(0);
+   dl_block := f_skip_dummy(0, sched_fn);
/* Make sure it is a Pkt Cell Chg Continue */
if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, 
tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) {
setverdict(fail, "Rx unexpected DL block: ", dl_block);
}
+   /* PKT CELL CHG CONTINUE ACK/NACK sets poll+rrbp requesting PACKET 
CONTROL ACK */
+   if (dl_block.ctrl.mac_hdr.rrbp_valid) {
+   sched_fn := f_rrbp_ack_fn(sched_fn, dl_block.ctrl.mac_hdr.rrbp);
+   f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);
+   }

f_shutdown(__BFILE__, __LINE__, final := true);
 }
@@ -4143,11 +4161,16 @@
/* We never answer the RIM procude -> PCU timeouts and should send Pkt 
Cell Chg continue */

/* Wait until we receive something non-dummy */
-   dl_block := f_skip_dummy(0);
+   dl_block := f_skip_dummy(0, sched_fn);
/* Make sure it is a Pkt Cell Chg Continue */
if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, 
tr_RlcMacDlCtrl_PKT_CELL_CHG_CONTINUE))) {
setverdict(fail, "Rx unexpected DL block: ", dl_block);
}
+   /* PKT CELL CHG CONTINUE 

Change in osmo-ttcn3-hacks[master]: WIP: NACC

2021-01-22 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387 )

Change subject: WIP: NACC
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387/1/pcu/PCU_Tests.ttcn
File pcu/PCU_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387/1/pcu/PCU_Tests.ttcn@3658
PS1, Line 3658: TC_nacc
might make sense to give the test a more specific name, as for sure we will 
have many more tests.  The name should at the very least imply that it is about 
"outbound" NACC.

Also, the comment above should indicate that.  Of course all NACC tests will 
tet NACC - but is it inbound/outbound? successful or error case? ...


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387/1/pcu/PCU_Tests.ttcn@3673
PS1, Line 3673: var BssgpCellId src := 
valueof(ts_BssgpCellId(ts_RAI(ts_LAI('262F42'H, /* TODO: encode from info_ind */
> self note: I still need to add some sort of function 
> "convert_plmn_to_hexstr(integer mcc, integer mn […]
I guess something like oct2hex(f_enc_mcc_mnc(mcc, mnc)) should work

and f_enc_mcc_mnc() must be made non-private and moved from 
BSSMAP_Templates.ttcn to a more general module.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I951db4af731e5a7c207f0f407dd78d166e2d3d26
Gerrit-Change-Number: 22387
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Fri, 22 Jan 2021 20:31:32 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: NACC

2021-01-22 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387 )

Change subject: WIP: NACC
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387/1/pcu/PCU_Tests.ttcn
File pcu/PCU_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387/1/pcu/PCU_Tests.ttcn@3673
PS1, Line 3673: var BssgpCellId src := 
valueof(ts_BssgpCellId(ts_RAI(ts_LAI('262F42'H, /* TODO: encode from info_ind */
self note: I still need to add some sort of function 
"convert_plmn_to_hexstr(integer mcc, integer mnc)" here, and pass values from 
ts_PCUIF_INFO_default.



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I951db4af731e5a7c207f0f407dd78d166e2d3d26
Gerrit-Change-Number: 22387
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 22 Jan 2021 17:56:58 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: NACC

2021-01-22 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22387 )


Change subject: WIP: NACC
..

WIP: NACC

Change-Id: I951db4af731e5a7c207f0f407dd78d166e2d3d26
---
M pcu/PCU_Tests.ttcn
M pcu/gen_links.sh
M pcu/osmo-pcu.cfg
M pcu/regen_makefile.sh
4 files changed, 188 insertions(+), 3 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 13b33b2..469c581 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -56,6 +56,10 @@
 import from StatsD_CodecPort_CtrlFunct all;
 import from StatsD_Checker all;

+import from IPA_Emulation all;
+import from Osmocom_CTRL_Adapter all;
+import from Osmocom_CTRL_Functions all;
+
 modulepar {
charstring mp_pcu_sock_path := PCU_SOCK_DEFAULT;

@@ -63,6 +67,9 @@

charstring mp_pcu_statsd_ip := "127.0.0.1";
integer mp_pcu_statsd_port := 8125;
+
+   charstring mp_ctrl_neigh_ip := "127.0.0.1";
+   integer mp_ctrl_neigh_port := 4248;
 }


@@ -111,7 +118,7 @@
uint8_t high
 }

-type component RAW_PCU_Test_CT extends bssgp_CT, MS_BTS_IFACE_CT, 
StatsD_ConnHdlr {
+type component RAW_PCU_Test_CT extends bssgp_CT, MS_BTS_IFACE_CT, 
StatsD_ConnHdlr, CTRL_Adapter_CT {
/* PCU interface abstraction component */
var RAW_PCUIF_CT vc_PCUIF;

@@ -3566,6 +3573,179 @@
f_shutdown(__BFILE__, __LINE__, final := true);
 }

+/* Handle groups of PKT NEIGHBOUR CELL DATA packets */
+private function f_handle_pkt_neighbor_cell_data(inout GprsMS ms, octetstring 
exp_si)
+runs on RAW_PCU_Test_CT {
+   var RlcmacDlBlock dl_block;
+   var uint32_t sched_fn;
+   var integer i := 0;
+   var uint5_t exp_container_idx := 0;
+   var integer si_offset := 0;
+   var integer len;
+   var octetstring exp_si_chunk;
+   var GlobalTfi gtfi := { is_dl_tfi := false, tfi := ms.ul_tbf.tfi };
+
+   while (true) {
+   f_rx_rlcmac_dl_block(dl_block, sched_fn);
+   if (not match(dl_block, tr_RLCMAC_DUMMY_CTRL())) {
+   break;
+   }
+   if (i > 50) {
+   setverdict(fail, "Rx unexpected DL block: ", dl_block);
+   f_shutdown(__BFILE__, __LINE__);
+   return;
+   }
+   i := i + 1;
+   }
+
+   while (true) {
+   var template RlcmacDlCtrlMsg exp_msg; exp_msg :=
+   tr_RlcMacDlCtrl_PKT_NEIGH_CELL_DATA(gtfi, 
exp_container_idx);
+
+   /* Make sure last Dl block is a Pkt Neighbour Cell Data */
+   if (not match(dl_block, tr_RLCMAC_DL_CTRL(?, exp_msg))) {
+   setverdict(fail, "Rx unexpected DL block: ", dl_block, 
" vs exp ", tr_RLCMAC_DL_CTRL(?, exp_msg));
+   f_shutdown(__BFILE__, __LINE__);
+   return;
+   }
+   var PacketNeighbourCellData neigh_data := 
dl_block.ctrl.payload.u.neighbour_cell_data;
+   var PacketNeighbourCellDataContainer cont := 
neigh_data.container_list[0];
+
+   if (cont.cd_length == 31) { /* continues on next message */
+   len := lengthof(cont.container_data);
+   exp_si_chunk := substr(exp_si, si_offset, len);
+   if (cont.container_data != exp_si_chunk) {
+   setverdict(fail, "Rx unexpected SI chunk at 
offset ", si_offset, ": ",
+  cont.container_data, " vs exp ", 
exp_si_chunk);
+   f_shutdown(__BFILE__, __LINE__);
+   return;
+   }
+   si_offset := si_offset + len;
+   } else if (cont.cd_length == 0) {
+   /* we are done */
+   if (si_offset != lengthof(exp_si)) {
+   setverdict(fail, "Rx unexpectd SI length ", 
si_offset,
+  " vs exp ", lengthof(exp_si));
+   f_shutdown(__BFILE__, __LINE__);
+   }
+   break;
+   } else { /* data length, last message */
+   len := cont.cd_length;
+   exp_si_chunk := substr(exp_si, si_offset, len);
+   if (cont.container_data != exp_si_chunk) {
+   setverdict(fail, "Rx unexpected SI chunk at 
offset ", si_offset, ": ",
+  cont.container_data, " vs exp ", 
exp_si_chunk);
+   f_shutdown(__BFILE__, __LINE__);
+   return;
+   }
+   si_offset := si_offset + len;
+   /* we are done */
+  

Change in osmo-ttcn3-hacks[master]: WIP: multiple sgsn-side NS-VCs

2021-01-16 Thread laforge
laforge has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21697 )

Change subject: WIP: multiple sgsn-side NS-VCs
..


Abandoned

superseded by master.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21697
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I088276578643cc5a52d0e00d16ec23cf7ab8cd8a
Gerrit-Change-Number: 21697
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: Introduce NS test cases

2021-01-10 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22091 )


Change subject: WIP: Introduce NS test cases
..

WIP: Introduce NS test cases

Change-Id: Ic619a374b88879d3116f8f28afb14401c3e3192b
---
M library/Osmocom_Gb_Types.ttcn
A ns/NS_Tests.default
A ns/NS_Tests.fr.cfg
A ns/NS_Tests.ttcn
A ns/NS_Tests.udp.cfg
A ns/expected-results.xml
A ns/gen_links.sh
A ns/osmo-ns.fr.cfg
A ns/osmo-ns.udp.cfg
A ns/regen_makefile.sh
10 files changed, 683 insertions(+), 0 deletions(-)



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

diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index c532772..c02e61e 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -14,6 +14,14 @@
type uint16_t Nsei;
type uint16_t BssgpBvci;

+   type enumerated OsmoNsDialect {
+   NS2_DIALECT_UNDEF   ('00'H),
+   NS2_DIALECT_STATIC_ALIVE('01'H),
+   NS2_DIALECT_STATIC_RESETBLOCK   ('02'H),
+   NS2_DIALECT_IPACCESS('03'H),
+   NS2_DIALECT_SNS ('04'H)
+   };
+
/* TS 48.016 10.3.7 */
type enumerated NsPduType {
NS_PDUT_NS_UNITDATA (''B),
diff --git a/ns/NS_Tests.default b/ns/NS_Tests.default
new file mode 100644
index 000..951c1c2
--- /dev/null
+++ b/ns/NS_Tests.default
@@ -0,0 +1,27 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+
+[LOGGING]
+#*.FileMask := LOG_ALL
+ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | USER
+
+[MODULE_PARAMETERS]
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoNSdummy";
+StatsD_Checker.mp_enable_stats := true;
+
+[TESTPORT_PARAMETERS]
+*.NSVTY.CTRL_MODE := "client"
+*.NSVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.NSVTY.CTRL_PORTNUM := "4240"
+*.NSVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.NSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.NSVTY.CTRL_READMODE := "buffered"
+*.NSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.NSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes"
+*.NSVTY.PROMPT1 := "OsmoNSdummy> "
+*.STATSVTY.PROMPT1 := "OsmoNSdummy> "
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
diff --git a/ns/NS_Tests.fr.cfg b/ns/NS_Tests.fr.cfg
new file mode 100644
index 000..91fb5c5
--- /dev/null
+++ b/ns/NS_Tests.fr.cfg
@@ -0,0 +1,57 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./NS_Tests.default"
+
+[LOGGING]
+
+[MODULE_PARAMETERS]
+NS_Tests.mp_dialect := NS2_DIALECT_IPACCESS
+NS_Tests.mp_nsconfig := {
+   nsei := 2001,
+   role_sgsn := false,
+   handle_sns := false,
+   nsvc := {
+   {
+   provider := {
+   fr := {
+   netdev := "hdlc1",
+   dlci := 16
+   }
+   },
+   nsvci := 1
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlc2",
+   dlci := 17
+   }
+   },
+   nsvci := 2
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlc3",
+   dlci := 18
+   }
+   },
+   nsvci := 3
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlc4",
+   dlci := 19
+   }
+   },
+   nsvci := 4
+   }
+   }
+}
+
+[TESTPORT_PARAMETERS]
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+NS_Tests.control
diff --git a/ns/NS_Tests.ttcn b/ns/NS_Tests.ttcn
new file mode 100644
index 000..26bef20
--- /dev/null
+++ b/ns/NS_Tests.ttcn
@@ -0,0 +1,338 @@
+module NS_Tests {
+
+/* Osmocom NS test suite for NS over framerelay or udp ip.access style in 
TTCN-3
+ * (C) 2021 sysmocom s.f.m.c. GmbH 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+import from General_Types all;
+import from Osmocom_Types all;
+import from Osmocom_Gb_Types all;
+import from NS_CodecPort all;
+import from NS_Types all;
+import from BSSGP_Types all;
+import from UD_Types all;
+import from NS_CodecPort_CtrlFunct all;
+import from NS_Emulation all;
+import from Native_Functions all;

Change in osmo-ttcn3-hacks[master]: WIP: Osmocom_Gb_types: add RIM templates

2020-12-14 Thread dexter
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21587

to look at the new patch set (#2).

Change subject: WIP: Osmocom_Gb_types: add RIM templates
..

WIP: Osmocom_Gb_types: add RIM templates

The template set we use for testing the GB (BSSGB) interface on
osmo-sgsn and osmo-pcu lacks templates to generate RIM (ran information
management) messages. The records and unions are already specified in
BSSGP_Types.ttcn, we just need to form templates in order to be able to
use them.

Change-Id: Ic495e0bb6ceb2b65cbc7c3da7ee519a013aede55
Related: SYS#5103
---
M library/Osmocom_Gb_Types.ttcn
1 file changed, 799 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/87/21587/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21587
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic495e0bb6ceb2b65cbc7c3da7ee519a013aede55
Gerrit-Change-Number: 21587
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: second SGSN

2020-12-12 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21698 )


Change subject: WIP: second SGSN
..

WIP: second SGSN

Change-Id: Ib70f7c1a29f089957f882df0e9b05ee526224611
---
M gbproxy/GBProxy_Tests.ttcn
M gbproxy/osmo-gbproxy.fr.cfg
2 files changed, 71 insertions(+), 21 deletions(-)



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

diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 59154e8..7e20077 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -66,6 +66,24 @@
nsvci := 101
}
}
+   }, {
+   nsei := 102,
+   role_sgsn := true,
+   handle_sns := false,
+   nsvc := {
+   {
+   provider := {
+   ip := {
+   address_family := 
AF_INET,
+   local_udp_port := ,
+   local_ip := "127.0.0.1",
+   remote_udp_port := 
23000,
+   remote_ip := "127.0.0.1"
+   }
+   },
+   nsvci := 102
+   }
+   }
}
};
/* BSS NSEI start at 2000 + x
@@ -263,7 +281,7 @@
 type record of NSConfiguration NSConfigurations;
 type record of BssgpCellId BssgpCellIds;

-const integer NUM_SGSN := 1;
+const integer NUM_SGSN := 2;

 type component test_CT {
var GbInstances g_pcu;
@@ -425,8 +443,25 @@
return false;
 }

+private type record of ro_integer roro_integer;
+
+/* count the number of unblocked BVCI for each SGSN NSE */
+private altstep as_count_unblocked4nse(integer sgsn_idx, inout roro_integer 
bvci_unblocked)
+runs on test_CT {
+   var BssgpStatusIndication bsi;
+   [] SGSN_MGMT.receive(BssgpStatusIndication:{g_sgsn[sgsn_idx].cfg.nsei, 
?, BVC_S_UNBLOCKED}) -> value bsi {
+   bvci_unblocked[sgsn_idx] := bvci_unblocked[sgsn_idx] & { 
bsi.bvci };
+   /* 'repeat' until sufficient number of BVC-rest has been 
received on all SGSNs */
+   for (var integer i := 0; i < lengthof(bvci_unblocked); i := 
i+1) {
+   if (lengthof(bvci_unblocked[i]) < 
lengthof(g_sgsn[i].cfg.bvc)) {
+   repeat;
+   }
+   }
+   }
+}
+
 function f_init(float t_guard := 30.0) runs on test_CT {
-   var ro_integer bvci_unblocked := {};
+   var roro_integer bvci_unblocked;
var BssgpStatusIndication bsi;
var integer i;

@@ -438,17 +473,21 @@
g_Tguard.start(t_guard);
activate(as_gTguard(g_Tguard));

-   g_sgsn[0].cfg := {
-   nsei := mp_nsconfig_sgsn[0].nsei,
-   sgsn_role := true,
-   bvc := { }
-   }
+   var BssgpBvcConfigs bvcs := { };
for (i := 0; i < lengthof(mp_gbconfigs); i := i+1) {
g_pcu[i].cfg := mp_gbconfigs[i];
/* make sure all have a proper crate_cb, which cannot be 
specified in config file */
f_fix_create_cb(g_pcu[i].cfg);
/* concatenate all the PCU-side BVCs for the SGSN side */
-   g_sgsn[0].cfg.bvc := g_sgsn[0].cfg.bvc & g_pcu[i].cfg.bvc;
+   bvcs := bvcs & g_pcu[i].cfg.bvc;
+   }
+
+   for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
+   g_sgsn[i].cfg := {
+   nsei := mp_nsconfig_sgsn[i].nsei,
+   sgsn_role := true,
+   bvc := bvcs
+   }
}

f_init_vty();
@@ -468,16 +507,18 @@
f_init_gb_pcu(g_pcu[i], "GbProxy_Test", i);
}

+   for (i := 0; i < lengthof(mp_nsconfig_sgsn); i := i+1) {
+   bvci_unblocked[i] := {};
+   }
+
/* wait until all BVC are unblocked on both sides */
timer T := 15.0;
T.start;
alt {
-   [] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> 
value bsi {
-   bvci_unblocked := bvci_unblocked & { bsi.bvci };
-   if (lengthof(bvci_unblocked) != lengthof(g_sgsn[0].cfg.bvc)) {
-   repeat;
-   }
-   }
+   /* TODO: We need to add more lines if NUM_SGSN increases.  Activating 
default altsteps
+* unfortunately doesn't work as we want to access the lcoal variable 
bvci_unblocked.  */
+   [] 

Change in osmo-ttcn3-hacks[master]: WIP: multiple sgsn-side NS-VCs

2020-12-12 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21697 )


Change subject: WIP: multiple sgsn-side NS-VCs
..

WIP: multiple sgsn-side NS-VCs

Change-Id: I088276578643cc5a52d0e00d16ec23cf7ab8cd8a
---
M gbproxy/osmo-gbproxy.fr.cfg
1 file changed, 14 insertions(+), 5 deletions(-)



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

diff --git a/gbproxy/osmo-gbproxy.fr.cfg b/gbproxy/osmo-gbproxy.fr.cfg
index efec418..32f0e91 100644
--- a/gbproxy/osmo-gbproxy.fr.cfg
+++ b/gbproxy/osmo-gbproxy.fr.cfg
@@ -3,16 +3,25 @@
 !!
 !
 log stderr
- logging level lns debug
+ !logging level lns debug
+ logging level lglobal info
+ logging level gprs debug
+ logging level lbssgp debug
+ logging level obj debug
+ logging print level 1
+ logging print category 1
+ logging print category-hex 0
+ logging print file basename last
 line vty
  no login
 !
 ns
  nse 101 nsvci 101
- nse 101 remote-role sgsn
- nse 101 encapsulation udp
- nse 101 remote-ip 127.0.0.1
- nse 101 remote-port 
+ nse 101 nsvci 101 remote-role sgsn
+ nse 101 nsvci 101 encapsulation udp
+ nse 101 nsvci 101 remote-ip 127.0.0.1
+ nse 101 nsvci 101 remote-port 
+
  timer tns-block 3
  timer tns-block-retries 3
  timer tns-reset 3

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21697
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I088276578643cc5a52d0e00d16ec23cf7ab8cd8a
Gerrit-Change-Number: 21697
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: Osmocom_Gb_types: add RIM templates

2020-12-07 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21587 )


Change subject: WIP: Osmocom_Gb_types: add RIM templates
..

WIP: Osmocom_Gb_types: add RIM templates

The template set we use for testing the GB (BSSGB) interface on
osmo-sgsn and osmo-pcu lacks templates to generate RIM (ran information
management) messages. The records and unions are already specified in
BSSGP_Types.ttcn, we just need to form templates in order to be able to
use them.

Change-Id: Ic495e0bb6ceb2b65cbc7c3da7ee519a013aede55
Related: SYS#5103
---
M library/Osmocom_Gb_Types.ttcn
1 file changed, 700 insertions(+), 0 deletions(-)



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

diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index 2afedcc..6ada404 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -2109,6 +2109,706 @@
}
}

+   /* 3GPP TS 48.018 11.3.61 */
+   template (value) RIM_Application_Identity 
ts_RIM_Application_Identity(OCT1 app_id) := {
+iEI := '29'O,
+ext := '1'B,
+lengthIndicator := {
+   length1 := 1
+},
+rIMApplicationIdentity := app_id
+   }
+
+
+   /* 3GPP TS 48.018 11.3.62 */
+   template (value) RIM_Sequence_Number ts_RIM_Sequence_Number(integer 
seq) := {
+iEI := '4C'O,
+ext := '1'B,
+lengthIndicator := {
+   length1 := 4
+},
+rIMSequenceNumber := int2oct(seq, 4)
+   }
+
+   /* 3GPP TS 48.018 11.3.62a.1 */
+   template (value) RAN_Information_Request_RIM_Container
+   ts_RAN_Information_Request_RIM_Container(template (value) 
RIM_Application_Identity app_id,
+template (value) 
RIM_Sequence_Number seq,
+template (value) 
RIM_PDU_Indications ind,
+template (omit) 
RIM_Protocol_Version_Number ver := omit,
+template (omit) 
RAN_Information_Request_Application_Container app_cont := omit,
+template (omit) 
SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
+iEI := '55'O,
+ext := '1'B,
+lengthIndicator := {
+   length1 := 0 /* overwritten */
+},
+rIM_Application_Identity := app_id,
+rIM_Sequence_Number := seq,
+rIM_PDU_Indications := ind,
+rIM_Protocol_Version_Number := ver,
+application_Container := app_cont,
+sON_Transfer_Application_Identity_TLV := son_app_id
+   }
+
+   /* 3GPP TS 48.018 11.3.62a.2 */
+   template (value) RAN_Information_RIM_Container
+   ts_RAN_Information_RIM_Container(template (value) 
RIM_Application_Identity app_id,
+template (value) RIM_Sequence_Number 
seq,
+template (value) RIM_PDU_Indications 
ind,
+template (omit) 
RIM_Protocol_Version_Number ver := omit,
+template (omit) 
ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit,
+template (omit) 
SON_Transfer_Application_Identity_TLV son_app_id := omit) := {
+
+iEI := '58'O,
+ext := '1'B,
+lengthIndicator := {
+   length1 := 0 /* overwritten */
+},
+rIM_Application_Identity := app_id,
+rIM_Sequence_Number := seq,
+rIM_PDU_Indications := ind,
+rIM_Protocol_Version_Number := ver,
+applContainer_or_ApplErrContainer := app_cont_or_app_err,
+sON_Transfer_Application_Identity := son_app_id
+   }
+   template (value) ApplContainer_or_ApplErrContainer
+   tsu_ApplContainer_or_ApplErrContainer_NACC(template (value) 
ApplContainer_or_ApplErrContainer_NACC cont) := {
+   nacc := cont
+   }
+   template (value) ApplContainer_or_ApplErrContainer
+   tsu_ApplContainer_or_ApplErrContainer_SI3(template (value) 
ApplContainer_or_ApplErrContainer_SI3 cont) := {
+   si3 := cont
+   }
+   template (value) ApplContainer_or_ApplErrContainer
+   tsu_ApplContainer_or_ApplErrContainer_MBMS_data_channel(template 
(value) ApplContainer_or_ApplErrContainer_MBMS_data_channel cont) := {
+   mBMS_data_channel := cont
+   }
+   template (value) ApplContainer_or_ApplErrContainer_NACC
+   

Change in osmo-ttcn3-hacks[master]: WIP FLUSH_LL

2020-11-24 Thread daniel
daniel has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21265 )

Change subject: WIP FLUSH_LL
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21265
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iea2d6ec81d2627f6e41d6c360210f52f7e21d07c
Gerrit-Change-Number: 21265
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: LOCAL HACKS

2020-11-23 Thread laforge
laforge has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21307 )

Change subject: WIP: LOCAL HACKS
..


Abandoned

accidential push
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21307
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I74f5631ce5f5c06b3eb0ad2d23db37365cd37c78
Gerrit-Change-Number: 21307
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: LOCAL HACKS

2020-11-23 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21307 )


Change subject: WIP: LOCAL HACKS
..

WIP: LOCAL HACKS

Change-Id: I74f5631ce5f5c06b3eb0ad2d23db37365cd37c78
---
M fr-net/FRNET_Tests.cfg
M fr/FR_Tests.cfg
M gbproxy/osmo-gbproxy.cfg
M library/BSSGP_Emulation.ttcnpp
M library/Osmocom_Gb_Types.ttcn
5 files changed, 179 insertions(+), 9 deletions(-)



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

diff --git a/fr-net/FRNET_Tests.cfg b/fr-net/FRNET_Tests.cfg
index dedd828..a90914b 100644
--- a/fr-net/FRNET_Tests.cfg
+++ b/fr-net/FRNET_Tests.cfg
@@ -7,6 +7,90 @@
 [LOGGING]

 [MODULE_PARAMETERS]
+FRNET_Tests.mp_num_bvc := 50;
+FRNET_Tests.mp_nsconfig := {
+   {
+   nsei := 1,
+   role_sgsn := true,
+   handle_sns := false,
+   nsvc := {
+   {
+   provider := {
+   fr := {
+   netdev := "hdlcnet1",
+   dlci := 16
+   }
+   },
+   nsvci := 1
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet2",
+   dlci := 17
+   }
+   },
+   nsvci := 2
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet3",
+   dlci := 18
+   }
+   },
+   nsvci := 3
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet4",
+   dlci := 19
+   }
+   },
+   nsvci := 4
+   }
+   }
+   }, {
+   nsei := 2,
+   role_sgsn := true,
+   handle_sns := false,
+   nsvc := {
+   {
+   provider := {
+   fr := {
+   netdev := "hdlcnet5",
+   dlci := 24
+   }
+   },
+   nsvci := 9
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet6",
+   dlci := 25
+   }
+   },
+   nsvci := 10
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet7",
+   dlci := 26
+   }
+   },
+   nsvci := 11
+   }, {
+   provider := {
+   fr := {
+   netdev := "hdlcnet8",
+   dlci := 27
+   }
+   },
+   nsvci := 12
+   }
+   }
+   }
+};
+
+

 [TESTPORT_PARAMETERS]

diff --git a/fr/FR_Tests.cfg b/fr/FR_Tests.cfg
index 9a97c3a..e9d0701 100644
--- a/fr/FR_Tests.cfg
+++ b/fr/FR_Tests.cfg
@@ -7,6 +7,89 @@
 [LOGGING]

 [MODULE_PARAMETERS]
+FR_Tests.mp_num_bvc := 20;
+FR_Tests.mp_num_ue_in_bvc := 5;
+FR_Tests.mp_nsconfig := {
+   {
+   nsei := 1,
+   role_sgsn := false,
+   handle_sns := false,
+   nsvc := {
+   {
+   provider := {
+   fr := {
+   netdev := "hdlc1",
+   dlci := 16
+   }
+   },
+   nsvci := 1
+   }, {
+   

Change in osmo-ttcn3-hacks[master]: WIP FLUSH_LL

2020-11-20 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21265 )


Change subject: WIP FLUSH_LL
..

WIP FLUSH_LL

Change-Id: Iea2d6ec81d2627f6e41d6c360210f52f7e21d07c
---
M gbproxy/GBProxy_Tests.ttcn
M library/Osmocom_Gb_Types.ttcn
2 files changed, 86 insertions(+), 0 deletions(-)



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

diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index bf777cc..63427df 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -861,6 +861,31 @@
f_cleanup();
 }

+private function f_TC_flush_ll(charstring id) runs on BSSGP_ConnHdlr {
+   var BssgpBvci bvci := g_pars.pcu[0].cfg.bvc[0].bvci;
+   var integer i;
+   for (i := 0; i < 10; i := i+1) {
+   /* TODO: Test ACK, correctly set old and new bvci and nsei
+* Actually move the tlli to a different BVC and check that the 
tlli is now moved to the new BVC (e.g. through paging) */
+   var template (value) PDU_BSSGP pdu_tx := 
ts_BSSGP_FLUSH_LL(g_pars.tlli, bvci, omit, omit);
+   /* we cannot use pdu_tx as there are some subtle differences in 
the length field :/ */
+   var template (present) PDU_BSSGP pdu_rx := 
tr_BSSGP_FLUSH_LL(g_pars.tlli, bvci, omit, omit);
+
+   f_sgsn2pcu(pdu_tx, pdu_rx);
+   }
+   setverdict(pass);
+}
+testcase TC_flush_ll() runs on test_CT
+{
+   var BSSGP_ConnHdlr vc_conn;
+   f_init();
+
+   vc_conn := f_start_handler(refers(f_TC_flush_ll), testcasename(), 
g_pcu, g_sgsn, 6);
+   vc_conn.done;
+   /* TODO: start multiple handlers (UEs) on various cells on same and 
other NSEs */
+
+   f_cleanup();
+}

 control {
execute( TC_BVC_bringup() );
@@ -871,6 +896,7 @@
execute( TC_radio_status() );
execute( TC_suspend() );
execute( TC_resume() );
+   execute( TC_flush_ll() );
 }


diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index 2c82437..d55124f 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -777,6 +777,24 @@
unstructured_value := f_oct_or_wc(bvci, 2)
}

+   template (value) NSEI_BSSGP ts_BSSGP_NSEI(template (value) Nsei nsei) 
:= {
+   iEI:= '3E'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 2
+   },
+   nSEI := f_oct_or_wc(nsei, 2)
+   }
+
+   template NSEI_BSSGP tr_BSSGP_NSEI(template Nsei nsei) := {
+   iEI:= '3E'O,
+   ext := '1'B,
+   lengthIndicator := {
+   length1 := 2
+   },
+   nSEI := f_oct_or_wc(nsei, 2)
+   }
+
template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli 
tlli) := {
iEI := '1F'O,
ext := '1'B,
@@ -1683,6 +1701,48 @@
}
}

+   /* 10.4.1 */
+   template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL(GprsTlli tlli, template 
(value) BssgpBvci bvci_old,
+template (omit) BssgpBvci 
bvci_new,
+template (omit) Nsei nsei) 
:= {
+   pDU_BSSGP_FLUSH_LL := {
+   bssgpPduType := '2B'O,
+   tLLI := ts_BSSGP_TLLI(tlli),
+   bVCI_old := t_BSSGP_BVCI(bvci_old),
+   bVCI_new := omit,
+   nSEI := omit
+   }
+   }
+   template PDU_BSSGP tr_BSSGP_FLUSH_LL(template GprsTlli tlli, template 
BssgpBvci bvci_old,
+template (omit) BssgpBvci bvci_new,
+template (omit) Nsei nsei) := {
+   pDU_BSSGP_FLUSH_LL := {
+   bssgpPduType := '2B'O,
+   tLLI := tr_BSSGP_TLLI(tlli),
+   bVCI_old := t_BSSGP_BVCI(bvci_old),
+   bVCI_new := t_BSSGP_BVCI(bvci_new),
+   nSEI := ?
+   }
+   }
+
+   /* 10.4.2 */
+/* template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL_ACK(GprsTlli tlli, 
RoutingAreaIdentification ra_id)
+   := {
+   pDU_BSSGP_FLUSH_LL_ACK := {
+   bssgpPduType := '0F'O,
+   tLLI := ts_BSSGP_TLLI(tlli),
+   routeing_Area := ts_BSSGP_RA_ID(ra_id)
+   }
+   }
+   template PDU_BSSGP tr_BSSGP_FLUSH_LL_ACK(template GprsTlli tlli,
+   RoutingAreaIdentification 
ra_id) := {
+   pDU_BSSGP_FLUSH_LL_ACK := {
+   bssgpPduType := '0F'O,
+   tLLI := tr_BSSGP_TLLI(tlli),
+   routeing_Area 

Change in osmo-ttcn3-hacks[master]: WIP: pcu: Introduce test TC_mcs_initial_ul

2020-11-10 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21095 )


Change subject: WIP: pcu: Introduce test TC_mcs_initial_ul
..

WIP: pcu: Introduce test TC_mcs_initial_ul

Change-Id: I0ee2fce7045628caf8145468b29688a9f230e7cd
---
M pcu/PCU_Tests.ttcn
1 file changed, 90 insertions(+), 0 deletions(-)



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

diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 5be63b2..ef04021 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -962,6 +962,95 @@
f_dl_data_exp_cs(f_rlcmac_block_int2cs_mcs(g_cs_max_dl, false));
 }

+/* Test the max UL MCS set by VTY works fine */
+testcase TC_mcs_initial_ul() runs on RAW_PCU_Test_CT {
+   var RlcmacDlBlock dl_block;
+   var PollFnCtx pollctx;
+   var EgprsChCodingCommand last_ch_coding;
+   var uint32_t unused_fn, sched_fn;
+   var GprsMS ms;
+   var CodingScheme exp_ul_mcs;
+   var MultislotCap_GPRS mscap_gprs := {
+   gprsmultislotclass := '00011'B,
+   gprsextendeddynalloccap := '0'B
+   };
+   var MultislotCap_EGPRS mscap_egprs := {
+   egprsmultislotclass := '00011'B,
+   egprsextendeddynalloccap := '0'B
+   };
+   var MSRadioAccessCapabilityV ms_racap := { valueof(ts_RaCapRec('0001'B 
/* E-GSM */, mscap_gprs, mscap_egprs)) };
+
+   /* Initialize GPRS MS side */
+   f_init_gprs_ms();
+   ms := g_ms[0]; /* We only use first MS in this test */
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename());
+
+   /* Set initial UL MCS to 3 */
+   g_mcs_initial_ul := 3;
+   exp_ul_mcs := f_rlcmac_block_int2cs_mcs(g_mcs_initial_ul, true);
+   f_pcuvty_set_allowed_cs_mcs();
+   f_pcuvty_set_link_quality_ranges();
+
+   /* Take lqual (dB->cB) so that we stay in that MCS */
+   ms.lqual_cb := g_mcs_lqual_ranges[2].low * 10;
+
+   /* Send PACKET RESOURCE REQUEST to upgrade to EGPRS */
+   pollctx := f_ms_establish_ul_tbf_2phase_access(ms, 
ts_RlcMacUlCtrl_PKT_RES_REQ(ms.tlli, ms_racap));
+
+   if (not match(ms.ul_tbf.tx_cs_mcs, exp_ul_mcs)) {
+   setverdict(fail, "Wrong CS_MCS ", ms.ul_tbf.tx_cs_mcs, " 
received vs exp ", exp_ul_mcs);
+   f_shutdown(__BFILE__, __LINE__);
+   }
+
+   /* Send one UL block (without TLLI since we are in Second-Phase Access)
+  and make sure it is ACKED fine */
+   //f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true);
+
+   /* Pkt Uplink Assignment above sets poll+rrbp requesting PACKET CONTROL 
ACK */
+   f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), pollctx.fn, nr := 
pollctx.tstrxbts);
+
+   /* Send UL blocks, until we receive UL ACK/NACK and check we are in 
same initial CS: */
+   while (true) {
+   f_ms_tx_ul_data_block(ms, f_rnd_octstring(10), cv := 15);
+   f_rx_rlcmac_dl_block(dl_block, unused_fn);
+   if (match(dl_block, tr_RLCMAC_DUMMY_CTRL())) {
+   continue;
+   }
+
+   if (not match(dl_block, tr_RLCMAC_UL_ACK_NACK_EGPRS(ul_tfi := 
?))) {
+   setverdict(fail, "Failed to match Packet Uplink ACK / 
NACK:", dl_block);
+   f_shutdown(__BFILE__, __LINE__);
+   break;
+   }
+
+   last_ch_coding := 
dl_block.ctrl.payload.u.ul_ack_nack.egprs.ch_coding_cmd;
+   break;
+   }
+   if (f_rlcmac_block_EgprsChCodingCommand2cs_mcs(last_ch_coding) != 
exp_ul_mcs) {
+   setverdict(fail, "Channel Coding does not match our 
expectations ", exp_ul_mcs, ": ", last_ch_coding);
+   f_shutdown(__BFILE__, __LINE__);
+   }
+
+   /* Remaining UL blocks are used to make sure regardless of initial
+   /* lqual, we can go lower at any time */
+/* 0 dB, make sure we downgrade MCS */
+   ms.lqual_cb := 0;
+   /* 5 UL blocks, check we are in same initial MCS: */
+   f_ms_tx_ul_data_block_multi(ms, 5);
+   /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+   f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, unused_fn);
+   last_ch_coding := 
dl_block.ctrl.payload.u.ul_ack_nack.egprs.ch_coding_cmd;
+
+   if (last_ch_coding != CH_CODING_MCS1) {
+   setverdict(fail, "Channel Coding does not match our 
expectations (MCS-1): ", last_ch_coding);
+   f_shutdown(__BFILE__, __LINE__);
+   }
+
+   f_shutdown(__BFILE__, __LINE__, final := true);
+}
+
 /* Verify PCU drops TBF after some time of inactivity. */
 testcase TC_t3169() runs on RAW_PCU_Test_CT {
var PCUIF_info_ind info_ind;
@@ -3031,6 +3120,7 @@
execute( TC_cs_initial_dl() );
execute( TC_cs_max_dl() );
execute( TC_dl_cs1_to_cs4() );
+   execute( 

Change in osmo-ttcn3-hacks[master]: WIP: bts-lapdm: Introduce test TC_normal_reestablishment

2020-10-19 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20793 )


Change subject: WIP: bts-lapdm: Introduce test TC_normal_reestablishment
..

WIP: bts-lapdm: Introduce test TC_normal_reestablishment

Change-Id: I5eb07a6abf5a260e2f62c177f8c100305d44155a
---
M bts/BTS_Tests_LAPDm.ttcn
M library/LAPDm_Types.ttcn
2 files changed, 45 insertions(+), 1 deletion(-)



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

diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn
index d16aa11..1a762d0 100644
--- a/bts/BTS_Tests_LAPDm.ttcn
+++ b/bts/BTS_Tests_LAPDm.ttcn
@@ -1330,6 +1330,50 @@
f_testmatrix_each_chan(pars, refers(f_TC_sabm_incorrect_c));
 }

+/* Test procedure for normal reestablishment, as per:
+ * OS#4819
+ * 3GPP TS 44.006 8.4.1.2 "Normal establishment procedure"
+ * 3GPP TS 44.006 8.4.2.1 "General requirements"
+ * 3GPP TS 44.006 8.6.3 "Procedures for re-establishment"
+ * */
+private function f_TC_normal_reestablishment(charstring id) runs on ConnHdlr {
+   var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0))
+   var octetstring l3_mo := f_rnd_octstring(c_TS0406_MAX_L3_OCTETS);
+   var default d;
+   timer T := 3.0;
+   var boolean use_sacch := false;
+
+   fp_common_init();
+
+   /* some common altstep for meas res and other background noise */
+   d := activate(as_ignore_background(true));
+   RSL.clear;
+   LAPDM.clear;
+
+   f_establish_mo(link_id);
+
+   deactivate(d);
+
+   var LapdmDlState dls := valueof(t_init_LapdmDlState);
+   f_lapdm_transceive_mo(dls, link_id, l3_mo);
+
+   LAPDM.send(t_PH_DATA(link_id.sapi, use_sacch, 
ts_LAPDm_SABM(link_id.sapi, c_r:=cr_MO_CMD, p:=true, l3:=''O)));
+   T.start
+   alt {
+   [] LAPDM.receive(t_PH_DATA(?, use_sacch, 
tr_LAPDm_UA(link_id.sapi, cr_MT_RSP, f:=false, l3:=''O))) { }
+   [] RSL.receive { repeat; }
+   [] LAPDM.receive { repeat; }
+   [] T.timeout { }
+   }
+   LAPDM.send(t_PH_DATA(link_id.sapi, use_sacch, ts_LAPDm_RR(link_id.sapi, 
c_r:=cr_MT_CMD, p:=false, nr:=0)));
+
+   fp_common_fini();
+}
+testcase TC_normal_reestablishment() runs on test_CT {
+   var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), 
ts_RSL_ChanMode_SIGN));
+   f_testmatrix_each_chan(pars, refers(f_TC_normal_reestablishment));
+}
+
 control {
execute(TC_sabm_ua_dcch_sapi0());
execute(TC_sabm_ua_dcch_sapi0_nopayload());
diff --git a/library/LAPDm_Types.ttcn b/library/LAPDm_Types.ttcn
index caccc12..5ef953d 100644
--- a/library/LAPDm_Types.ttcn
+++ b/library/LAPDm_Types.ttcn
@@ -166,7 +166,7 @@
external function dec_LapdmCtrlU(in octetstring stream) return 
LapdmCtrlU
with { extension "prototype(convert) decode(RAW)" };

-   /* Formats B, Bter and B4 are used on DCCHs for frames containing an 
information field:
+   /* Formats B, Bter and B4 are used on DCCHs for frames containing an 
information field:
/* - format Bter is used on request of higher layers if and only if 
short L2 header type 1 is
 *   supported and a UI command is to be transmitted on SAPI 0 */
/* - format B4 is used for UI frames transmitted by the network on 
SACCH; */

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20793
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5eb07a6abf5a260e2f62c177f8c100305d44155a
Gerrit-Change-Number: 20793
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: sip: Set & validate IP addresses and ports

2020-09-11 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20065 )

Change subject: WIP: sip: Set & validate IP addresses and ports
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20065
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie382f31b8b414daf598220c2e1b325b821129a40
Gerrit-Change-Number: 20065
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 11 Sep 2020 12:59:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: sip: Set & validate IP addresses and ports

2020-09-10 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20065 )


Change subject: WIP: sip: Set & validate IP addresses and ports
..

WIP: sip: Set & validate IP addresses and ports

Change-Id: Ie382f31b8b414daf598220c2e1b325b821129a40
---
M sip/SIP_Tests.ttcn
1 file changed, 98 insertions(+), 14 deletions(-)



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

diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn
index 9de2723..534801e 100644
--- a/sip/SIP_Tests.ttcn
+++ b/sip/SIP_Tests.ttcn
@@ -12,6 +12,8 @@

 import from General_Types all;
 import from Osmocom_Types all;
+import from Native_Functions all;
+import from Misc_Helpers all;

 import from Osmocom_CTRL_Functions all;
 import from Osmocom_CTRL_Types all;
@@ -59,8 +61,12 @@
charstring called,

uint32_t mncc_call_id optional,
+   CallParsComputed comp optional,

-   CallParsComputed comp optional
+   charstring sip_rtp_addr,
+   uint16_t sip_rtp_port,
+   charstring cn_rtp_addr,
+   uint16_t cn_rtp_port
 }

 type record CallParsComputed {
@@ -75,8 +81,13 @@
is_mo := is_mo,
calling := "12345",
called := "98766",
+
mncc_call_id := omit,
-   comp := omit
+   comp := omit,
+   sip_rtp_addr := "1.2.3.4",
+   sip_rtp_port := 1234,
+   cn_rtp_addr := "5.6.7.8",
+   cn_rtp_port := 5678
 }

 private function f_CallPars_compute(inout CallPars cp) {
@@ -93,6 +104,22 @@
cp.comp.sip_body := "";
 }

+private function f_mgcp_addr2addrtype(charstring addr) return charstring {
+   for (var integer i := 0; i < lengthof(addr); i := i + 1) {
+   if (addr[i] == ":") {
+   return "IP6";
+   }
+   }
+   return "IP4";
+}
+
+private function f_addrstr2addr(charstring addr) return octetstring {
+   if (f_addr_is_ipv6(addr)) {
+   return f_inet6_addr(addr);
+   } else {
+   return f_inet_addr(addr);
+   }
+}

 function f_init_mncc(charstring id) runs on test_CT {
id := id & "-MNCC";
@@ -166,6 +193,7 @@
var template SipAddr sip_addr_gsm := 
tr_SipAddr_from_val(cp.comp.sip_url_gsm);
var template SipAddr sip_addr_ext := 
tr_SipAddr_from_val(cp.comp.sip_url_ext);
var PDU_SIP_Request sip_req;
+   var PDU_SIP_Response sip_resp;
var MNCC_PDU mncc;

/* Ask MNCC_Emulation to "expect" a call to the given called number */
@@ -186,7 +214,11 @@
MNCC.send(ts_MNCC_CALL_CONF_ind(cp.mncc_call_id));
/* MSC <- OSC: OSC asks MSC to create RTP socket */
MNCC.receive(tr_MNCC_RTP_CREATE(cp.mncc_call_id));
-   MNCC.send(ts_MNCC_RTP_CREATE(cp.mncc_call_id));
+   mncc := valueof(ts_MNCC_RTP_CREATE(cp.mncc_call_id));
+   mncc.u.rtp.is_ipv6 := f_addr_is_ipv6(cp.cn_rtp_addr);
+   mncc.u.rtp.ip := f_addrstr2addr(cp.cn_rtp_addr);
+   mncc.u.rtp.rtp_port := cp.cn_rtp_port;
+   MNCC.send(mncc);

/* MSC -> OSC: After MS is ringing and sent CC ALERTING */
MNCC.send(ts_MNCC_ALERT_ind(cp.mncc_call_id));
@@ -200,10 +232,15 @@
SIP.clear;
interleave {
/* MSC <- OSC: OSC asks MSC to connect its RTP stream to remote end */
-   [] MNCC.receive(tr_MNCC_RTP_CONNECT(cp.mncc_call_id)) {}
+   [] MNCC.receive(tr_MNCC_RTP_CONNECT(cp.mncc_call_id, 
f_addrstr2addr(cp.sip_rtp_addr), cp.sip_rtp_port)) {}
/* OSC -> SIP: OSC confirms call establishment to SIP side */
[] SIP.receive(tr_SIP_Response(cp.comp.sip_call_id, sip_addr_ext, 
sip_addr_gsm, ?,
-   "INVITE", 200, ?, "OK", ?)) {}
+   "INVITE", 200, ?, "OK", ?)) -> value 
sip_resp {
+   if (not 
match(sip_resp.messageBody, pattern "*" & cp.cn_rtp_addr & "*")) {
+   setverdict(fail, "wrong 
ip addr sent in SIP SDP, not containing ", cp.cn_rtp_addr);
+   mtc.stop;
+   }
+   }
}
/* OSC <- SIP: SIP world acknowledges "200 OK" */
SIP.send(ts_SIP_ACK(cp.comp.sip_call_id, cp.comp.sip_url_ext, 
cp.comp.sip_url_gsm,
@@ -229,7 +266,10 @@
MNCC.receive(tr_MNCC_RTP_CREATE(cp.mncc_call_id)) {
var MNCC_PDU mncc := 
valueof(ts_MNCC_RTP_CREATE(cp.mncc_call_id));
mncc.u.rtp.payload_msg_type := oct2int('0300'O);
-   MNCC.send(mncc);/* FIXME: port/ip */
+   mncc.u.rtp.is_ipv6 := f_addr_is_ipv6(cp.cn_rtp_addr);
+   mncc.u.rtp.ip := f_addrstr2addr(cp.cn_rtp_addr);
+   mncc.u.rtp.rtp_port := cp.cn_rtp_port;
+   MNCC.send(mncc);
}
/* OSC -> SIP: Send INVITE 

Change in osmo-ttcn3-hacks[master]: WIP: mncc: Support IPv6 addresses (new version mncc 7)

2020-09-10 Thread pespin
Hello fixeria, laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056

to look at the new patch set (#2).

Change subject: WIP: mncc: Support IPv6 addresses (new version mncc 7)
..

WIP: mncc: Support IPv6 addresses (new version mncc 7)

Apparently commit 06b859ca314f53a902329ed95848dbafef1d4f87 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
---
M library/MNCC_Emulation.ttcn
M library/MNCC_EncDec.cc
M library/MNCC_Types.ttcn
M library/mncc.h
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M sip/SIP_Tests.default
7 files changed, 85 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/56/20056/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
Gerrit-Change-Number: 20056
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: mncc: Support IPv6 addresses (new version mncc 7)

2020-09-09 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056 )

Change subject: WIP: mncc: Support IPv6 addresses (new version mncc 7)
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056/1/library/MNCC_EncDec.cc
File library/MNCC_EncDec.cc:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056/1/library/MNCC_EncDec.cc@195
PS1, Line 195:  memcpy(((struct 
sockaddr_in6*))->sin6_addr, in.u().rtp().ip().data(),
I still need to figure out how to get a memory buffer point out of an 
octetstring here, from ip().


https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056/1/library/MNCC_Types.ttcn
File library/MNCC_Types.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056/1/library/MNCC_Types.ttcn@377
PS1, Line 377:  octetstring ip, //TODO: define size of octetstring based on 
is_ipv6 using CROSSTAGS?
something like: if is_ipv6 LERNGTHOF(ip = 16), if not is_ipv6 LENGTHOF(ip = 4).



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
Gerrit-Change-Number: 20056
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 09 Sep 2020 19:00:27 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: mncc: Support IPv6 addresses (new version mncc 7)

2020-09-09 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20056 )


Change subject: WIP: mncc: Support IPv6 addresses (new version mncc 7)
..

WIP: mncc: Support IPv6 addresses (new version mncc 7)

Apparently commit 06b859ca314f53a902329ed95848dbafef1d4f87 forgot to
bump the MNCC_SOCK_VERSION field from 5  to 6 in

TODO: check what about MNCC_Emulation.mp_mncc_version

TODO: Add IPv6 tests for sip/SIP_Tests

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
---
M library/MNCC_Emulation.ttcn
M library/MNCC_EncDec.cc
M library/MNCC_Types.ttcn
M library/mncc.h
4 files changed, 47 insertions(+), 14 deletions(-)



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

diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn
index be087ec..13a842b 100644
--- a/library/MNCC_Emulation.ttcn
+++ b/library/MNCC_Emulation.ttcn
@@ -38,7 +38,7 @@
 import from UD_Types all;

 modulepar {
-   int mp_mncc_version := 6;
+   int mp_mncc_version := 7;
 }

 /* General "base class" component definition, of which specific implementations
diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index f2692d7..d9529ee 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -188,8 +188,20 @@
memset(, 0, sizeof(rtp));
rtp.msg_type = in.msg__type();
rtp.callref = in.u().rtp().callref();
-   rtp.ip = in.u().rtp().ip();
-   rtp.port = in.u().rtp().rtp__port();
+   if (in.u().rtp().is__ipv6()) {
+   rtp.addr.ss_family = AF_INET6;
+   ((struct sockaddr_in6*))->sin6_port = 
in.u().rtp().rtp__port();
+   //TODO: verify octetstring len
+   memcpy(((struct sockaddr_in6*))->sin6_addr, 
in.u().rtp().ip().data(),
+  sizeof(struct in6_addr));
+   } else {
+   rtp.addr.ss_family = AF_INET;
+   ((struct sockaddr_in*))->sin_port = 
in.u().rtp().rtp__port();
+   //TODO: verify octetstring len
+   memcpy(((struct sockaddr_in*))->sin_addr, 
in.u().rtp().ip().data(),
+  sizeof(struct in_addr));
+   //rtp.ip = in.u().rtp().ip();
+   }
rtp.payload_type = in.u().rtp().payload__type();
rtp.payload_msg_type = in.u().rtp().payload__msg__type();
ret_val = OCTETSTRING(sizeof(rtp), (uint8_t *) );
@@ -224,6 +236,9 @@
const struct gsm_mncc_rtp *in_rtp;
MNCC__PDU__Rtp rtp;
MNCC__MsgUnion u;
+   bool is_ipv6;
+   OCTETSTRING ip;
+   uint16_t port;

in_mncc = (struct gsm_mncc *) ttcn_buffer.get_read_data();

@@ -258,7 +273,20 @@
case MNCC_RTP_CONNECT:
case MNCC_RTP_FREE:
in_rtp = (const struct gsm_mncc_rtp *) in_mncc;
-   rtp = MNCC__PDU__Rtp(in_rtp->callref, in_rtp->ip, in_rtp->port, 
in_rtp->payload_type,
+   switch (in_rtp->addr.ss_family) {
+   case AF_INET:
+   is_ipv6 = false;
+   port = ((struct sockaddr_in*)_rtp->addr)->sin_port;
+   ip = OCTETSTRING(sizeof(struct in_addr), &(struct 
sockaddr_in*)_rtp->addr)->sin_addr);
+   break;
+   case AF_INET6:
+   is_ipv6 = true;
+   port = ((struct sockaddr_in6*)_rtp->addr)->sin6_port;
+   ip = OCTETSTRING(sizeof(struct in6_addr), &(struct 
sockaddr_in6*)_rtp->addr)->sin6_addr);
+
+   break;
+   }
+   rtp = MNCC__PDU__Rtp(in_rtp->callref, is_ipv6, ip, port, 
in_rtp->payload_type,
 in_rtp->payload_msg_type, in_rtp->sdp);
u.rtp() = rtp;
break;
diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 0a8e7d9..fa4fc3e 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -373,7 +373,8 @@

 type record MNCC_PDU_Rtp {
uint32_tcallref,
-   uint32_tip,
+   boolean is_ipv6,
+   octetstring ip, //TODO: define size of octetstring based on is_ipv6 
using CROSSTAGS?
uint16_trtp_port,
uint32_tpayload_type,
uint32_tpayload_msg_type,
@@ -1921,7 +1922,8 @@
u := {
rtp := {
callref := call_id,
-   ip := 0,
+   is_ipv6 := false,
+   ip := ''O,
rtp_port := 0,
payload_type := 0,
payload_msg_type := 0,
@@ -1935,13 +1937,14 @@

 /* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side 
IP/Port) */
 

Change in osmo-ttcn3-hacks[master]: WIP: bts/BTS_Tests: add sample test case using frequency hopping

2020-08-11 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18531 )

Change subject: WIP: bts/BTS_Tests: add sample test case using frequency hopping
..


Abandoned

This was just for the demo purposes.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18531
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6f0e8c78710f8b31689217ef31d7b4c1646bdf28
Gerrit-Change-Number: 18531
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: PCU socket: test NSVC IPv4/IPv6

2020-07-28 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19421 )


Change subject: WIP: PCU socket: test NSVC IPv4/IPv6
..

WIP: PCU socket: test NSVC IPv4/IPv6

Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
---
M bts/BTS_Tests.ttcn
1 file changed, 38 insertions(+), 0 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1c8127b..9038924 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -35,6 +35,7 @@
 import from L1CTL_Types all;
 import from LAPDm_Types all;
 import from LAPDm_RAW_PT all;
+import from Native_Functions all;
 import from Osmocom_CTRL_Adapter all;
 import from Osmocom_CTRL_Functions all;

@@ -5434,6 +5435,41 @@
setverdict(pass);
 }

+testcase TC_pcu_socket_nsvc_ipv4() runs on test_CT {
+   f_init_vty_bsc();
+   f_vty_config2(BSCVTY, {"network", "bts 0"} , "gprs nsvc 0 remote ip 
127.127.127.127");
+   f_vty_transceive(BSCVTY, "drop bts connection 0 oml");
+
+   f_init();
+
+   if (g_pcu_last_info.u.info_ind.remote_protocol[0] != 
PCU_IF_ADRESS_IPV4) {
+   setverdict(fail, "Expected address family = IPV4");
+   }
+
+   if (substr(g_pcu_last_info.u.info_ind.remote_ip[0], 0, 4) != 
f_inet_addr("127.127.127.127")) {
+   setverdict(fail, "Invalid remote_ip!");
+   }
+
+   setverdict(pass);
+}
+
+testcase TC_pcu_socket_nsvc_ipv6() runs on test_CT {
+   f_init_vty_bsc();
+   f_vty_config2(BSCVTY, {"network", "bts 0"} , "gprs nsvc 0 remote ip 
fd00::ca:ff:ee");
+
+   f_init();
+
+   if (g_pcu_last_info.u.info_ind.remote_protocol[0] != 
PCU_IF_ADRESS_IPV6) {
+   setverdict(fail, "Expected address family = IPV6");
+   }
+
+   if (g_pcu_last_info.u.info_ind.remote_ip[0] != 
f_inet6_addr("fd00::ca:ff:ee")) {
+   setverdict(fail, "Invalid remote_ip!");
+   }
+
+   setverdict(pass);
+}
+
 /***
  * Osmocom Style Dynamic Timeslot Support
  ***/
@@ -6831,6 +6867,8 @@
execute( TC_pcu_socket_disconnect_nosi3gprs() );
execute( TC_pcu_socket_disconnect_nosi4gprs() );
execute( TC_pcu_socket_verify_info_ind() );
+   execute( TC_pcu_socket_nsvc_ipv4() );
+   execute( TC_pcu_socket_nsvc_ipv6() );
execute( TC_dyn_osmo_pdch_act_deact() );
execute( TC_dyn_osmo_pdch_double_act() );
execute( TC_dyn_ipa_pdch_act_deact() );

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Gerrit-Change-Number: 19421
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: update PCUIF_Types

2020-07-28 Thread lynxis lazus
lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19420 )


Change subject: WIP: update PCUIF_Types
..

WIP: update PCUIF_Types

Change-Id: I13b03c380edc2dc609c5e4053462a3cd6f78ce72
---
M library/PCUIF_Types.ttcn
1 file changed, 18 insertions(+), 4 deletions(-)



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

diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 089403c..674c6d4 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -20,7 +20,14 @@
 };

 const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts";
-type integer PCUIF_Version (9); /* supported versions */
+
+type integer PCUIF_Version (10); /* supported versions */
+
+type enumerated PCUIF_RemoteProtocol {
+   PCU_IF_ADRESS_UNSPEC('00'O),
+   PCU_IF_ADRESS_IPV4  ('04'O),
+   PCU_IF_ADRESS_IPV6  ('2a'O)
+} with { variant "FIELDLENGTH(8)" };

 type enumerated PCUIF_MsgType {
PCU_IF_MSG_DATA_REQ ('00'O),
@@ -186,8 +193,14 @@
record length(2) of uint16_tnsvci,
record length(2) of uint16_tlocal_pprt,
record length(2) of uint16_tremote_port,
-   record length(2) of OCT4remote_ip
-} with { variant "" }
+   record length(2) of PCUIF_RemoteProtocolremote_protocol,
+   record length(2) of octetstring remote_ip length(16)
+};
+
+type union PCUIF_RemoteIPu {
+   OCT4 ipv4,
+   octetstring ipv6 length(16)
+};

 type record PCUIF_act_req {
uint8_t is_activate,
@@ -258,7 +271,7 @@
time_ind,   msg_type = PCU_IF_MSG_TIME_IND;
pag_req,msg_type = PCU_IF_MSG_PAG_REQ;
app_info_req,   msg_type = 
PCU_IF_MSG_APP_INFO_REQ)"
-variant "PADDING(1696)" /* 212 * 8 */
+variant "PADDING(1904)" /* 238 * 8 */
 };

 external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring
@@ -741,6 +754,7 @@
nsvci := ?,
local_pprt := ?,
remote_port := ?,
+   remote_protocol := ?,
remote_ip := ?
}
}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I13b03c380edc2dc609c5e4053462a3cd6f78ce72
Gerrit-Change-Number: 19420
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: [WIP] fixup PCU_Tests: add TC_pcuif_fh_pkt_ass_ul

2020-07-22 Thread fixeria
fixeria has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19343 )

Change subject: [WIP] fixup PCU_Tests: add TC_pcuif_fh_pkt_ass_ul
..


Abandoned

Squashed.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19343
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic57f0a8eb029a19c33ac1355bb37181dd5c69d36
Gerrit-Change-Number: 19343
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: library/GSM_RestOctets: add SI2quater Rest Octets example for E-...

2020-07-03 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114 )

Change subject: WIP: library/GSM_RestOctets: add SI2quater Rest Octets example 
for E-UTRAN
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
Gerrit-Change-Number: 19114
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 03 Jul 2020 07:17:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: library/GSM_RestOctets: add SI2quater Rest Octets example for E-...

2020-07-02 Thread neels
neels has uploaded a new patch set (#2) to the change originally created by 
fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114 )

Change subject: WIP: library/GSM_RestOctets: add SI2quater Rest Octets example 
for E-UTRAN
..

WIP: library/GSM_RestOctets: add SI2quater Rest Octets example for E-UTRAN

Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
---
M library/GSM_RestOctets.ttcn
1 file changed, 56 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/14/19114/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
Gerrit-Change-Number: 19114
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: WIP: library/GSM_RestOctets: add SI3 Rest Octets example for E-UTRAN

2020-07-02 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114 )


Change subject: WIP: library/GSM_RestOctets: add SI3 Rest Octets example for 
E-UTRAN
..

WIP: library/GSM_RestOctets: add SI3 Rest Octets example for E-UTRAN

Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
---
M library/GSM_RestOctets.ttcn
1 file changed, 56 insertions(+), 0 deletions(-)



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

diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn
index 3bc9349..31c25f3 100644
--- a/library/GSM_RestOctets.ttcn
+++ b/library/GSM_RestOctets.ttcn
@@ -513,6 +513,62 @@
rel_additions := { rel5_presence := CSN1_L, rel5 := omit }
 };

+/* Example template for matching E-UTRAN Neighbour Cell list */
+template SI2quaterRestOctets tra_SI3RestOctets_EUTRAN(
+   template EUTRAN_NeighbourCells neigh_list := *,
+   template EUTRAN_MeasParamsDescOpt meas_params := *
+) modifies tra_SI2quaterRestOctets_base := {
+   si2quater_index := ?,
+   si2quater_count := ?,
+
+   /* FIXME: we need a separate template hierarchy to such a crazy avoid 
nesting */
+   rel_additions := {
+   rel5_presence := CSN1_H,
+   rel5 := {
+   umts_add_meas_params_desc := ?,
+   umts_add_meas_params_desc2 := ?,
+   rel6_presence := CSN1_H,
+   rel6 := {
+   umts_ccn_active := ?,
+   rel7_presence := CSN1_H,
+   rel7 := {
+   rep700 := ?,
+   rep810 := ?,
+   rel8_presence := CSN1_H,
+   rel8 := {
+   prio_eutran_params_desc := {
+   presence := '1'B,
+   desc := {
+   
sc_prio_params_desc := {
+   
presence := '1'B,
+   desc := 
{
+   
geran_priority := ?,
+   
thresh_priority_search := ?,
+   
thresh_gsm_low := ?,
+   
h_prio := ?,
+   
t_reselection := ?
+   }
+   },
+   
utran_prio_params_desc := ?,
+   
eutran_params_desc := {
+   
presence := '1'B,
+   desc := 
{
+   
meas_params_desc := meas_params,
+   
gprs_meas_params_desc := ?,
+   
neigh_cell_list := neigh_list
+   }
+   }
+   }
+   },
+   utran_csg_desc := ?,
+   eutran_csg_desc := ?
+   }
+   }
+   }
+   }
+   }
+};
+

 /* 10.5.2.34 SI 3 Rest Octets */
 type record SI3RestOctets {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19114
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
Gerrit-Change-Number: 19114
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: bts/BTS_Tests: add sample test case using frequency hopping

2020-05-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18531 )


Change subject: WIP: bts/BTS_Tests: add sample test case using frequency hopping
..

WIP: bts/BTS_Tests: add sample test case using frequency hopping

Change-Id: I6f0e8c78710f8b31689217ef31d7b4c1646bdf28
---
M bts/BTS_Tests.ttcn
1 file changed, 35 insertions(+), 0 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 603d2e2..188d3f0 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -6375,6 +6375,41 @@
 /* repetition of SABM or DISC N200 times without ACK */
 /* receptiom of SABM in multi-frame established state */

+function f_TC_fh_uplink_sacch(charstring id) runs on ConnHdlr {
+   var L1ctlDlMessage l1_dl;
+   var uint5_t ta_to_test := 16;
+
+   f_l1_tune(L1CTL);
+   RSL.clear;
+
+   f_est_dchan();
+   L1CTL.clear;
+
+   /* Expect 8 consequent SACCH blocks */
+   for (var integer i := 0; i < 8; i := i + 1) {
+   f_exp_sacch(true);
+   }
+
+   f_rsl_chan_deact();
+   f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr);
+
+   setverdict(pass);
+}
+
+testcase TC_fh_uplink_sacch() runs on test_CT {
+   var ConnHdlr vc_conn;
+   var ConnHdlrPars pars;
+
+   f_init();
+
+   pars := valueof(t_Pars(t_RslChanNr_SDCCH4(0, 0), ts_RSL_ChanMode_SIGN,
+   maio_hsn := { maio := 8, hsn := 0 }));
+   vc_conn := f_start_handler(refers(f_TC_fh_uplink_sacch), pars);
+   vc_conn.done;
+
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+

 /* TODO Areas:


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18531
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6f0e8c78710f8b31689217ef31d7b4c1646bdf28
Gerrit-Change-Number: 18531
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: Fix TC_egprs_pkt_chan_req* tests

2020-05-20 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18371 )

Change subject: WIP: Fix TC_egprs_pkt_chan_req* tests
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18371
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I690ede0667a574892dcd93b941003054182c8e39
Gerrit-Change-Number: 18371
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP: Fix TC_egprs_pkt_chan_req* tests

2020-05-19 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18371 )


Change subject: WIP: Fix TC_egprs_pkt_chan_req* tests
..

WIP: Fix TC_egprs_pkt_chan_req* tests

Somehow after refactoring these 3 tests became broken. I think it's
because before the refactoring, a bug was present in f_establish_tbf
which set it always to 127 no matter what was passed (which looks wrong
from these tests point of view).
So apparently I fixed a part of the infrastructure, and now tests fail
because other parts of the infrastructure (also old ones) do not support
this kind of scenarios.

Change-Id: I690ede0667a574892dcd93b941003054182c8e39
---
M pcu/GPRS_Components.ttcn
1 file changed, 9 insertions(+), 2 deletions(-)



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

diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index 8d47d44..f845c14 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -146,7 +146,8 @@
log("Rx Uplink TBF assignment: ", ul_tbf.ass);
setverdict(pass);
} else {
-   setverdict(fail, "Failed to match UL TBF Assignment");
+   setverdict(fail, "Failed to match UL TBF Assignment: ", 
rr_imm_ass,
+  " vs exp ", tr_IMM_TBF_ASS(dl := false, rest := 
tr_IaRestOctets_ULAss(?)));
f_shutdown(__BFILE__, __LINE__);
}

@@ -327,9 +328,15 @@
   fn := fn, arfcn := 871,
   qta := ms.ta * 4));

+   /* TODO: tr_IMM_TBF_ASS(false, ms.ra, fn) fails for 11bit, because
+*  tr_compute_ReqRef() doens't support 11bit:
+* GSM_RR_Types.ttcn:345
+* Dynamic test case error: The first argument of function int2bit(),
+* which is 1661, does not fit in 8 bits, needs at least 11. */
+
/* Expect Immediate (TBF) Assignment on TS0/AGCH */
rr_imm_ass := f_ms_rx_imm_ass_ccch(ms, PCU_IF_SAPI_AGCH,
-  tr_IMM_TBF_ASS(false, ms.ra, fn));
+  tr_IMM_TBF_ASS(false, ?, fn));

ms.ul_tbf := f_ultbf_new_from_rr_imm_ass(rr_imm_ass);
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18371
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I690ede0667a574892dcd93b941003054182c8e39
Gerrit-Change-Number: 18371
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: EGPRS

2020-05-01 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16677 )

Change subject: WIP: EGPRS
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16677
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3b36d20b5350c8011fd5b4cd2bb2eadd08b74823
Gerrit-Change-Number: 16677
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in osmo-ttcn3-hacks[master]: WIP

2020-01-21 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16975 )


Change subject: WIP
..

WIP

Change-Id: I2cc5e41e33aac300d33887caed1cc3fbdffcbb17
---
M sccp/SCCP_Tests_RAW.ttcn
1 file changed, 19 insertions(+), 1 deletion(-)



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

diff --git a/sccp/SCCP_Tests_RAW.ttcn b/sccp/SCCP_Tests_RAW.ttcn
index 5996846..052b399 100644
--- a/sccp/SCCP_Tests_RAW.ttcn
+++ b/sccp/SCCP_Tests_RAW.ttcn
@@ -171,11 +171,18 @@
setverdict(pass);
 }

-/* Verify sccp_demo_user answers a CR with a CC for PC and SSN set up to echo 
back */
+/* Verify sccp_demo_user answers a CR with a CC for PC and SSN set up to echo
+   back, but since no connection is requested, inactivty timers are not armed 
*/
 testcase TC_udt_without_cr_cc() runs on SCCP_Test_RAW_CT {
var SCCP_PAR_Address calling, called;
+   var SCCP_MTP3_TRANSFERind rx;
var octetstring data := f_rnd_octstring(f_rnd_int(100));

+   /* Set T(iar) in sccp_demo_user low enough that it will trigger before 
other side
+  has time to keep alive with a T(ias). Keep recommended ratio of
+  T(iar) >= T(ias)*2 */
+   g_demo_sccp_timer_ias := 2;
+   g_demo_sccp_timer_iar := 5;
f_init_raw(mp_sccp_cfg[0]);
f_sleep(1.0);

@@ -185,6 +192,17 @@
 mp_sccp_cfg[0].sio, 
mp_sccp_cfg[0].sccp_service_type));

f_tx_udt_exp(calling, called, data);
+
+   /* Make sure no SCCP message is received at all, since no connection is 
active. */
+   timer T := int2float(g_demo_sccp_timer_iar + 1);
+   T.start;
+   alt {
+   [] MTP3.receive {
+   setverdict(fail, "Unexpected MTP/SCCP received");
+   self.stop;
+   }
+   [] T.timeout {}
+   }
setverdict(pass);
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16975
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2cc5e41e33aac300d33887caed1cc3fbdffcbb17
Gerrit-Change-Number: 16975
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP

2020-01-21 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16970 )


Change subject: WIP
..

WIP

Change-Id: I2b52cc637c20d5644f413030edd9040a6e6bfe2f
---
M sccp/SCCP_Tests_RAW.ttcn
1 file changed, 21 insertions(+), 8 deletions(-)



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

diff --git a/sccp/SCCP_Tests_RAW.ttcn b/sccp/SCCP_Tests_RAW.ttcn
index 6acb4c7..cd0708c 100644
--- a/sccp/SCCP_Tests_RAW.ttcn
+++ b/sccp/SCCP_Tests_RAW.ttcn
@@ -39,6 +39,8 @@

var MSC_SCCP_MTP3_parameters g_param;

+   var OCT3 g_own_lref := '01'O
+
/*Configure T(tias) over VTY, seconds */
var integer g_demo_sccp_timer_ias :=  7 * 60;
/*Configure T(tiar) over VTY, seconds */
@@ -109,7 +111,9 @@
MTP3.send(tx);
 }

-private function f_exp_sccp(template PDU_SCCP sccp) runs on SCCP_Test_RAW_CT {
+private function f_exp_sccp(template PDU_SCCP sccp)
+runs on SCCP_Test_RAW_CT return SCCP_MTP3_TRANSFERind {
+
var SCCP_MTP3_TRANSFERind rx;
var template SCCP_MTP3_TRANSFERind exp := {
sio := g_param.sio,
@@ -122,7 +126,7 @@
T.start;
alt {
[] MTP3.receive(exp) -> value rx {
-   setverdict(pass);
+   return rx;
}
[] MTP3.receive {
setverdict(fail, "Unexpected MTP/SCCP received");
@@ -133,12 +137,17 @@
self.stop
}
}
+   return rx;
 }

-private function f_establish_conn(SCCP_PAR_Address calling, SCCP_PAR_Address 
called) runs on SCCP_Test_RAW_CT {
+private function f_establish_conn(SCCP_PAR_Address calling, SCCP_PAR_Address 
called)
+runs on SCCP_Test_RAW_CT return OCT3 {
+   var SCCP_MTP3_TRANSFERind mtp3_rx;

-   f_send_sccp(ts_SCCP_CR('01'O, calling, called));
-   f_exp_sccp(tr_SCCP_CC('00'O, '01'O));
+   f_send_sccp(ts_SCCP_CR(g_own_lref, calling, called));
+   mtp3_rx := f_exp_sccp(tr_SCCP_CC(?, g_own_lref));
+
+   return mtp3_rx.data.connconfirm.sourceLocRef;
 }

 private function f_tx_udt_exp(SCCP_PAR_Address calling, SCCP_PAR_Address 
called, octetstring data) runs on SCCP_Test_RAW_CT {
@@ -159,6 +168,7 @@
calling := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].own_pc, 
mp_sccp_cfg[0].own_ssn,
 mp_sccp_cfg[0].sio, 
mp_sccp_cfg[0].sccp_service_type));
f_establish_conn(calling, called);
+   setverdict(pass);
 }

 /* Verify sccp_demo_user answers a CR with a CC for PC and SSN set up to echo 
back */
@@ -175,11 +185,13 @@
 mp_sccp_cfg[0].sio, 
mp_sccp_cfg[0].sccp_service_type));

f_tx_udt_exp(calling, called, data);
+   setverdict(pass);
 }

 /* Verify T(iar) triggers and releases the channel */
 testcase TC_tiar_timeout() runs on SCCP_Test_RAW_CT {
var SCCP_PAR_Address calling, called;
+   var OCT3 remote_lref;
var octetstring data := f_rnd_octstring(f_rnd_int(100));

/* Set T(iar) in sccp_demo_user low enough that it will trigger before 
other side
@@ -194,7 +206,7 @@
 mp_sccp_cfg[0].sio, 
mp_sccp_cfg[0].sccp_service_type));
calling := valueof(ts_SccpAddr_PC_SSN(mp_sccp_cfg[0].own_pc, 
mp_sccp_cfg[0].own_ssn,
 mp_sccp_cfg[0].sio, 
mp_sccp_cfg[0].sccp_service_type));
-   f_establish_conn(calling, called);
+   remote_lref := f_establish_conn(calling, called);
f_tx_udt_exp(calling, called, data);

log("Waiting for first IT");
@@ -203,8 +215,9 @@
f_exp_sccp(tr_SCCP_IT(?, ?));

log("Waiting for RLSD");
-   f_exp_sccp(tr_SCCP_RLSD(?, ?, hex2int('0D'H))); /* Cause: Expiration of 
Rx Inactivity Timer */
-   f_send_sccp(ts_SCCP_RLC('01'O, '00'O));
+   f_exp_sccp(tr_SCCP_RLSD(remote_lref, g_own_lref, hex2int('0D'H))); /* 
Cause: Expiration of Rx Inactivity Timer */
+   f_send_sccp(ts_SCCP_RLC(g_own_lref, remote_lref));
+   setverdict(pass);
 }

 control {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16970
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2b52cc637c20d5644f413030edd9040a6e6bfe2f
Gerrit-Change-Number: 16970
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests

2020-01-12 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811 )

Change subject: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests
..

WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests

Change-Id: Ib6004d2b23c8207faac7f8b7bd07e84c404cd84d
---
A SCCP_Test/gen_links.sh
A SCCP_Test/regen_makefile.sh
2 files changed, 55 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/SCCP_Test/gen_links.sh b/SCCP_Test/gen_links.sh
new file mode 100755
index 000..c980844
--- /dev/null
+++ b/SCCP_Test/gen_links.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+BASEDIR=../deps
+
+. ../gen_links.sh.inc
+
+DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src
+FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn 
TCCConversion.cc TCCInterface.cc TCCInterface_ip.h SDP_EncDec.cc"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src
+FILES="Socket_API_Definitions.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.ProtocolModules.M3UA/src
+FILES="M3UA_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.TestPorts.SCTPasp/src
+FILES="SCTPasp_PT.cc  SCTPasp_PT.hh  SCTPasp_PortType.ttcn  SCTPasp_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by SCCP Emulation
+DIR=$BASEDIR/titan.ProtocolEmulations.M3UA/src
+FILES="M3UA_Emulation.ttcn"
+gen_links $DIR $FILES
+
+# required by SCCP Emulation
+DIR=$BASEDIR/titan.TestPorts.MTP3asp/src
+FILES="MTP3asp_PortType.ttcn  MTP3asp_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolEmulations.SCCP/src
+FILES="SCCP_Emulation.ttcn  SCCP_Mapping.ttcnpp  SCCP_Types.ttcn  
SCCPasp_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="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn 
Osmocom_VTY_Functions.ttcn
+Native_Functions.ttcn Native_FunctionDefs.cc SCCP_Templates.ttcn "
+gen_links $DIR $FILES
+
+ignore_pp_results
diff --git a/SCCP_Test/regen_makefile.sh b/SCCP_Test/regen_makefile.sh
new file mode 100755
index 000..9472e0c
--- /dev/null
+++ b/SCCP_Test/regen_makefile.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+MAIN=SCCP_Testcases.ttcn
+
+FILES="*.ttcn *.ttcnpp"
+
+../regen-makefile.sh $MAIN $FILES

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib6004d2b23c8207faac7f8b7bd07e84c404cd84d
Gerrit-Change-Number: 16811
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests

2020-01-12 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811 )

Change subject: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib6004d2b23c8207faac7f8b7bd07e84c404cd84d
Gerrit-Change-Number: 16811
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 12 Jan 2020 12:59:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests

2020-01-12 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811 )


Change subject: WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests
..

WIP: gen_links.sh + regen_makefile.sh for make SCCP_Tests

Change-Id: Ib6004d2b23c8207faac7f8b7bd07e84c404cd84d
---
A SCCP_Test/gen_links.sh
A SCCP_Test/regen_makefile.sh
2 files changed, 55 insertions(+), 0 deletions(-)



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

diff --git a/SCCP_Test/gen_links.sh b/SCCP_Test/gen_links.sh
new file mode 100755
index 000..c980844
--- /dev/null
+++ b/SCCP_Test/gen_links.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+BASEDIR=../deps
+
+. ../gen_links.sh.inc
+
+DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src
+FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn 
TCCConversion.cc TCCInterface.cc TCCInterface_ip.h SDP_EncDec.cc"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src
+FILES="Socket_API_Definitions.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.ProtocolModules.M3UA/src
+FILES="M3UA_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by M3UA_Emulation
+DIR=$BASEDIR/titan.TestPorts.SCTPasp/src
+FILES="SCTPasp_PT.cc  SCTPasp_PT.hh  SCTPasp_PortType.ttcn  SCTPasp_Types.ttcn"
+gen_links $DIR $FILES
+
+# required by SCCP Emulation
+DIR=$BASEDIR/titan.ProtocolEmulations.M3UA/src
+FILES="M3UA_Emulation.ttcn"
+gen_links $DIR $FILES
+
+# required by SCCP Emulation
+DIR=$BASEDIR/titan.TestPorts.MTP3asp/src
+FILES="MTP3asp_PortType.ttcn  MTP3asp_Types.ttcn"
+gen_links $DIR $FILES
+
+DIR=$BASEDIR/titan.ProtocolEmulations.SCCP/src
+FILES="SCCP_Emulation.ttcn  SCCP_Mapping.ttcnpp  SCCP_Types.ttcn  
SCCPasp_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="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn 
Osmocom_VTY_Functions.ttcn
+Native_Functions.ttcn Native_FunctionDefs.cc SCCP_Templates.ttcn "
+gen_links $DIR $FILES
+
+ignore_pp_results
diff --git a/SCCP_Test/regen_makefile.sh b/SCCP_Test/regen_makefile.sh
new file mode 100755
index 000..9472e0c
--- /dev/null
+++ b/SCCP_Test/regen_makefile.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+MAIN=SCCP_Testcases.ttcn
+
+FILES="*.ttcn *.ttcnpp"
+
+../regen-makefile.sh $MAIN $FILES

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16811
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib6004d2b23c8207faac7f8b7bd07e84c404cd84d
Gerrit-Change-Number: 16811
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: WIP

2019-11-29 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16337 )


Change subject: WIP
..

WIP

Change-Id: I3aa654e6f678698e5b8cb4914f1ca5b39fc08568
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 153 insertions(+), 0 deletions(-)



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

diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 5bb5fa7..b4692bd 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -,6 +,157 @@
}
 }

+/* Test the max UL CS set by VTY works fine */
+testcase TC_cs_initial_ul() runs on RAW_PCU_Test_CT {
+   var GsmRrMessage rr_imm_ass;
+   var PacketUlAssign ul_tbf_ass;
+   var RlcmacDlBlock dl_block;
+   var boolean ok;
+   var integer lqual_cb := 0;
+   var ChCodingCommand last_ch_coding;
+   var template ChCodingCommand ch_coding_cs1 := CH_CODING_CS1;
+   var template ChCodingCommand ch_coding_cs3 := CH_CODING_CS3;
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename());
+
+   /* Set initial UL CS to 3 */
+   g_cs_initial_ul := 3;
+   f_pcuvty_set_allowed_cs_mcs();
+   f_pcuvty_set_link_quality_ranges();
+
+   /* Take lqual (dB->cB) so that we stay in that CS */
+   lqual_cb := g_cs_lqual_ranges[2].low * 10;
+
+   /* Establish an Uplink TBF */
+   ok := f_establish_tbf(rr_imm_ass);
+   if (not ok) {
+   setverdict(fail, "Failed to establish TBF");
+   mtc.stop;
+   }
+
+   ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
+   if (not ok) {
+   setverdict(fail, "Immediate Assignment not an Uplink TBF");
+   mtc.stop;
+   }
+
+   var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
+   tfi := ul_tbf_ass.dynamic.tfi_assignment,
+   cv := 3, /* 8 UL blocks to be sent (to be overridden in loop) */
+   bsn := 0, /* TODO: what should be here? */
+   blocks := { /* To be generated in loop */ });
+
+   /* HACK: patch missing TLLI; otherwise OsmoPCU rejects DATA.req */
+   ul_data.data.tlli := '0001'O;
+
+   /* 3 UL blocks, check we are in same initial CS: */
+   for (var integer i := 0; i < 3; i := i + 1) {
+   /* Prepare a new UL block (CV, random payload) */
+   ul_data.data.mac_hdr.countdown := (7 - i);
+   ul_data.data.blocks := { 
valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+
+   /* Enqueue DATA.ind (both TDMA frame and block numbers to be 
patched) */
+   f_tx_rlcmac_ul_block(ul_data, lqual_cb);
+
+   /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+   f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+   last_ch_coding := 
dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd;
+   }
+
+   if (not match(last_ch_coding, ch_coding_cs3)) {
+   setverdict(fail, "Channel Coding does not match our 
expectations (CS-3): ", last_ch_coding);
+   mtc.stop;
+   }
+
+   setverdict(pass);
+
+   /* Remaining UL blocks are used to make sure regardless of initial
+   /* lqual, we can go lower at any time */
+
+   /* 5 UL blocks, check we are in same initial CS: */
+   for (var integer i := 3; i < 8; i := i + 1) {
+   /* Prepare a new UL block (CV, random payload) */
+   ul_data.data.mac_hdr.countdown := (7 - i);
+   ul_data.data.blocks := { 
valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(10))) };
+
+   /* Enqueue DATA.ind (both TDMA frame and block numbers to be 
patched) */
+   f_tx_rlcmac_ul_block(ul_data, 0); /* 0 dB, make sure we 
downgrade CS */
+
+   /* Enqueue RTS.req, expect DATA.req with UL ACK from the PCU */
+   f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+
+   last_ch_coding := 
dl_block.ctrl.payload.u.ul_ack_nack.gprs.ch_coding_cmd;
+   }
+
+   if (not match(last_ch_coding, ch_coding_cs1)) {
+   setverdict(fail, "Channel Coding does not match our 
expectations (CS-1): ", last_ch_coding);
+   } else {
+   setverdict(pass);
+   }
+}
+
+/* Test the max UL CS set by VTY works fine */
+testcase TC_cs_max_ul() runs on RAW_PCU_Test_CT {
+   var GsmRrMessage rr_imm_ass;
+   var PacketUlAssign ul_tbf_ass;
+   var RlcmacDlBlock dl_block;
+   var boolean ok;
+   var ChCodingCommand last_ch_coding;
+   var template ChCodingCommand ch_coding_cs3 := CH_CODING_CS3;
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename());
+
+   /* Set maximum allowed UL CS to 3 */
+   g_cs_max_ul := 3;
+   f_pcuvty_set_allowed_cs_mcs();
+   f_pcuvty_set_link_quality_ranges();
+
+   /* Establish an Uplink TBF */

Change in osmo-ttcn3-hacks[master]: WIP

2019-11-04 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15956 )


Change subject: WIP
..

WIP

Change-Id: I5e3cbcf3c915f62913bec3423e14ba9152c7ba2f
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/L3_Templates.ttcn
3 files changed, 34 insertions(+), 4 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index e7a4c13..0a472cb 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -4372,6 +4372,31 @@
}
 }

+/* Establish signalling channel (non-assignment case) followed by cipher mode 
*/
+private function f_tc_lu_classmark_pwr_lvl(charstring id) runs on MSC_ConnHdlr 
{
+   var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL);
+   ass_cmd.pdu.bssmap.assignmentRequest.circuitIdentityCode := omit;
+   ass_cmd.pdu.bssmap.assignmentRequest.aoIPTransportLayer := omit;
+   exp_compl.pdu.bssmap.assignmentComplete.circuitIdentityCode := omit;
+   exp_compl.pdu.bssmap.assignmentComplete.aoIPTransportLayer := omit;
+
+   f_establish_fully(ass_cmd, exp_compl);
+   log("Done with first assignment, starting second assignment");
+   f_create_chan_and_exp();
+}
+testcase TC_lu_classmark_pwr_lvl() runs on test_CT {
+   var MSC_ConnHdlr vc_conn;
+   var TestHdlrParams pars := f_gen_test_hdlr_pars();
+   pars.cm2.rf_PowerCapability := '001'B; /* DCS 1800 power class 2, max 
power lvl = 3 (24dBm) */
+
+   f_init(1, true);
+   f_sleep(1.0);
+   vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars);
+   vc_conn.done;
+}
+

 /* Dyn PDCH todo:
* activate OSMO as TCH/F
@@ -4541,6 +4566,9 @@
execute( TC_chopped_ipa_ping() );
execute( TC_chopped_ipa_payload() );

+   /* Power control related */
+   execute( TC_lu_classmark_pwr_lvl() );
+
/* at bottom as they might crash OsmoBSC before OS#3182 is fixed */
execute( TC_early_conn_fail() );
execute( TC_late_conn_fail() );
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 8091d8d..12e11fa 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -526,6 +526,7 @@
TestHdlrEncrParams encr optional,
TestHdlrParamsLcls lcls,
TestHdlrParamsHandover handover optional,
+   MobileStationClassmark2_LV cm2,
uint5_t exp_ms_power_level,
boolean aoip,
boolean use_osmux
@@ -552,6 +553,7 @@
adjust_cx_exp := true
},
handover := omit,
+   cm2 := ts_CM2,
exp_ms_power_level := 7, /* calculated from osmo-bsc.cfg "ms max power" 
*/
aoip := true,
use_osmux := false
@@ -559,7 +561,7 @@

 function f_create_chan_and_exp() runs on MSC_ConnHdlr {
var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
-   var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, 
mi));
+   var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, 
mi, g_pars.cm2));
var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info);

/* call helper function for CHAN_RQD -> IMM ASS ->EST_IND */
@@ -770,7 +772,7 @@
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "IE MS Power 
not found in CHAN ACT");
} else {
if (not match(ms_power.ms_power, 
tr_RSL_IE_MS_Power(g_pars.exp_ms_power_level, false))) {
-   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
"Wrong MS Power IE in CHAN ACT");
+   Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("Wrong MS Power IE in CHAN ACT, ", ms_power.ms_power.power_level, " vs 
exp ", g_pars.exp_ms_power_level));
}
}

diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 0556c97..d183097 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -202,7 +202,7 @@
 };

 /* Send template for CM SERVICE REQUEST */
-template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, 
MobileIdentityLV mi_lv) := {
+template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, 
MobileIdentityLV mi_lv, MobileStationClassmark2_LV cm2) := {
discriminator := ''B, /* overwritten */
tiOrSkip := {
skipIndicator := ''B
@@ -214,7 +214,7 @@
nsd := '00'B,
cm_ServiceType := int2bit(enum2int(serv_type), 
4),
cipheringKeySequenceNumber := { '000'B, '0'B },
-   mobileStationClassmark2 := ts_CM2,
+   mobileStationClassmark2 := cm2,
   

Change in ...osmo-ttcn3-hacks[master]: WIP

2019-10-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15681


Change subject: WIP
..

WIP

Change-Id: I3be5123ff5294e5851652ec14d54589442082b28
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 55 insertions(+), 0 deletions(-)



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

diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 0771cf9..e9003d3 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -1017,6 +1017,60 @@
f_rx_rlcmac_dl_block_exp_dummy(dl_block);
 }

+/* pespin */
+testcase TC_pespin() runs on RAW_PCU_Test_CT {
+   var PCUIF_info_ind info_ind;
+   var GsmRrMessage rr_imm_ass;
+   var PacketUlAssign ul_tbf_ass;
+   var RlcmacDlBlock dl_block;
+   var PCUIF_Message pcu_msg;
+   var octetstring data;
+   var boolean ok;
+   var OCT4 tlli := '0001'O;
+
+   /* Initialize NS/BSSGP side */
+   f_init_bssgp();
+
+   info_ind := valueof(ts_PCUIF_INFO_default);
+   /* Set timer to 1 sec (default 5) to speedup test: */
+   info_ind.t3169 := 1;
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename(), info_ind);
+
+   /* Establish BSSGP connection to the PCU */
+   f_bssgp_establish();
+   f_bssgp_client_llgmm_assign(''O, tlli);
+
+   /* Establish an Uplink TBF */
+   ok := f_establish_tbf(rr_imm_ass);
+   if (not ok) {
+   setverdict(fail, "Failed to establish TBF");
+   mtc.stop;
+   }
+
+   ok := f_imm_ass_verify_ul_tbf_ass(rr_imm_ass, ul_tbf_ass);
+   if (not ok) {
+   setverdict(fail, "Immediate Assignment not an Uplink TBF");
+   mtc.stop;
+   }
+
+   /* Send one UL block and make sure it is ACKED fine */
+   f_tx_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
+   f_rx_rlcmac_dl_block_exp_ack_nack(dl_block);
+   /* UL block should be received in SGSN */
+   BSSGP[0].receive(tr_BSSGP_UL_UD(tlli, mp_gb_cfg.cell_id));
+
+   /* Wait until T3169 fires (plus 1 extra sec to make sure) */
+   f_sleep(int2float(info_ind.t3169) + 1.0);
+
+   /* Send an UL block once again, the TBF should be gone by now so no ACK 
*/
+   f_tx_rlcmac_ul_n_blocks(ul_tbf_ass, 1);
+   f_rx_rlcmac_dl_block_exp_dummy(dl_block);
+
+   f_sleep(10.0);
+}
+

 control {
execute( TC_ns_reset() );
@@ -1034,6 +1088,7 @@
execute( TC_ta_ptcch_ul_multi_tbf() );
execute( TC_cs_lqual_ul_tbf() );
execute( TC_t3169() );
+   execute( TC_pespin() );
 }



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15681
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3be5123ff5294e5851652ec14d54589442082b28
Gerrit-Change-Number: 15681
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-ttcn3-hacks[master]: WIP: PCU_Tests_RAW.ttcn: introduce test case for TBF Timing Advance

2019-09-14 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15526


Change subject: WIP: PCU_Tests_RAW.ttcn: introduce test case for TBF Timing 
Advance
..

WIP: PCU_Tests_RAW.ttcn: introduce test case for TBF Timing Advance

Change-Id: Ia78d93e43a3c41b0b30e70df20a2da31077fd05f
---
M pcu/PCU_Tests_RAW.ttcn
1 file changed, 93 insertions(+), 1 deletion(-)



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

diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 1312a2f..fedb604 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -7,6 +7,7 @@
those NS and BSSGP implementations on the BSS (PCU) side. */

 /* (C) 2018-2019 Harald Welte 
+ * (C) 2019 Vadim Yanitskiy 
  * All rights reserved.
  *
  * Released under the terms of GNU General Public License, Version 2 or
@@ -20,6 +21,9 @@
 import from GSM_Types all;
 import from GSM_RR_Types all;

+import from RLCMAC_CSN1_Types all;
+import from RLCMAC_Types all;
+
 import from NS_Types all;
 import from BSSGP_Types all;
 import from Osmocom_Gb_Types all;
@@ -535,7 +539,7 @@
 * at some point the PCU will fail to allocate a new TBF. */
for (var integer ta := 0; ta < 64; ta := ta + 16) {
/* Send an Access Burst (8-bit) on TS0.
-* FIXME: properly encode RA (see 3GPP TS 04.08, table 9.9),
+* FIXME: properly encode RA (see 3GPP TS 04.08, table 9.9 and 
TS 24.060, table 11.2.5.2),
 * TODO: ask the BTS component to give us the current TDMA fn */
log("Sending RACH.ind with TA=", ta);
BTS.send(ts_PCUIF_RACH_IND(bts_nr := 0, ra := oct2int('3A'O), 
is_11bit := 0,
@@ -574,6 +578,93 @@
}
 }

+testcase TC_ta_tbf_tuwat() runs on RAW_PCU_Test_CT {
+   var PacketUlAssign ul_tbf_ass;
+   var PCUIF_Message pcu_msg;
+   var GsmRrMessage rr_msg;
+   timer T := 2.0;
+
+   /* Initialize the PCU interface abstraction */
+   f_init_raw(testcasename());
+
+   /* Ask for an UL TBF by sending an Access Burst (8-bit) on TS0.
+* TODO: ask the BTS component to give us the current TDMA fn */
+   BTS.send(ts_PCUIF_RACH_IND(bts_nr := 0, ra := oct2int('3A'O), is_11bit 
:= 0,
+  burst_type := BURST_TYPE_0,
+  fn := 1337, arfcn := 871));
+
+   /* Expect Immediate (TBF) Assignment on TS0/AGCH */
+   T.start;
+   alt {
+   [] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 0,
+sapi := PCU_IF_SAPI_AGCH, data := ?)) 
-> value pcu_msg {
+   /* FIXME: we cannot use decmatch here because the data comes 
with padding */
+   rr_msg := dec_GsmRrMessage(pcu_msg.u.data_req.data);
+   log("Rx DATA.req from OsmoPCU: ", rr_msg);
+   T.stop;
+
+   /* Make sure the received data is an UL TBF Assignment */
+   if (match(rr_msg, tr_IMM_TBF_ASS(dl := false, ra := 
oct2int('3A'O),
+rest := 
tr_IaRestOctets_ULAss(? {
+   ul_tbf_ass := 
rr_msg.payload.imm_ass.rest_octets.hh.pa.uldl.ass.ul;
+   log("Rx Immediate Assignment (UL TBF): ", ul_tbf_ass);
+   setverdict(pass);
+   } else {
+   setverdict(fail, "Failed to match Immediate (TBF) 
Assignment");
+   mtc.stop;
+   }
+   }
+   [] BTS.receive { repeat; }
+   [] T.timeout {
+   setverdict(fail, "Timeout waiting for Immediate Assignment");
+   mtc.stop;
+   }
+   }
+
+   /* TODO: check if we got single or dynamic assignment */
+   var octetstring pkt_res_req_enc;
+
+   var template (value) RlcmacUlBlock ul_data := t_RLCMAC_UL_DATA(
+   tfi := ul_tbf_ass.dynamic.tfi_assignment,
+   cv := 15, /* 15 UL blocks to be sent (to be overridden in loop) 
*/
+   bsn := 0, /* TODO: what should be here? */
+   blocks := { /* To be generated in loop */ }
+   );
+
+   /* HACK: patch missing TLLI */
+   ul_data.data.tlli := '0001'O;
+
+   for (var integer i := 0; i < 16; i := i + 1) {
+   /* Prepare a new UL block (CV, payload) */
+   ul_data.data.mac_hdr.countdown := (15 - i);
+   ul_data.data.blocks := { 
valueof(t_RLCMAC_LLCBLOCK(f_rnd_octstring(23))) };
+
+   /* Encode the payload of DATA.ind */
+   pkt_res_req_enc := enc_RlcmacUlBlock(valueof(ul_data));
+   pkt_res_req_enc := f_pad_oct(pkt_res_req_enc, 34, '00'O); /* 
CS-2 */
+
+   /* TODO: derive block number from the current TDMA frame number 
*/
+   BTS.send(ts_PCUIF_DATA_IND(bts_nr := 0, trx_nr := 

Change in ...osmo-ttcn3-hacks[master]: WIP

2019-07-03 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14493 )

Change subject: WIP
..


Abandoned

Feature added for all mgw tests in I31fed700772dd0b063f913b1e1639fd428c46e7d 
and previous commits.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14493
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I21ffcaa241e4fc0bd2c6563e21f1c8bdb4d14dd6
Gerrit-Change-Number: 14493
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in ...osmo-ttcn3-hacks[master]: WIP

2019-06-17 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14493


Change subject: WIP
..

WIP

Change-Id: I21ffcaa241e4fc0bd2c6563e21f1c8bdb4d14dd6
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSMAP_Templates.ttcn
3 files changed, 94 insertions(+), 3 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 00995bf..37e1bf8 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1233,6 +1233,20 @@
setverdict(pass);
 }

+/* Verify MGCP muxed over IPA from MSC (or BSC-NAT) is forwarded to MGW by BSC 
*/
+testcase TC_assignment_mgcp_ipa() runs on test_CT {
+   var TestHdlrParams pars := f_gen_test_hdlr_pars();
+   var MSC_ConnHdlr vc_conn;
+
+   f_init(1, true);
+   f_sleep(1.0);
+
+   pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+   pars.forward_mgcp_ipa := true;
+   vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars);
+   vc_conn.done;
+}
+
 function f_bssap_tx_ud(template PDU_BSSAP bssap) runs on test_CT {
BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, 
g_bssap.sccp_addr_own, bssap));
 }
@@ -1717,6 +1731,7 @@
}
connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT);
connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
+   connect(vc_conn:MGCP_MSC_CLIENT, g_bssap.vc_RAN:MGCP)
 }

 function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := 
omit)
@@ -4018,6 +4033,7 @@
execute( TC_ctrl() );
if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER) {
execute( TC_ctrl_location() );
+   execute( TC_assignment_mgcp_ipa() );
}

/* RSL DCHAN Channel ACtivation / Deactivation */
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index c709794..870103f 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -15,6 +15,7 @@
 import from General_Types all;
 import from Osmocom_Types all;
 import from GSM_Types all;
+import from IPA_Emulation all;
 import from SCCPasp_Types all;
 import from BSSAP_Types all;
 import from RAN_Emulation all;
@@ -23,6 +24,7 @@
 import from IPL4asp_Types all;
 import from Native_Functions all;

+import from MGCP_CodecPort all;
 import from MGCP_Types all;
 import from MGCP_Templates all;
 import from MGCP_Emulation all;
@@ -357,9 +359,19 @@
port RAN_PROC_PT RAN;
port TELNETasp_PT BSCVTY;

+   /* Proxy MGCP-over-IPA and MGCP-over-UDP */
+   //var MGCP_Adapter_CT vc_MGCP_UDP;
+   port IPA_MGCP_PT MGCP_MSC_CLIENT;
+   var integer g_trans_id := 0;
+   var MgcpConnectionId g_mgcp_conn_id;
+
var MediaState g_media;
var TestHdlrParams g_pars;

+   var charstring host_bts := "127.0.0.2";
+   var charstring host_mgw := "127.0.0.3";
+   var charstring host_msc := "127.0.0.4";
+
var boolean g_vty_initialized := false;
 }

@@ -372,6 +384,19 @@
f_vty_transceive(BSCVTY, "enable");
g_vty_initialized := true;
}
+
+/*
+   if (g_pars.forward_mgcp_ipa) {
+   vc_MGCP_UDP := MGCP_Adapter_CT.create(int2str(i) & "-MGCP_UDP");
+   connect(vc_BSSMAP:MGCP, vc_MGCP_UDP:MGCP);
+   vc_MGCP_UDP.start(MGCP_Adapter.main());
+   }*/
+}
+
+private function get_next_trans_id() runs on MSC_ConnHdlr return MgcpTransId {
+   var MgcpTransId tid := int2str(g_trans_id);
+   g_trans_id := g_trans_id + 1;
+   return tid;
 }

 /* Callback function from general RAN_Emulation whenever a connectionless
@@ -453,7 +478,8 @@
TestHdlrParamsLcls lcls,
TestHdlrParamsHandover handover optional,
boolean aoip,
-   boolean use_osmux
+   boolean use_osmux,
+   boolean forward_mgcp_ipa /* only used for SCCPLite: Forward 
MGCP towards BSC's attached MGW over BSC<->MSC IPA conn */
 };

 /* Note: Do not use valueof() to get a value of this template, use
@@ -478,7 +504,8 @@
},
handover := omit,
aoip := true,
-   use_osmux := false
+   use_osmux := false,
+   forward_mgcp_ipa := false
 }

 function f_create_chan_and_exp() runs on MSC_ConnHdlr {
@@ -846,6 +873,30 @@
}
 }

+/* Send a MGCP request + receive a (matching!) response */
+function mgcp_transceive_mgw(template MgcpCommand cmd, template MgcpResponse 
resp := ?) runs on MSC_ConnHdlr {
+   template MgcpResponse resp_any := ?
+   var MgcpResponse resp_val;
+   resp.line.trans_id := cmd.line.trans_id;
+   timer T := 5.0;
+
+   BSSAP.send(cmd);
+   T.start;
+   alt {
+   [] BSSAP.receive(resp) -> value resp_val { }
+   [] BSSAP.receive(resp_any) {
+   setverdict(fail, "Response didn't 

  1   2   >