Change in osmo-bsc[master]: gsm0408_test.c: drop test_mi_functionality()

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

neels gerrit-no-reply at lists.osmocom.org
Sun Jun 7 20:41:11 UTC 2020


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18648 )

Change subject: gsm0408_test.c: drop test_mi_functionality()
......................................................................

gsm0408_test.c: drop test_mi_functionality()

Testing these functions is actually done in libosmocore. Also, with new
osmo_mobile_identity API, the functions being tested are marked deprecated. So
drop the test.

BTW, the test contained an IMSI of 16 digits, which is too long, yet was
expected to succeed. GSM23003_IMSI_MAX_DIGITS == 15. I first considered fixing
the test data, but the test is in the wrong place here anyway.

Change-Id: I902d31ecd72d71892fad7945f695a9f1fb403bf2
---
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
2 files changed, 0 insertions(+), 33 deletions(-)

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



diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index f850274..5ff9491 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -269,34 +269,6 @@
 	bts_del(bts);
 }
 
-static void test_mi_functionality(void)
-{
-	const char *imsi_odd  = "987654321098763";
-	const char *imsi_even = "9876543210987654";
-	const uint32_t tmsi = 0xfabeacd0;
-	uint8_t mi[128];
-	unsigned int mi_len;
-	char mi_parsed[GSM48_MI_SIZE];
-
-	printf("Testing parsing and generating TMSI/IMSI\n");
-
-	/* tmsi code */
-	mi_len = gsm48_generate_mid_from_tmsi(mi, tmsi);
-	gsm48_mi_to_string(mi_parsed, sizeof(mi_parsed), mi + 2, mi_len - 2);
-	COMPARE((uint32_t)strtoul(mi_parsed, NULL, 10), ==, tmsi);
-
-	/* imsi code */
-	mi_len = gsm48_generate_mid_from_imsi(mi, imsi_odd);
-	gsm48_mi_to_string(mi_parsed, sizeof(mi_parsed), mi + 2, mi_len -2);
-	printf("hex: %s\n", osmo_hexdump(mi, mi_len));
-	COMPARE_STR(mi_parsed, imsi_odd);
-
-	mi_len = gsm48_generate_mid_from_imsi(mi, imsi_even);
-	gsm48_mi_to_string(mi_parsed, sizeof(mi_parsed), mi + 2, mi_len -2);
-	printf("hex: %s\n", osmo_hexdump(mi, mi_len));
-	COMPARE_STR(mi_parsed, imsi_even);
-}
-
 struct {
 	int range;
 	int arfcns_num;
@@ -924,8 +896,6 @@
 		return EXIT_FAILURE;
 	}
 
-	test_mi_functionality();
-
 	test_si_range_helpers();
 	test_arfcn_filter();
 	test_print_encoding();
diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok
index e3290b5..bad8aef 100644
--- a/tests/gsm0408/gsm0408_test.ok
+++ b/tests/gsm0408/gsm0408_test.ok
@@ -1,6 +1,3 @@
-Testing parsing and generating TMSI/IMSI
-hex: 17 08 99 78 56 34 12 90 78 36 
-hex: 17 09 91 78 56 34 12 90 78 56 f4 
 Element is: 2 => freqs[i] = 121
 Element is: 2 => freqs[i] = 1
 Element is: 0 => freqs[i] = 68

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I902d31ecd72d71892fad7945f695a9f1fb403bf2
Gerrit-Change-Number: 18648
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
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/20200607/a178dc58/attachment.htm>


More information about the gerrit-log mailing list