aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-01-14 03:39:58 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-07 02:12:14 +0200
commitdfedf572a3fedb5a1636eab1a8d0b137f29ae146 (patch)
tree15b6a3f7c987125f26d654f3d0eea84de56c89cf
parent3725d6317cc867e0590d750fad1f0bafac44a4a7 (diff)
msc_vlr_tests: confirm crcx by RAN/CN side separately
-rw-r--r--tests/msc_vlr/msc_vlr_test_call.c20
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c25
-rw-r--r--tests/msc_vlr/msc_vlr_tests.h2
3 files changed, 26 insertions, 21 deletions
diff --git a/tests/msc_vlr/msc_vlr_test_call.c b/tests/msc_vlr/msc_vlr_test_call.c
index d169650e3..8dba37918 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -218,7 +218,7 @@ static void test_call_mo()
btw("MNCC replies with MNCC_RTP_CREATE, causing MGW endpoint CRCX to RAN");
expect_crcx(RTP_TO_RAN);
mncc_sends_to_cc(MNCC_RTP_CREATE, &mncc);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_RAN));
btw("MGW acknowledges the CRCX, triggering Assignment");
expect_iu_rab_assignment();
@@ -228,7 +228,7 @@ static void test_call_mo()
btw("Assignment succeeds, triggering CRCX to CN");
expect_crcx(RTP_TO_CN);
ms_sends_assignment_complete(CODEC_AMR_8000_1);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_CN));
btw("CN RTP address is available, trigger MNCC_RTP_CREATE");
cc_to_mncc_expect_tx("", MNCC_RTP_CREATE);
@@ -326,7 +326,7 @@ static void test_call_mt()
"0406600402000581" /* Bearer Capability */
"15020100" /* Call Control Capabilities */
"40080402600400021f00" /* Supported Codec List */);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_RAN));
OSMO_ASSERT(cc_to_mncc_tx_confirmed);
btw("MNCC sends MNCC_RTP_CREATE");
@@ -340,7 +340,7 @@ static void test_call_mt()
btw("Assignment completes, triggering CRCX to CN");
expect_crcx(RTP_TO_CN);
ms_sends_assignment_complete(CODEC_AMR_8000_1);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_CN));
btw("When the CN side RTP address is known, send MNCC_RTP_CREATE");
cc_to_mncc_expect_tx("", MNCC_RTP_CREATE);
@@ -429,7 +429,7 @@ static void test_call_mt2()
"0406600402000581" /* Bearer Capability */
"15020100" /* Call Control Capabilities */
"40080402600400021f00" /* Supported Codec List */);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_RAN));
OSMO_ASSERT(cc_to_mncc_tx_confirmed);
btw("MNCC sends MNCC_RTP_CREATE");
@@ -443,7 +443,7 @@ static void test_call_mt2()
btw("Assignment completes, triggering CRCX to CN");
expect_crcx(RTP_TO_CN);
ms_sends_assignment_complete(CODEC_AMR_8000_1);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_CN));
btw("When the CN side RTP address is known, send MNCC_RTP_CREATE");
cc_to_mncc_expect_tx("", MNCC_RTP_CREATE);
@@ -530,7 +530,7 @@ static void test_call_mo_to_unknown()
btw("MNCC replies with MNCC_RTP_CREATE, causing MGW endpoint CRCX to RAN");
expect_crcx(RTP_TO_RAN);
mncc_sends_to_cc(MNCC_RTP_CREATE, &mncc);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_RAN));
btw("MGW acknowledges the CRCX, triggering Assignment");
expect_iu_rab_assignment();
@@ -540,7 +540,7 @@ static void test_call_mo_to_unknown()
btw("Assignment succeeds, triggering CRCX to CN");
expect_crcx(RTP_TO_CN);
ms_sends_assignment_complete(CODEC_AMR_8000_1);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_CN));
btw("CN RTP address is available, trigger MNCC_RTP_CREATE");
cc_to_mncc_expect_tx("", MNCC_RTP_CREATE);
@@ -626,7 +626,7 @@ static void test_call_mo_to_unknown_timeout()
btw("MNCC replies with MNCC_RTP_CREATE, causing MGW endpoint CRCX to RAN");
expect_crcx(RTP_TO_RAN);
mncc_sends_to_cc(MNCC_RTP_CREATE, &mncc);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_RAN));
btw("MGW acknowledges the CRCX, triggering Assignment");
expect_iu_rab_assignment();
@@ -636,7 +636,7 @@ static void test_call_mo_to_unknown_timeout()
btw("Assignment succeeds, triggering CRCX to CN");
expect_crcx(RTP_TO_CN);
ms_sends_assignment_complete(CODEC_AMR_8000_1);
- OSMO_ASSERT(got_crcx);
+ OSMO_ASSERT(crcx_scheduled(RTP_TO_CN));
btw("CN RTP address is available, trigger MNCC_RTP_CREATE");
cc_to_mncc_expect_tx("", MNCC_RTP_CREATE);
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index e6dabf56b..190fe8a7e 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -85,8 +85,8 @@ const char *cc_to_mncc_tx_expected_imsi = NULL;
bool cc_to_mncc_tx_confirmed = false;
uint32_t cc_to_mncc_tx_got_callref = 0;
-enum rtp_direction expecting_crcx = -1;
-bool got_crcx = false;
+bool expecting_crcx[2] = {};
+bool got_crcx[2] = {};
extern int ran_dec_dtap_undup_pdisc_ctr_bin(uint8_t pdisc);
@@ -641,8 +641,8 @@ void clear_vlr()
osmo_gettimeofday_override = false;
- expecting_crcx = -1;
- got_crcx = false;
+ memset(expecting_crcx, 0, sizeof(expecting_crcx));
+ memset(got_crcx, 0, sizeof(got_crcx));
bssap_assignment_expected = false;
bssap_assignment_sent = false;
@@ -836,9 +836,14 @@ struct rtp_stream fake_rtp[2] = {
void expect_crcx(enum rtp_direction towards)
{
- OSMO_ASSERT(expecting_crcx == -1);
- expecting_crcx = towards;
- got_crcx = false;
+ OSMO_ASSERT(!expecting_crcx[towards]);
+ expecting_crcx[towards] = true;
+ got_crcx[towards] = false;
+}
+
+bool crcx_scheduled(enum rtp_direction towards)
+{
+ return got_crcx[towards];
}
/* override, requires '-Wl,--wrap=call_leg_ensure_ci' */
@@ -853,9 +858,9 @@ int __wrap_call_leg_ensure_ci(struct call_leg *cl, enum rtp_direction dir, uint3
log("MGW <--CRCX to %s-- MSC: callref=0x%x codecs=%s", rtp_direction_name(dir), call_id,
codecs_if_known ? sdp_audio_codecs_to_str(codecs_if_known) : "unset");
- OSMO_ASSERT(expecting_crcx == dir);
- expecting_crcx = -1;
- got_crcx = true;
+ OSMO_ASSERT(expecting_crcx[dir]);
+ expecting_crcx[dir] = false;
+ got_crcx[dir] = true;
call_leg_ensure_rtp_alloc(cl, dir, call_id, for_trans);
if (codecs_if_known)
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index 1f83013b0..e054b9acf 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -275,5 +275,5 @@ extern const struct timeval fake_time_start_time;
#define EUSE_TO_MSC_USSD "0a0103"
#define MSC_USSD_TO_EUSE "0a0103"
-extern bool got_crcx;
void expect_crcx(enum rtp_direction towards);
+bool crcx_scheduled(enum rtp_direction towards);