meas: Install the scenario command and test it
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 4659355..68d9c44 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -953,8 +953,10 @@
 {
 	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 @@
 	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 @@
 	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 4adc8e8..d87ebde 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -296,6 +296,25 @@
         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):