Change in osmo-ttcn3-hacks[master]: BTS_Tests/SMSCB: improve SDCCH8+CBCH handling and configuration

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri Jul 31 14:02:03 UTC 2020


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19475 )

Change subject: BTS_Tests/SMSCB: improve SDCCH8+CBCH handling and configuration
......................................................................

BTS_Tests/SMSCB: improve SDCCH8+CBCH handling and configuration

Change-Id: I130a028df7dc476ab765733261a1f007f19f39a8
---
M bts/BTS_Tests_SMSCB.ttcn
1 file changed, 62 insertions(+), 60 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/bts/BTS_Tests_SMSCB.ttcn b/bts/BTS_Tests_SMSCB.ttcn
index 1e17703..11855bf 100644
--- a/bts/BTS_Tests_SMSCB.ttcn
+++ b/bts/BTS_Tests_SMSCB.ttcn
@@ -54,8 +54,8 @@
 
 /* CBCH test parameters for most of our tests */
 type record CbchTestPars {
-	/* should we execute on SDCCH4 (true) or SDCCH8 (false) ? */
-	boolean		use_sdcch4,
+	/* Should we execute on SDCCH4 or SDCCH8? */
+	RslChannelNr chan_nr,
 	/* Parameters for BASIC CBCH */
 	CbchTestParsChan basic,
 	/* Parameters for EXTENDED CBCH */
@@ -195,29 +195,51 @@
 	}
 }
 
-private function f_vty_cbch_setup(boolean use_sdcch4 := true) runs on test_CT {
+private function f_vty_cbch_setup(in RslChannelNr chan_nr) runs on test_CT {
 
-	if (use_sdcch4 == true) {
-		f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 0"},
+	if (match(chan_nr, t_RslChanNr_CBCH4(0))) {
+		f_vty_config2(BSCVTY, { "network", "bts 0", "trx 0", "timeslot 0"},
 					"phys_chan_config CCCH+SDCCH4+CBCH");
-		f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 6"},
-					"phys_chan_config SDCCH8");
-	} else {
-		f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 0"},
+		/* (Re)configure timeslots 1..3 as TCH/F */
+		for (var integer tn := 1; tn <= 3; tn := tn + 1) {
+			f_vty_config2(BSCVTY, { "network", "bts 0", "trx 0",
+						"timeslot " & int2str(tn) },
+						"phys_chan_config TCH/F");
+		}
+	} else if (match(chan_nr, t_RslChanNr_CBCH8(?))) {
+		f_vty_config2(BSCVTY, { "network", "bts 0", "trx 0", "timeslot 0"},
 					"phys_chan_config CCCH+SDCCH4");
-		f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 6"},
+		f_vty_config2(BSCVTY, { "network", "bts 0", "trx 0",
+					"timeslot " & int2str(chan_nr.tn) },
 					"phys_chan_config SDCCH8+CBCH");
+
+		/* (Re)configure timeslots 1..3 (excluding the given one) as TCH/F */
+		for (var integer tn := 1; tn <= 3; tn := tn + 1) {
+			if (tn == chan_nr.tn)
+				{ continue; }
+			f_vty_config2(BSCVTY, { "network", "bts 0", "trx 0",
+						"timeslot " & int2str(tn) },
+						"phys_chan_config TCH/F");
+		}
 	}
 	f_vty_transceive(BSCVTY, "drop bts connection 0 oml");
 	f_sleep(2.0);
 }
 private function f_smscb_setup(inout CbchTestPars pars) runs on test_CT {
+	/* Make sure we've got either SDCCH4+CBCH or SDCCH8+CBCH.
+	 * SDCCH4+CBCH can only be allocated on TS0, SDCCH8+CBCH on TS0..3.
+	 * On C0 the first timeslot shall always transmit BCCH, thus TS1..3.*/
+	if (not match(pars.chan_nr, (t_RslChanNr_CBCH4(0), t_RslChanNr_CBCH8(1),
+				     t_RslChanNr_CBCH8(2), t_RslChanNr_CBCH8(3)))) {
+		setverdict(inconc, "Unhandled channel number: ", pars.chan_nr);
+		mtc.stop;
+	}
 
 	f_cbch_compute_exp_blocks(pars);
 
 	f_init_vty_bsc();
 	/* ensure that a CBCH is present in channel combination */
-	f_vty_cbch_setup(pars.use_sdcch4);
+	f_vty_cbch_setup(pars.chan_nr);
 	f_init();
 
 	f_init_l1ctl();
@@ -231,14 +253,6 @@
 	}
 }
 
