aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-03-14 20:15:24 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-03-14 20:59:37 +0100
commit99805db3c30f5d9b1f6913407545a75ab41d7065 (patch)
treef24628322628f3fbd34255cf9c8fd23f42c7ab92 /openbsc/tests
parent55d172617c2b6df3abdd430bf5751ddbd4420551 (diff)
Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic.
The IMMEDIATE ASSIGN REJECT message contains a wait indicator which tells an MS requesting a channel to wait for a specified amount of time before trying to request a channel again, i.e. the wait indicator controls the T3122 timeout value in the MS. Previously, the wait indicator was fixed to 10 seconds. This is not sufficient if there are a lot of MS requesting channels because the MS will retry too soon. Instead of using a fixed value, maintain a dynamic wait indicator value based on average channel load. The load (used vs. available channels on a BTS) is sampled once per second, and once 8 samples have been collected we update a BTS-specific T3122 wait indicator based on the measured load. While the wait indicator could go up to 255 seconds, this initial implementation keeps it in the range from 10 to 128 seconds. Further experimentation and testing will show whether higher wait indicator values are desirable, if the sampling rate needs to change, or if the function mapping the load measurement to a wait indicator value should change (currently we map the load average linearly into the range [10, 128] inclusive). Port of osmo-bsc commit 6cee893a0f2c4e53155a2631aff12a5f615b973d Change-Id: Id9df0e790ece8108212b2ddf718cf2953f5b9bd4 Related: OS#2592
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/channel/Makefile.am5
-rw-r--r--openbsc/tests/channel/channel_test.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am
index ca470ace4..5fec00af4 100644
--- a/openbsc/tests/channel/Makefile.am
+++ b/openbsc/tests/channel/Makefile.am
@@ -23,6 +23,10 @@ channel_test_SOURCES = \
channel_test.c \
$(NULL)
+channel_test_LDFLAGS = \
+ -Wl,--wrap=paging_request \
+ $(NULL)
+
channel_test_LDADD = \
$(top_builddir)/src/libmsc/libmsc.a \
$(top_builddir)/src/libbsc/libbsc.a \
@@ -30,6 +34,7 @@ channel_test_LDADD = \
$(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
+ $(LIBOSMOABIS_LIBS) \
$(LIBCRYPTO_LIBS) \
-ldbi \
$(NULL)
diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c
index 049786be7..428182f1e 100644
--- a/openbsc/tests/channel/channel_test.c
+++ b/openbsc/tests/channel/channel_test.c
@@ -48,8 +48,10 @@ static int subscr_cb(unsigned int hook, unsigned int event, struct msgb *msg, vo
return 0;
}
-/* mock object for testing, directly invoke the cb... maybe later through the timer */
-int paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, gsm_cbfn *cbfn, void *data)
+/* override, requires '-Wl,--wrap=paging_request'.
+/ mock object for testing, directly invoke the cb... maybe later through the timer */
+int __real_paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, gsm_cbfn *cbfn, void *data);
+int __wrap_paging_request(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, gsm_cbfn *cbfn, void *data)
{
s_data = data;
s_cbfn = cbfn;
@@ -160,13 +162,12 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
-void _abis_nm_sendmsg() {}
void sms_alloc() {}
void sms_free() {}
-void gsm_net_update_ctype(struct gsm_network *network) {}
void gsm48_secure_channel() {}
-void paging_request_stop() {}
void vty_out() {}
+void switch_trau_mux() {}
+void rtp_socket_free() {}
struct tlv_definition nm_att_tlvdef;