From d655d10e98c3909d86423c9c4ca8604f16ea61da Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 15 Nov 2018 15:58:35 +0100 Subject: msc_vlr_tests: ciph error: print errno name, not value 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 --- tests/msc_vlr/msc_vlr_test_gsm_ciph.err | 2 +- tests/msc_vlr/msc_vlr_tests.c | 21 +++++++++++++++++++-- 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; } -- cgit v1.2.3