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 := '0000'B, /* overwritten */
        tiOrSkip := {
                skipIndicator := '0000'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,
                                mobileIdentity := mi_lv,
                                priorityLevel := omit,
                                additionalUpdateParameterTV := omit,

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15956
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: I5e3cbcf3c915f62913bec3423e14ba9152c7ba2f
Gerrit-Change-Number: 15956
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to