[PATCH] osmo-ttcn3-hacks[master]: bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMA...

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

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jan 31 17:50:52 UTC 2018


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

bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion

Related: OS#2902
Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSMAP_Templates.ttcn
M library/L3_Templates.ttcn
4 files changed, 154 insertions(+), 3 deletions(-)


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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 8b44a25..b9d61dd 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1404,12 +1404,64 @@
 	vc_conn.done;
 }
 
+/* test if L3 RR CLASSMARK CHANGE is translated to BSSMAP CLASSMARK UPDATE */
+private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr {
+	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	f_create_chan_and_exp(pars);
+	/* we should now have a COMPL_L3 at the MSC */
+	BSSAP.receive(tr_BSSMAP_ComplL3);
+
+	f_rsl_send_l3(ts_RRM_CM_CHG(valueof(ts_CM2)));
+	BSSAP.receive(tr_BSSMAP_ClassmarkUpd(?, omit));
+	setverdict(pass);
+}
+testcase TC_classmark() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+	f_init(1, true);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_classmark), testcasename());
+	vc_conn.done;
+}
+
+/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */
+private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr {
+	var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+	f_create_chan_and_exp(pars);
+	/* we should now have a COMPL_L3 at the MSC */
+	BSSAP.receive(tr_BSSMAP_ComplL3);
+
+	f_rsl_send_l3(ts_RRM_AssignmentFailure('00'O));
+	timer T := 5.0;
+	T.start;
+	alt {
+	[] BSSAP.receive(tr_BSSMAP_AssignmentFail) {
+		setverdict(fail, "Unexpeted BSSMAP Assignment Failure");
+		}
+	[] BSSAP.receive(tr_BSSMAP_ClearRequest) {
+		setverdict(fail, "Unexpected BSSMAP Clear Requst");
+		}
+	[] T.timeout {
+		setverdict(pass);
+		}
+	}
+}
+
+testcase TC_unsol_ass_fail() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+	f_init(1, true);
+	f_sleep(1.0);
+	vc_conn := f_start_handler(refers(f_tc_unsol_ass_fail), testcasename());
+	vc_conn.done;
+}
 
 
 control {
+	/* CTRL interface testing */
 	execute( TC_ctrl_msc_connection_status() );
 	execute( TC_ctrl_msc0_connection_status() );
 	execute( TC_ctrl() );
+
+	/* RSL DCHAN Channel ACtivation / Deactivation */
 	execute( TC_chan_act_noreply() );
 	execute( TC_chan_act_counter() );
 	execute( TC_chan_act_ack_noest() );
@@ -1424,6 +1476,8 @@
 	execute( TC_chan_rel_a_reset() );
 
 	execute( TC_outbound_connect() );
+
+	/* Assignment related */
 	execute( TC_assignment_cic_only() );
 	execute( TC_assignment_csd() );
 	execute( TC_assignment_ctm() );
@@ -1434,11 +1488,13 @@
 	execute( TC_assignment_fr_a5_3() );
 	execute( TC_assignment_fr_a5_4() );
 
+	/* RLL Establish Indication on inactive DCHAN / SAPI */
 	execute( TC_rll_est_ind_inact_lchan() );
 	execute( TC_rll_est_ind_inval_sapi1() );
 	execute( TC_rll_est_ind_inval_sapi3() );
 	execute( TC_rll_est_ind_inval_sacch() );
 
+	/* Paging related tests */
 	execute( TC_paging_imsi_nochan() );
 	execute( TC_paging_tmsi_nochan() );
 	execute( TC_paging_tmsi_any() );
@@ -1460,6 +1516,9 @@
 	execute( TC_paging_imsi_load() );
 
 	execute( TC_rsl_drop_counter() );
+
+	execute( TC_classmark() );
+	execute( TC_unsol_ass_fail() );
 }
 
 }
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index b6e6540..a7f4d71 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -301,6 +301,17 @@
 	f_create_bssmap_exp(l3_enc);
 }
 
