summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-05-01 11:40:32 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-08-12 08:56:07 +0200
commit842aec16e6ac00935ee682a20e1796d7961a4d95 (patch)
tree0939a82152b50168b91cf8bbacbd3a95abc0898b
parentd29e1beed70b935083f1583e17f0c14dad6703cd (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 9e7a948da..16048a381 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>
@@ -925,6 +926,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);
@@ -957,6 +987,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);
#if 0
install_element(CONFIG_NODE, &cfg_mncc_int_cmd);