Change in osmo-ttcn3-hacks[master]: msc: expect only one Paging on failed MT SMS, and clear the failed SMS

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Mar 8 04:05:38 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13192


Change subject: msc: expect only one Paging on failed MT SMS, and clear the failed SMS
......................................................................

msc: expect only one Paging on failed MT SMS, and clear the failed SMS

An MSC should not repeat Paging Requests to the BSC. Retries of Paging are
clearly the task of the BSC.

The reason current osmo-msc sends so many Pagings for a single failed SMS is a
quirk in the sms_queue.c code.

An sms_queue.c fix that will make this change pass is in osmo-msc
I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49

After this quirk is fixed, the failed SMS attempts are not exhausted, and the
pending SMS will re-appear in subsequent tests, breaking their flow (e.g.
during subsequent Location Updating, an unexpected DTAP comes up).  For this
reason, we need to actually remove the SMS from the SMS database and the queue
with a new VTY command: The vty command to clear failed SMS from the db follows
in osmo-msc I637cbd7adc075a192f49752b38779391472ff06d

Depends: I24bf9f1c1167efe1080ae4cf47ed2ef0bd981e49 (osmo-msc)
         I637cbd7adc075a192f49752b38779391472ff06d (osmo-msc)
Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e
---
M msc/MSC_Tests.ttcn
1 file changed, 17 insertions(+), 37 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/92/13192/1

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 31a7401..2957e3c 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1979,6 +1979,13 @@
 	f_vty_transceive(MSCVTY, "subscriber imsi "&imsi&" sms sender msisdn "&msisdn&" send "&text);
 }
 
+/* Remove still pending SMS */
+private function f_vty_sms_clear(charstring imsi)
+runs on BSC_ConnHdlr {
+	f_vty_transceive(MSCVTY, "subscriber imsi " & imsi & " sms delete-all");
+	f_vty_transceive(MSCVTY, "sms-queue clear");
+}
+
 /* LU followed by MT SMS */
 private function f_tc_lu_and_mt_sms(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
@@ -2022,7 +2029,6 @@
 private function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	var SmsParameters spars := valueof(t_SmsPars);
 	var OCT4 tmsi;
-	var integer page_count := 0;
 	f_init_handler(pars, 150.0);
 
 	/* Perform location update */
@@ -2038,21 +2044,8 @@
 
 	f_vty_sms_send(hex2str(pars.imsi), "2342", "Hello SMS");
 
-	/* Expect the MSC to page exactly 10 times before giving up */
-	alt {
-		[] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi))
-		{
-			page_count := page_count + 1;
-
-			if (page_count < 10) {
-				repeat;
-			}
-		}
-		[] BSSAP.receive {
-			setverdict(fail, "unexpected BSSAP message received");
-			self.stop;
-		}
-	}
+	/* Expect the MSC to page exactly once */
+	BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { };
 
 	/* Wait some time to make sure the MSC is not delivering any further
 	 * paging messages or anything else that could be unexpected. */
@@ -2073,6 +2066,8 @@
 		}
 	}
 
+	f_vty_sms_clear(hex2str(g_pars.imsi));
+
 	setverdict(pass);
 }
 testcase TC_lu_and_mt_sms_paging_and_nothing() runs on MTC_CT {
@@ -4331,21 +4326,8 @@
 	/* Trigger SMS via VTY */
 	f_vty_sms_send_conn_hdlr(hex2str(pars.imsi), "2342", "Hello SMS");
 
-	/* Expect the MSC/VLR to page exactly 10 times before giving up */
-	alt {
-		[] SGsAP.receive(exp_pag_req)
-		{
-			page_count := page_count + 1;
-
-			if (page_count < 10) {
-				repeat;
-			}
-		}
-		[] SGsAP.receive {
-			setverdict(fail, "unexpected SGsAP message received");
-			self.stop;
-		}
-	}
+	/* Expect the MSC/VLR to page exactly once */
+	SGsAP.receive(exp_pag_req);
 
 	/* Wait some time to make sure the MSC is not delivering any further
 	 * paging messages or anything else that could be unexpected. */
@@ -4373,8 +4355,8 @@
 	 * MSC/VLR would re-try to deliver the test SMS trigered above and
 	 * so the screening would fail. */
 
-	/* Expire the subscriber now to avoid that the MSC will try the SMS
-	 * delivery at some later point. */
+	f_vty_sms_clear(hex2str(g_pars.imsi));
+
 	f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire");
 
 	setverdict(pass);
@@ -4429,16 +4411,14 @@
 		}
 	}
 
+	f_vty_sms_clear(hex2str(g_pars.imsi));
+
 	/* A rejected paging with IMSI_unknown (see above) should always send
 	 * the SGs association to NULL. */
 	f_ctrl_get_exp(IPA_CTRL, "fsm.SGs-UE.id.imsi:" & hex2str(g_pars.imsi) & ".state", "SGs-NULL");
 
 	f_sgsap_bssmap_screening();
 
-	/* Expire the subscriber now to avoid that the MSC will try the SMS
-	 * delivery at some later point. */
-	f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " expire");
-
 	setverdict(pass);
 }
 testcase TC_sgsap_mt_sms_and_reject() runs on MTC_CT {

-- 
To view, visit https://gerrit.osmocom.org/13192
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dce12942a65eaaf97f78ca69401c7f93faacb9e
Gerrit-Change-Number: 13192
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190308/06e359b1/attachment.html>


More information about the gerrit-log mailing list