[MERGED] osmo-msc[master]: VLR tests: don't fail via assert

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 8 09:28:51 UTC 2018

Harald Welte has submitted this change and it was merged.

Change subject: VLR tests: don't fail via assert

VLR tests: don't fail via assert

Don't fail tests using thwart_rx_non_initial_requests() via
OSMO_ASSERT. Instead log extended error which will fail the test
eventually but allows to gather additional info helpful for debugging.

Change-Id: I2607cb1ac60941dbc22fca532ed2b3738bfbcc63
Related: OS#2864
M tests/msc_vlr/msc_vlr_tests.c
1 file changed, 13 insertions(+), 4 deletions(-)

  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 0d4656e..f373f1e 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -268,13 +268,22 @@
 	return rc;
+static inline void ms_msg_log_err(uint8_t val, uint8_t msgtype)
+	int rc = ms_sends_msg_fake(val, msgtype);
+	if (rc != -EACCES)
+		log("Unexpected return value %u != %u for %s/%s",
+		    -rc, -EACCES, gsm48_pdisc_name(val), gsm48_cc_msg_name(msgtype));
 void thwart_rx_non_initial_requests()
 	log("requests shall be thwarted");
-	OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_CC, GSM48_MT_CC_SETUP) == -EACCES);
-	OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_MM, 0x33 /* nonexistent */) == -EACCES);
-	OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_RR, GSM48_MT_RR_SYSINFO_1) == -EACCES);
-	OSMO_ASSERT(ms_sends_msg_fake(GSM48_PDISC_SMS, GSM411_MT_CP_DATA) == -EACCES);
+	ms_msg_log_err(GSM48_PDISC_CC, GSM48_MT_CC_SETUP);
+	ms_msg_log_err(GSM48_PDISC_MM, 0x33); /* nonexistent */
+	ms_msg_log_err(GSM48_PDISC_RR, GSM48_MT_RR_SYSINFO_1);
+	ms_msg_log_err(GSM48_PDISC_SMS, GSM411_MT_CP_DATA);
 void send_sms(struct vlr_subscr *receiver,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2607cb1ac60941dbc22fca532ed2b3738bfbcc63
Gerrit-PatchSet: 5
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>

More information about the gerrit-log mailing list