[PATCH] osmo-bsc[master]: gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx

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
Sun Oct 1 03:35:27 UTC 2017


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/4116

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

gsm0408_test: Verify that BA-IND is 0 in SI2xxx and 1 in SI5xxx

This adds a test case to explicitly verify the BA-IND is as expected
by the behaviour introduced in Change-Id I1cd0dc51026dcd0e508e63eea4e333e6b184787a

Related: OS#2525
Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59
---
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
2 files changed, 70 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/4116/2

diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index d5a5363..72a1772 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -647,6 +647,67 @@
 	VERIFY(f0, ==, 1);
 }
 
+static void test_si_ba_ind(void)
+{
+	struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL);
+	struct gsm_bts *bts = gsm_bts_alloc(network, 0);
+	const struct gsm48_system_information_type_2 *si2 =
+		(struct gsm48_system_information_type_2 *) GSM_BTS_SI(bts, SYSINFO_TYPE_2);
+	const struct gsm48_system_information_type_2bis *si2bis =
+		(struct gsm48_system_information_type_2bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_2bis);
+	const struct gsm48_system_information_type_2ter *si2ter =
+		(struct gsm48_system_information_type_2ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_2ter);
+	const struct gsm48_system_information_type_5 *si5 =
+		(struct gsm48_system_information_type_5 *) GSM_BTS_SI(bts, SYSINFO_TYPE_5);
+	const struct gsm48_system_information_type_5bis *si5bis =
+		(struct gsm48_system_information_type_5bis *) GSM_BTS_SI(bts, SYSINFO_TYPE_5bis);
+	const struct gsm48_system_information_type_5ter *si5ter =
+		(struct gsm48_system_information_type_5ter *) GSM_BTS_SI(bts, SYSINFO_TYPE_5ter);
+
+	int rc;
+
+	bts->network = network;
+	bts->c0->arfcn = 23;
+
+	printf("Testing if BA-IND is set as expected in SI2xxx and SI5xxx\n");
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_2);
+	OSMO_ASSERT(rc > 0);
+	printf("SI2: %s\n", osmo_hexdump((uint8_t *)si2, rc));
+	/* Validate BA-IND == 0 */
+	OSMO_ASSERT(!(si2->bcch_frequency_list[0] & 0x10));
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_2bis);
+	OSMO_ASSERT(rc > 0);
+	printf("SI2bis: %s\n", osmo_hexdump((uint8_t *)si2bis, rc));
+	/* Validate BA-IND == 0 */
+	OSMO_ASSERT(!(si2bis->bcch_frequency_list[0] & 0x10));
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_2ter);
+	OSMO_ASSERT(rc > 0);
+	printf("SI2ter: %s\n", osmo_hexdump((uint8_t *)si2ter, rc));
+	/* Validate BA-IND == 0 */
+	OSMO_ASSERT(!(si2ter->ext_bcch_frequency_list[0] & 0x10));
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_5);
+	OSMO_ASSERT(rc > 0);
+	printf("SI5: %s\n", osmo_hexdump((uint8_t *)si5, rc));
+	/* Validate BA-IND == 1 */
+	OSMO_ASSERT(si5->bcch_frequency_list[0] & 0x10);
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_5bis);
+	OSMO_ASSERT(rc > 0);
+	printf("SI5bis: %s\n", osmo_hexdump((uint8_t *)si5bis, rc));
+	/* Validate BA-IND == 1 */
+	OSMO_ASSERT(si5bis->bcch_frequency_list[0] & 0x10);
+
+	rc = gsm_generate_si(bts, SYSINFO_TYPE_5ter);
+	OSMO_ASSERT(rc > 0);
+	printf("SI5ter: %s\n", osmo_hexdump((uint8_t *)si5ter, rc));
+	/* Validate BA-IND == 1 */
+	OSMO_ASSERT(si5ter->bcch_frequency_list[0] & 0x10);
+}
+
 int main(int argc, char **argv)
 {
 	osmo_init_logging(&log_info);
@@ -666,6 +727,8 @@
 	test_si2q_mu();
 	test_si2q_long();
 
+	test_si_ba_ind();
+
 	printf("Done.\n");
 
 	return EXIT_SUCCESS;
diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok
index 8eba927..d23cebb 100644
--- a/tests/gsm0408/gsm0408_test.ok
+++ b/tests/gsm0408/gsm0408_test.ok
@@ -58,10 +58,6 @@
 Random range test: range 255, max num ARFCNs 22
 Random range test: range 511, max num ARFCNs 18
 Random range test: range 1023, max num ARFCNs 16
-testing RP-Reference wrap
-Allocated reference: 255
-Allocated reference: 0
-Allocated reference: 1
 Test SI2quater UARFCN (same scrambling code and diversity):
 generating SI2quater for 0 EARFCNs and 1 UARFCNs...
 generated valid SI2quater [00/00]: [23] 59 06 07 40 00 25 52 88 0a 7e 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 
@@ -201,4 +197,11 @@
 generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b 
 generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 54 21 27 61 09 59 08 4b b7 2e ca c1 2b 
 generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b 
+Testing if BA-IND is set as expected in SI2xxx and SI5xxx
+SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
+SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 Done.

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3e5b260af97ce96a221e4d51f6c1b41d58817a59
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list