-private function f_smscb_cleanup() runs on test_CT {
-	/* reset timeslot 0 channel combination to default */
-	f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 0"},
-				"phys_chan_config CCCH+SDCCH4");
-	f_vty_config2(BSCVTY, {"network", "bts 0", "trx 0", "timeslot 6"},
-				"phys_chan_config SDCCH8");
-}
-
 /* construct a receive/match template for given block_nr in given msg */
 private function f_get_block_template(CbchTestMsg msg, integer block_nr) return template CBCH_Block {
 	var template CBCH_Block tr;
@@ -326,17 +340,8 @@
 	}
 }
 
-private function t_cbch_chan_nr(CbchTestPars pars, template uint8_t tn) return template RslChannelNr {
-	if (pars.use_sdcch4) {
-		return t_RslChanNr_CBCH4(tn);
-	} else {
-		return t_RslChanNr_CBCH8(tn);
-	}
-}
-
 /* shared function doing the heavy lifting for most CBCH tests */
 private function f_TC_smscb(CbchTestPars pars) runs on test_CT {
-	var template RslChannelNr t_chan_nr := t_cbch_chan_nr(pars, 0); /* FIXME: TS number */
 	var L1ctlDlMessage dl;
 	var integer msg_count;
 	timer T;
@@ -358,7 +363,7 @@
 	T.start(5.0 + 3.0 * int2float(msg_count));
 	/* Expect this to show up exactly once on the basic CBCH (four blocks) */
 	alt {
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(t_chan_nr)) -> value dl {
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(pars.chan_nr)) -> value dl {
 		var integer tb := f_cbch_fn2tb(dl.dl_info.frame_nr);
 		var CBCH_Block cb := dec_CBCH_Block(dl.payload.data_ind.payload);
 		log("Tb=", tb, ", CBCH: ", dl, ", block: ", cb);
@@ -386,12 +391,10 @@
 		}
 	}
 
-	f_smscb_cleanup();
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__, pass);
 }
 
 private function f_TC_smscb_default_only(CbchTestPars pars) runs on test_CT {
-	var template RslChannelNr t_chan_nr := t_cbch_chan_nr(pars, 0); /* FIXME: TS number */
 	var L1ctlDlMessage dl;
 	timer T := 5.0;
 
@@ -403,7 +406,7 @@
 
 	T.start;
 	alt {
-	[] L1CTL.receive(tr_L1CTL_DATA_IND(t_chan_nr)) -> value dl {
+	[] L1CTL.receive(tr_L1CTL_DATA_IND(pars.chan_nr)) -> value dl {
 		var integer tb := f_cbch_fn2tb(dl.dl_info.frame_nr);
 		log("CBCH: ", dl);
 		var CBCH_Block cb := dec_CBCH_Block(dl.payload.data_ind.payload);
@@ -436,7 +439,6 @@
 	[] T.timeout {}
 	}
 
-	f_smscb_cleanup();
 	/* don't shut down; some tests still want to continue */
 }
 
@@ -505,7 +507,7 @@
 /* transmit single-block SMSCB COMMAND */
 testcase TC_sms_cb_cmd_sdcch4_1block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_1b_norm)),
 		extended := omit
 	};
@@ -513,7 +515,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_1block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_1b_norm)),
 		extended := omit
 	};
@@ -523,7 +525,7 @@
 /* transmit dual-block SMSCB COMMAND */
 testcase TC_sms_cb_cmd_sdcch4_2block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_2b_norm)),
 		extended := omit
 	};
@@ -531,7 +533,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_2block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_2b_norm)),
 		extended := omit
 	};
@@ -541,7 +543,7 @@
 /* transmit triple-block SMSCB COMMAND */
 testcase TC_sms_cb_cmd_sdcch4_3block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm)),
 		extended := omit
 	};
@@ -549,7 +551,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_3block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm)),
 		extended := omit
 	};
