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

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
Tue Feb 6 17:53:08 UTC 2018


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/6304

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

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/04/6304/3

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index cf95347..d5598e7 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -286,13 +286,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: newpatchset
Gerrit-Change-Id: I2607cb1ac60941dbc22fca532ed2b3738bfbcc63
Gerrit-PatchSet: 3
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