diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-31 09:47:37 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-31 12:49:41 +0100 |
commit | 8657326093b6e1eed8cc24fe62039d70aa27d47d (patch) | |
tree | 4c7d60423f93c5bffdd82f67914799b7923b5f7d | |
parent | a07e38d4bf4298be0f3f9676f8de0c0f8ee534b6 (diff) |
meas: Install the scenario command and test it
-rw-r--r-- | openbsc/src/libmsc/vty_interface_layer3.c | 6 | ||||
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 46593559e..68d9c4498 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -953,8 +953,10 @@ static int config_write_mncc_int(struct vty *vty) { uint16_t meas_port; char *meas_host; + const char *meas_scenario; meas_feed_cfg_get(&meas_host, &meas_port); + meas_scenario = meas_feed_scenario_get(); vty_out(vty, "mncc-int%s", VTY_NEWLINE); vty_out(vty, " default-codec tch-f %s%s", @@ -966,6 +968,9 @@ static int config_write_mncc_int(struct vty *vty) if (meas_port) vty_out(vty, " meas-feed destination %s %u%s", meas_host, meas_port, VTY_NEWLINE); + if (strlen(meas_scenario) > 0) + vty_out(vty, " meas-feed scenario %s%s", + meas_scenario, VTY_NEWLINE); return CMD_SUCCESS; @@ -1138,6 +1143,7 @@ int bsc_vty_init_extra(void) install_element(MNCC_INT_NODE, &mnccint_def_codec_f_cmd); install_element(MNCC_INT_NODE, &mnccint_def_codec_h_cmd); install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd); + install_element(MNCC_INT_NODE, &meas_feed_scenario_cmd); install_element(CFG_LOG_NODE, &log_level_sms_cmd); install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 4adc8e8e2..d87ebde0c 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -296,6 +296,25 @@ class TestVTYNITB(TestVTYGenericBSC): res = self.vty.command("show network") self.assert_(res.startswith('BSC is on Country Code') >= 0) + def testMeasurementFeed(self): + self.vty.enable() + self.vty.command("configure terminal") + self.vty.command("mncc-int") + + res = self.vty.command("write terminal") + self.assertEquals(res.find('meas-feed scenario'), -1) + + self.vty.command("meas-feed scenario bla") + res = self.vty.command("write terminal") + self.assert_(res.find('meas-feed scenario bla') > 0) + + self.vty.command("meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890") + res = self.vty.command("write terminal") + self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890'), -1) + self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz012345'), -1) + self.assert_(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234') > 0) + + class TestVTYBSC(TestVTYGenericBSC): def vty_command(self): |