neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/31699 )


Change subject: msc_vlr_tests: confirm crcx by RAN/CN side separately
......................................................................

msc_vlr_tests: confirm crcx by RAN/CN side separately

Upcoming patch 'do CN CRCX first' changes the ordering of MGCP. To
properly show the change in behavior in the msc_vlr_test_call, first
clarify which side is expected to do MGCP when.

Related: SYS#5066
Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
---
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_tests.c
M tests/msc_vlr/msc_vlr_tests.h
3 files changed, 40 insertions(+), 21 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/31699/1

diff --git a/tests/msc_vlr/msc_vlr_test_call.c 
b/tests/msc_vlr/msc_vlr_test_call.c
index ab92433..84614dc 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -218,7 +218,7 @@
        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 @@
        btw("Assignment succeeds, triggering CRCX to CN");
        expect_crcx(RTP_TO_CN);
        ms_sends_assignment_complete("AMR");
-       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);
@@ -351,7 +351,7 @@
                     "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");
@@ -365,7 +365,7 @@
        btw("Assignment completes, triggering CRCX to CN");
        expect_crcx(RTP_TO_CN);
        ms_sends_assignment_complete("AMR");
-       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);
@@ -472,7 +472,7 @@
                     "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");
@@ -486,7 +486,7 @@
        btw("Assignment completes, triggering CRCX to CN");
        expect_crcx(RTP_TO_CN);
        ms_sends_assignment_complete("AMR");
-       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);
@@ -573,7 +573,7 @@
        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();
@@ -583,7 +583,7 @@
        btw("Assignment succeeds, triggering CRCX to CN");
        expect_crcx(RTP_TO_CN);
        ms_sends_assignment_complete("AMR");
-       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);
@@ -669,7 +669,7 @@
        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();
@@ -679,7 +679,7 @@
        btw("Assignment succeeds, triggering CRCX to CN");
        expect_crcx(RTP_TO_CN);
        ms_sends_assignment_complete("AMR");
-       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 646633c..2300319 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -85,8 +85,8 @@
 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);

@@ -651,8 +651,8 @@

        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;
@@ -846,9 +846,14 @@

 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' */
@@ -863,9 +868,9 @@
                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 1a57101..737541a 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -275,5 +275,5 @@
 #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);

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/31699
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
Gerrit-Change-Number: 31699
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-MessageType: newchange

Reply via email to