aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-26 01:11:57 +0100
committerHarald Welte <laforge@gnumonks.org>2019-09-02 11:07:49 +0200
commitbe5f03347578920d7b810e3de499d030377a12c4 (patch)
tree451721acb3f542e6258f57d606a5d73c5c17adfa
parent38816dab97d2b8c6187ee1e43691e8138ababe2f (diff)
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
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 4ccaee9b1..3d69ae865 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -746,8 +746,16 @@ int __wrap_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *ms
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;