aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-05-01 11:40:32 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-28 15:28:02 +0200
commitbc81b6e3f866d7bab187a02849175a4dbc2ee340 (patch)
treef1447edf8cc16d45ad647b9dca9c4bec6bbb032e
parenta4faeb1a79eac3c8d333ded27600228cc5e3a71b (diff)
nitb: Add a test command for stress testing all BTSs
Add a VTY command that will attempt to all allocate all lchans that can provide a SDCCH. This can be used to stress-test a BTS and the radio link timeout and activation/release of it.
-rw-r--r--openbsc/src/libmsc/vty_interface_layer3.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 064eca97b..4b971d1d8 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -30,6 +30,7 @@
#include <arpa/inet.h>
#include <osmocom/core/linuxlist.h>
+#include <openbsc/abis_rsl.h>
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/silent_call.h>
@@ -963,6 +964,35 @@ DEFUN_DEPRECATED(log_level_sms, log_level_sms_cmd,
return CMD_SUCCESS;
}
+DEFUN(allocate_all_channels, allocate_all_channels_cmd,
+ "allocate-all-channels", "Allocate everything for testing\n")
+{
+ struct gsm_network *net = gsmnet_from_vty(vty);
+ struct gsm_bts *bts;
+
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ /* crazy loop... */
+ while (true) {
+ int rc;
+ struct gsm_lchan *lchan;
+
+ lchan = lchan_alloc(bts, GSM_LCHAN_SDCCH, 1);
+ if (!lchan)
+ break;
+
+ rc = rsl_chan_activate_lchan(lchan, 0, 0, 0);
+ if (rc < 0) {
+ lchan_free(lchan);
+ break;
+ }
+
+ rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ);
+ }
+ }
+
+ return CMD_SUCCESS;
+}
+
int bsc_vty_init_extra(void)
{
osmo_signal_register_handler(SS_SCALL, scall_cbfn, NULL);
@@ -996,6 +1026,7 @@ int bsc_vty_init_extra(void)
install_element(ENABLE_NODE, &smsqueue_clear_cmd);
install_element(ENABLE_NODE, &smsqueue_fail_cmd);
install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd);
+ install_element(ENABLE_NODE, &allocate_all_channels_cmd);
install_element(CONFIG_NODE, &cfg_mncc_int_cmd);
install_node(&mncc_int_node, config_write_mncc_int);