[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 13:52:33 UTC 2018


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

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_ciph.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
4 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/75/6475/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..e71414f 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");
@@ -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_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: newchange
Gerrit-Change-Id: Ibb6cdf652ff48a5b74a89925fd67f147cedf30b7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list