[PATCH] osmo-msc[master]: VLR tests: expand ID RESP generator

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

Max gerrit-no-reply at lists.osmocom.org
Thu Feb 15 14:12:42 UTC 2018


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/6475

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

VLR tests: expand ID RESP generator

Use it for IMEI as well.

Change-Id: Ibb6cdf652ff48a5b74a89925fd67f147cedf30b7
Related: OS#2864
---
M tests/msc_vlr/msc_vlr_test_gsm_authen.c
M tests/msc_vlr/msc_vlr_test_gsm_ciph.c
M tests/msc_vlr/msc_vlr_test_no_authen.c
M tests/msc_vlr/msc_vlr_test_rest.c
M tests/msc_vlr/msc_vlr_tests.c
M tests/msc_vlr/msc_vlr_tests.h
6 files changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/75/6475/2

diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
index e9eacf0..660a38b 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
@@ -560,7 +560,7 @@
 
 	btw("MS replies with an Identity Response");
 	expect_bssap_clear();
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 	VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
 	btw("LU was successful, and the conn has already been closed");
@@ -657,7 +657,7 @@
 	thwart_rx_non_initial_requests();
 
 	btw("MS replies with an Identity Response");
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 
 	btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
 	EXPECT_CONN_COUNT(1);
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
index 407f077..09c8369 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
@@ -550,7 +550,7 @@
 
 	btw("MS replies with an Identity Response");
 	expect_bssap_clear();
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 	VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
 	btw("LU was successful, and the conn has already been closed");
@@ -748,7 +748,7 @@
 	thwart_rx_non_initial_requests();
 
 	btw("MS replies with an Identity Response");
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 
 	btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
 	EXPECT_CONN_COUNT(1);
@@ -805,7 +805,7 @@
 	btw("MS tells us the IMSI, causes a GSUP LU request to HLR");
 	gsup_expect_tx("04010809710000004026f0");
 
-	tx_identity_resp(imsi, 1);
+	tx_identity_resp(imsi, GSM_MI_TYPE_IMSI, 1);
 
 	OSMO_ASSERT(gsup_tx_confirmed);
 	VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.c b/tests/msc_vlr/msc_vlr_test_no_authen.c
index b744827..55c14cd 100644
--- a/tests/msc_vlr/msc_vlr_test_no_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_no_authen.c
@@ -424,7 +424,7 @@
 	expect_bssap_clear();
 	/* 3GPP TS 23.003: 6.2.1 Composition of IMEI: the IMEI ends with a
 	 * spare digit that shall be sent as zero by the MS. */
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 	VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
 	btw("LU was successful, and the conn has already been closed");
@@ -489,7 +489,7 @@
 	thwart_rx_non_initial_requests();
 
 	btw("MS replies with an Identity Response");
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 
 	btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
 	EXPECT_CONN_COUNT(1);
@@ -637,7 +637,7 @@
 
 	btw("MS replies with an Identity Response");
 	expect_bssap_clear();
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 	VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
 	btw("LU was successful, and the conn has already been closed");
@@ -851,7 +851,7 @@
 	thwart_rx_non_initial_requests();
 
 	btw("MS replies with an Identity Response");
-	ms_sends_msg("0559084a32244332244302");
+	tx_identity_resp("423423423423420", GSM_MI_TYPE_IMEI, 1);
 
 	btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl");
 	EXPECT_CONN_COUNT(1);
diff --git a/tests/msc_vlr/msc_vlr_test_rest.c b/tests/msc_vlr/msc_vlr_test_rest.c
index 7945ed2..8bf8c3a 100644
--- a/tests/msc_vlr/msc_vlr_test_rest.c
+++ b/tests/msc_vlr/msc_vlr_test_rest.c
@@ -166,7 +166,7 @@
 	btw("MS tells us the IMSI, causes a GSUP LU request to HLR");
 	gsup_expect_tx("04010809710000004026f0");
 
-	tx_identity_resp(imsi, 1);
+	tx_identity_resp(imsi, GSM_MI_TYPE_IMSI, 1);
 
 	OSMO_ASSERT(gsup_tx_confirmed);
 	VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 6bebcab..c3d3d37 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -744,7 +744,7 @@
 }
 
 /* Transmit 3GPP TS 24.008 §9.2.11 Identity Response with proper Sequence number */
-void tx_identity_resp(const char *imsi, uint8_t seq)
+void tx_identity_resp(const char *imsi, uint8_t mi_type, uint8_t seq)
 {
 	struct msgb *msg = gsm48_msgb_alloc_name("3GPP TS 24.008 ID RESP");
 	struct gsm48_hdr *gh;
@@ -754,7 +754,7 @@
 	gh->proto_discr = GSM48_PDISC_MM;
 	gh->msg_type = (seq << 6) | GSM48_MT_MM_ID_RESP;
 
-	len = gsm48_generate_mid_from_imsi(mi, imsi) - 1;
+	len = gsm48_generate_mid(mi, imsi, mi_type) - 1;
 
 	msgb_get_u8(msg);
 
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index d1b27e7..a59b5d9 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -134,7 +134,7 @@
 void dtap_expect_tx_ussd(char *ussd_text);
 void paging_expect_imsi(const char *imsi);
 void paging_expect_tmsi(uint32_t tmsi);
-void tx_identity_resp(const char *imsi, uint8_t seq);
+void tx_identity_resp(const char *imsi, uint8_t mi_type, uint8_t seq);
 void ms_sends_msg(const char *hex);
 void ms_sends_security_mode_complete();
 void gsup_rx(const char *rx_hex, const char *expect_tx_hex);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibb6cdf652ff48a5b74a89925fd67f147cedf30b7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list