@@ -559,7 +561,7 @@
 /* transmit quad-block SMSCB COMMAND */
 testcase TC_sms_cb_cmd_sdcch4_4block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_4b_norm)),
 		extended := omit
 	};
@@ -567,7 +569,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_4block() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_4b_norm)),
 		extended := omit
 	};
@@ -577,7 +579,7 @@
 /* transmit multiple commands of each 4 blocks */
 testcase TC_sms_cb_cmd_sdcch4_multi() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_3m_4b_norm)),
 		extended := omit
 	};
@@ -585,7 +587,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_multi() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_3m_4b_norm)),
 		extended := omit
 	};
@@ -595,7 +597,7 @@
 /* transmit multiple commands of each 4 blocks on CBCH EXTD */
 testcase TC_sms_cb_cmd_sdcch4_extd_multi() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC({})),
 		extended := valueof(t_CbchPC(msgs_3m_4b_norm))
 	};
@@ -603,7 +605,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_extd_multi() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC({})),
 		extended := valueof(t_CbchPC(msgs_3m_4b_norm))
 	};
@@ -613,7 +615,7 @@
 /* transmit SMSCB COMMAND with SCHEDULE payload */
 testcase TC_sms_cb_cmd_sdcch4_schedule() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_4b_sched)),
 		extended := omit
 	};
@@ -621,7 +623,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_schedule() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := false,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_4b_sched)),
 		extended := omit
 	};
@@ -631,7 +633,7 @@
 /* set a DEFAULT message; verify it gets transmitted all the time */
 testcase TC_sms_cb_cmd_sdcch4_default_only() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_default)),
 		extended := omit
 	};
@@ -640,7 +642,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_default_only() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_default)),
 		extended := omit
 	};
@@ -650,7 +652,7 @@
 
 testcase TC_sms_cb_cmd_sdcch4_default_and_normal() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm, msg_default)),
 		extended := omit
 	};
@@ -658,7 +660,7 @@
 }
 testcase TC_sms_cb_cmd_sdcch8_default_and_normal() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH8(2)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm, msg_default)),
 		extended := omit
 	};
@@ -668,7 +670,7 @@
 /* first set a DEFAULT message, then disable it again */
 testcase TC_sms_cb_cmd_sdcch4_default_then_null() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_default)),
 		extended := omit
 	};
@@ -772,17 +774,17 @@
 		}
 		}
 	}
-	f_smscb_cleanup();
+
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 testcase TC_cbc_sdcch4_load_idle() runs on test_CT {
 	f_init_vty_bsc();
-	f_vty_cbch_setup(use_sdcch4 := true);
+	f_vty_cbch_setup(valueof(ts_RslChanNr_CBCH4(0)));
 	f_TC_cbc_load_idle();
 }
 testcase TC_cbc_sdcch8_load_idle() runs on test_CT {
 	f_init_vty_bsc();
-	f_vty_cbch_setup(use_sdcch4 := false);
+	f_vty_cbch_setup(valueof(ts_RslChanNr_CBCH8(2)));
 	f_TC_cbc_load_idle();
 }
 
@@ -853,29 +855,29 @@
 		}
 		}
 	}
-	f_smscb_cleanup();
+
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 testcase TC_cbc_sdcch4_load_overload() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(0)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm)),
 		extended := omit
 	};
 
 	f_init_vty_bsc();
-	f_vty_cbch_setup(use_sdcch4 := true);
+	f_vty_cbch_setup(pars.chan_nr);
 	f_TC_cbc_load_overload(pars);
 }
 testcase TC_cbc_sdcch8_load_overload() runs on test_CT {
 	var CbchTestPars pars := {
-		use_sdcch4 := true,
+		chan_nr := valueof(ts_RslChanNr_CBCH4(2)),
 		basic := valueof(t_CbchPC(msgs_1m_3b_norm)),
 		extended := omit
 	};
 
 	f_init_vty_bsc();
-	f_vty_cbch_setup(use_sdcch4 := true);
+	f_vty_cbch_setup(pars.chan_nr);
 	f_TC_cbc_load_overload(pars);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19475
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: I130a028df7dc476ab765733261a1f007f19f39a8
Gerrit-Change-Number: 19475
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200731/f9b29d73/attachment.htm>


More information about the gerrit-log mailing list