aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-15 15:58:35 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-11-15 16:19:31 +0100
commitd655d10e98c3909d86423c9c4ca8604f16ea61da (patch)
treed26416d15ec32e37c1c4335033e10a5b34b02230
parent5e91debe4eb75dcd4990038fb5da6d8db9ef0eba (diff)
msc_vlr_tests: ciph error: print errno name, not valueneels/mipsel
On mipsel, ENOTSUP seems to be 122 instead of 95, so rather print a string. For fear of non-portable strerror(), do an own switch. Actually, this problem will go away with I73c7cb6a86624695bd9c0f59abb72e2fdc655131 (already merged on master) where A5/3 is fixed an no such error occurs anywhere in the logs. Change-Id: Id2a5eff5a9947212dcca7426bc2fa338dfd6d42f
-rw-r--r--tests/msc_vlr/msc_vlr_test_gsm_ciph.err2
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c21
2 files changed, 20 insertions, 3 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 83723ab13..23b73e997 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -2335,7 +2335,7 @@ DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode
DMM -> CIPHER MODE COMMAND IMSI:901700000004620
DMSC CLASSMARK 2 unknown, assuming MS doesn't support A5/3
DMM IMSI:901700000004620: cannot start ciphering, no intersection between MSC-configured and MS-supported A5 algorithms
-- ERROR sending ciphering mode command: rc=-95
+- ERROR sending ciphering mode command: rc == -ENOTSUP
DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_AUTH}: Failed to send Ciphering Mode Command
- sending LU Reject for IMSI:901700000004620, cause 17
DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_DONE
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index f8551dde7..15720f454 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -779,8 +779,25 @@ static int fake_vlr_tx_ciph_mode_cmd(void *msc_conn_ref, bool umts_aka, bool ret
} else
#endif
rc = msc_vlr_set_ciph_mode(msc_conn_ref, umts_aka, retrieve_imeisv);
- if (rc)
- btw("ERROR sending ciphering mode command: rc=%d", rc);
+ if (rc) {
+ const char *err_str;
+ switch (rc) {
+ case -EINVAL:
+ err_str = "rc == -EINVAL";
+ break;
+ case -ENOTSUP:
+ err_str = "rc == -ENOTSUP";
+ break;
+ default:
+ if (rc < 0)
+ err_str = "rc < 0";
+ else
+ err_str = "rc > 0";
+ break;
+ }
+ btw("ERROR sending ciphering mode command: %s", err_str);
+ }
+
return rc;
}