msc_vlr_tests: confirm crcx by RAN/CN side separately

Related: SYS#5066
Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
Neels Hofmeyr 11 months ago
parent 085ebdb763
commit 229f9e0bf0
  1. 20
      tests/msc_vlr/msc_vlr_test_call.c
  2. 25
      tests/msc_vlr/msc_vlr_tests.c
  3. 2
      tests/msc_vlr/msc_vlr_tests.h

@ -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);

@ -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)

@ -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);

Loading…
Cancel
Save