aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msc_vlr/msc_vlr_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/msc_vlr/msc_vlr_tests.c')
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 6da34aed6..a45b10fbb 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -59,6 +59,11 @@ const char *auth_request_expect_autn;
bool cipher_mode_cmd_sent;
bool cipher_mode_cmd_sent_with_imeisv;
+bool iu_release_expected = false;
+bool iu_release_sent = false;
+bool bssap_clear_expected = false;
+bool bssap_clear_sent = false;
+
struct msgb *msgb_from_hex(const char *label, uint16_t size, const char *hex)
{
struct msgb *msg = msgb_alloc(size, label);
@@ -149,7 +154,6 @@ struct gsm_subscriber_connection *conn_new(void)
if (conn->via_ran == RAN_UTRAN_IU) {
struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx);
*ue_ctx = (struct ue_conn_ctx){
- .link = (void*)0x23,
.conn_id = 42,
};
conn->iu.ue_ctx = ue_ctx;
@@ -298,9 +302,9 @@ int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac)
return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac);
}
-/* override, requires '-Wl,--wrap=a_page' */
-int __real_a_page(const char *imsi, uint32_t tmsi, uint16_t lac);
-int __wrap_a_page(const char *imsi, uint32_t tmsi, uint16_t lac)
+/* override, requires '-Wl,--wrap=a_iface_tx_paging' */
+int __real_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac);
+int __wrap_a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac)
{
return _paging_sent(RAN_GERAN_A, imsi, tmsi, lac);
}
@@ -333,6 +337,11 @@ void clear_vlr()
next_rand_byte = 0;
+ iu_release_expected = false;
+ iu_release_sent = false;
+ bssap_clear_expected = false;
+ bssap_clear_sent = false;
+
osmo_gettimeofday_override = false;
}
@@ -475,6 +484,9 @@ int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *caus
int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause)
{
btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU));
+ OSMO_ASSERT(iu_release_expected);
+ iu_release_expected = false;
+ iu_release_sent = true;
return 0;
}
@@ -486,13 +498,24 @@ int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi)
return 0;
}
-/* override, requires '-Wl,--wrap=a_tx' */
-int __real_a_tx(struct msgb *msg, uint8_t sapi);
-int __wrap_a_tx(struct msgb *msg, uint8_t sapi)
+/* override, requires '-Wl,--wrap=a_iface_tx_dtap' */
+int __real_a_iface_tx_dtap(struct msgb *msg);
+int __wrap_a_iface_tx_dtap(struct msgb *msg)
{
return _validate_dtap(msg, RAN_GERAN_A);
}
+/* override, requires '-Wl,--wrap=a_iface_tx_clear_cmd' */
+int __real_a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn);
+int __wrap_a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn)
+{
+ btw("BSSAP Clear --%s--> MS", ran_type_name(RAN_GERAN_A));
+ OSMO_ASSERT(bssap_clear_expected);
+ bssap_clear_expected = false;
+ bssap_clear_sent = true;
+ return 0;
+}
+
static int fake_vlr_tx_lu_acc(void *msc_conn_ref, uint32_t send_tmsi)
{
struct gsm_subscriber_connection *conn = msc_conn_ref;