Change in ...osmo-msc[master]: msc_vlr_tests: GSUP: don't care about extra IEs

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

neels gerrit-no-reply at lists.osmocom.org
Thu Aug 29 23:16:33 UTC 2019


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/15343


Change subject: msc_vlr_tests: GSUP: don't care about extra IEs
......................................................................

msc_vlr_tests: GSUP: don't care about extra IEs

To not break the msc_vlr tests by new GSUP IEs added to some of the GSUP
messages, make msc_vlr_tests only match the start of the GSUP message and not
care about extra IEs. The extra IEs are anyway seen in the expected logs.

The reason to drop the msgb_eq_data_print() is because it is useless for
mismatching lengths. It will always print only the length mismatch, instead we
need to be able to compare with what was expected.

Change-Id: I38d51eeafab04ece83e4bb87bfaa967506f97b11
---
M tests/msc_vlr/msc_vlr_tests.c
1 file changed, 9 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/15343/1

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 4ccaee9..3d69ae8 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -746,8 +746,16 @@
 	if (len < 1)
 		abort();
 
-	if (!msgb_eq_data_print(msg, buf, len))
+	/* Compare only the length expected. Extra data is fine, to not care about new GSUP IEs invented later. */
+	if (msg->len < len) {
+		fprintf(stderr, "ERROR: GSUP message too short, expected '%s'\n", gsup_tx_expected);
 		abort();
+	}
+
+	if (memcmp(msg->data, buf, len)) {
+		fprintf(stderr, "ERROR: GSUP message mismatch, expected it to start with '%s'\n", gsup_tx_expected);
+		abort();
+	}
 
 	talloc_free(msg);
 	gsup_tx_confirmed = true;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15343
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I38d51eeafab04ece83e4bb87bfaa967506f97b11
Gerrit-Change-Number: 15343
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190829/ecbf18e3/attachment.htm>


More information about the gerrit-log mailing list