+function f_rsl_send_l3(template PDU_ML3_MS_NW l3, template (omit) RslLinkId link_id := omit,
+			template (omit) RslChannelNr chan_nr := omit) runs on MSC_ConnHdlr {
+	if (not isvalue(link_id)) {
+		link_id := ts_RslLinkID_DCCH(0);
+	}
+	if (not isvalue(chan_nr)) {
+		chan_nr := g_chan_nr;
+	}
+	RSL.send(ts_RSL_DATA_IND(valueof(chan_nr), valueof(link_id), enc_PDU_ML3_MS_NW(valueof(l3))));
+}
+
 function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr {
 	var RslChannelNr chan_nr := orig.ies[0].body.chan_nr;
 	var RslLinkId link_id;
@@ -309,7 +320,7 @@
 	} else {
 		link_id := orig.ies[1].body.link_id;
 	}
-	RSL.send(ts_RSL_DATA_IND(chan_nr, link_id, enc_PDU_ML3_MS_NW(valueof(l3))));
+	f_rsl_send_l3(l3, link_id, chan_nr);
 }
 
 function f_cipher_mode(OCT1 alg, OCT8 key, template OCT16 kc128 := omit, boolean exp_fail := false)
diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn
index f0a8a08..d4e278b 100644
--- a/library/BSSMAP_Templates.ttcn
+++ b/library/BSSMAP_Templates.ttcn
@@ -906,6 +906,23 @@
 	}
 }
 
+template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *,
+					  template BSSMAP_IE_ClassmarkInformationType3 cm3 := *)
+modifies tr_BSSAP_BSSMAP := {
+	pdu := {
+		bssmap := {
+			classmarkUpdate := {
+				messageType := '54'O,
+				classmarkInformationType2 := cm2,
+				classmarkInformationType3 := cm3,
+				talkerPriority := *
+			}
+		}
+	}
+}
+
+
+
 
 
 } with { encode "RAW" };
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index ed477d5..ad4e575 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -102,8 +102,25 @@
 	esind := '1'B,
 	revisionLevel := '10'B,
 	spare1_1 := '0'B,
-	mobileStationClassmark2_oct4 := omit,
-	mobileStationClassmark2_oct5 := omit
+	mobileStationClassmark2_oct4 := {
+		fc := '1'B,
+		vgcs := '0'B,
+		vbs := '0'B,
+		sm_Capability := '1'B,
+		ss_ScreenIndicator := '01'B,
+		ps_Capability := '1'B,
+		spare2_1 := '0'B
+	},
+	mobileStationClassmark2_oct5 := {
+		a5_2 := '0'B,
+		a5_3 := '1'B,
+		cmsp := '0'B,
+		solsa := '0'B,
+		ucs2 := '0'B,
+		lcsva_cap := '0'B,
+		spare5_7 :='0'B,
+		cm3 := '0'B
+	}
 };
 
 /* Send template for CM SERVICE REQUEST */
@@ -268,6 +285,53 @@
 	}
 }
 
+template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		rrm := {
+			assignmentFailure := {
+				messageType := '00101111'B,
+				rR_Cause := {
+					valuePart := cause
+				}
+			}
+		}
+	}
+}
+
+
+function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV {
+	if (not isvalue(cm3)) {
+		return omit;
+	}
+	var template MobileStationClassmark3_TLV ret := {
+		elementIdentifier := '20'O,
+		lengthIndicator := 0, /* overwritten */
+		valuePart := cm3
+	}
+	return ret;
+}
+
+template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2,
+					     template (omit) MobileStationClassmark3_TLV cm3 := omit) := {
+	discriminator := '0110'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		rrm := {
+			classmarkChange := {
+				messageType := '00010110'B,
+				mobileStationClassmark2 := cm2,
+				mobileStationClassmark3 := cm3
+			}
+		}
+	}
+}
+
 template PDU_ML3_MS_NW ts_ML3_MO := {
 	discriminator := '0000'B,
 	tiOrSkip := {

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

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



More information about the gerrit-log mailing list