[PATCH] openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly

2017-09-13 Thread Neels Hofmeyr
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3921

to look at the new patch set (#2).

fix vty tests: vty no longer goes to parent node implicitly

Fix four instances of VTY tests working because it used to include implicit
'exit' commands to the parent node.

Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit
d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in
interactive VTY shells.

*) the nitb node lacked the default command set (including 'end' and 'exit'),
so it was impossible to leave the nitb node. This hit in
testSubscriberCreateDelete. Add vty_install_default(NITB_NODE).

*) in testPingPongConfiguration, the intention is to enter the /msc 0 node.
Drop prior entry of the 'network' node, which looks like an oversight. So
far the 'msc 0' caused an implicit 'exit' and thus worked, now fails.

*) Two instances following comments "# Check searching for outer node's
commands", which look like they are intended to check for this implicit-exit
behavior. This is obsolete, drop those parts of the tests.

Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab
---
M openbsc/src/libmsc/vty_interface_layer3.c
M openbsc/tests/vty_test_runner.py
2 files changed, 1 insertion(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/3921/2

diff --git a/openbsc/src/libmsc/vty_interface_layer3.c 
b/openbsc/src/libmsc/vty_interface_layer3.c
index 4a99cf1..f66769b 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -1294,6 +1294,7 @@
 
install_element(CONFIG_NODE, _nitb_cmd);
install_node(_node, config_write_nitb);
+   vty_install_default(NITB_NODE);
install_element(NITB_NODE, _nitb_subscr_create_cmd);
install_element(NITB_NODE, _nitb_subscr_random_cmd);
install_element(NITB_NODE, _nitb_no_subscr_create_cmd);
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 92775d5..accabae 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -606,14 +606,6 @@
 self.assertTrue(self.vty.verify("exit", ['']))
 self.assertTrue(self.vty.node() is None)
 
-# Check searching for outer node's commands
-self.vty.command("configure terminal")
-self.vty.command('msc 0')
-self.vty.command("bsc")
-self.assertEquals(self.vty.node(), 'config-bsc')
-self.vty.command("msc 0")
-self.assertEquals(self.vty.node(), 'config-msc')
-
 def testUssdNotificationsMsc(self):
 self.vty.enable()
 self.vty.command("configure terminal")
@@ -716,7 +708,6 @@
 def testPingPongConfiguration(self):
 self.vty.enable()
 self.vty.verify("configure terminal", [''])
-self.vty.verify("network", [''])
 self.vty.verify("msc 0", [''])
 
 self.vty.verify("timeout-ping 12", [''])
@@ -856,19 +847,6 @@
 self.assertEquals(self.vty.node(), 'config')
 self.assertTrue(self.vty.verify('exit', ['']))
 self.assertTrue(self.vty.node() is None)
-
-# Check searching for outer node's commands
-self.vty.command('configure terminal')
-self.vty.command('mgcp')
-self.vty.command('nat')
-self.assertEquals(self.vty.node(), 'config-nat')
-self.vty.command('mgcp')
-self.assertEquals(self.vty.node(), 'config-mgcp')
-self.vty.command('nat')
-self.assertEquals(self.vty.node(), 'config-nat')
-self.vty.command('bsc 0')
-self.vty.command('mgcp')
-self.assertEquals(self.vty.node(), 'config-mgcp')
 
 def testRewriteNoRewrite(self):
 self.vty.enable()

-- 
To view, visit https://gerrit.osmocom.org/3921
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[PATCH] openbsc[master]: fix vty tests: vty no longer goes to parent node implicitly

2017-09-12 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3921

fix vty tests: vty no longer goes to parent node implicitly

Fix three instances of VTY tests working because it used to include implicit
'exit' commands to the parent node.

Since libosmocore change-id Id73cba2dd34676bad8a130e9c45e67a272f19588 = commit
d64b6aed235f6e4d84a2cb8e84b32c3179260254, we no longer do this implicit-exit in
interactive VTY shells.

*) in testPingPongConfiguration, the intention is to enter the /msc 0 node.
Drop prior entry of the 'network' node, which looks like an oversight. So
far the 'msc 0' caused an implicit 'exit' and thus worked, now fails.

*) Two instances following comments "# Check searching for outer node's
commands", which look like they are intended to check for this implicit-exit
behavior. This is obsolete, drop those parts of the tests.

Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab
---
M openbsc/tests/vty_test_runner.py
1 file changed, 0 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/3921/1

diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 92775d5..accabae 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -606,14 +606,6 @@
 self.assertTrue(self.vty.verify("exit", ['']))
 self.assertTrue(self.vty.node() is None)
 
-# Check searching for outer node's commands
-self.vty.command("configure terminal")
-self.vty.command('msc 0')
-self.vty.command("bsc")
-self.assertEquals(self.vty.node(), 'config-bsc')
-self.vty.command("msc 0")
-self.assertEquals(self.vty.node(), 'config-msc')
-
 def testUssdNotificationsMsc(self):
 self.vty.enable()
 self.vty.command("configure terminal")
@@ -716,7 +708,6 @@
 def testPingPongConfiguration(self):
 self.vty.enable()
 self.vty.verify("configure terminal", [''])
-self.vty.verify("network", [''])
 self.vty.verify("msc 0", [''])
 
 self.vty.verify("timeout-ping 12", [''])
@@ -856,19 +847,6 @@
 self.assertEquals(self.vty.node(), 'config')
 self.assertTrue(self.vty.verify('exit', ['']))
 self.assertTrue(self.vty.node() is None)
-
-# Check searching for outer node's commands
-self.vty.command('configure terminal')
-self.vty.command('mgcp')
-self.vty.command('nat')
-self.assertEquals(self.vty.node(), 'config-nat')
-self.vty.command('mgcp')
-self.assertEquals(self.vty.node(), 'config-mgcp')
-self.vty.command('nat')
-self.assertEquals(self.vty.node(), 'config-nat')
-self.vty.command('bsc 0')
-self.vty.command('mgcp')
-self.assertEquals(self.vty.node(), 'config-mgcp')
 
 def testRewriteNoRewrite(self):
 self.vty.enable()

-- 
To view, visit https://gerrit.osmocom.org/3921
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77931d6a09c42c443c6936000592f22a7fd06cab
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr