aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-09-02 13:17:16 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-09-02 20:25:35 +0200
commit0ae92a950a321835c6693e381e131df38febab2a (patch)
treebacb84b469c72c18bb63498b4a697a5fcd56464f /openbsc/tests
parent190acf6fd03f7f9a92b3e0044abf455b8a465c33 (diff)
vty: Use generic 'end' and 'exit' commands
Add bsc_install_default() and replace all install_default() This patch adds bsc_install_default() which calls install_default() and add 'exit' and 'end'. All other calls to install_default() are replaced by calls to bsc_install_default(). Since 'exit' and 'end' are now added automatically to each node, the explicit registrations of these commands are removed by this patch, too. The related tests succeed now without work-arounds (except for the 'config' node itself which is part of libosmocore).
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/vty_test_runner.py24
1 files changed, 5 insertions, 19 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index e91d01821..5af59a9c3 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -74,11 +74,6 @@ class TestVTYGenericBSC(TestVTYBase):
except BaseException as e:
sys.stderr.write('Expected and ignored failure: %s\n' % (str(e)))
- def notIgnoredTest(self):
- sys.stderr.write('Going to ignore the next assertion(s) due to known bugs\n')
- return False
-
-
def _testConfigNetworkTree(self):
self.vty.enable()
self.assertTrue(self.vty.verify("configure terminal",['']))
@@ -128,10 +123,7 @@ class TestVTYNITB(TestVTYGenericBSC):
self.assertEquals(self.vty.node(), 'config-smpp')
self.ignoredCheckForEndAndExit()
self.assertTrue(self.vty.verify("exit", ['']))
- if self.notIgnoredTest():
- self.assertEquals(self.vty.node(), 'config')
- else:
- self.assertTrue(self.vty.verify("configure terminal", ['']))
+ self.assertEquals(self.vty.node(), 'config')
self.assertTrue(self.vty.verify("exit", ['']))
self.assertTrue(self.vty.node() is None)
@@ -185,20 +177,14 @@ class TestVTYBSC(TestVTYGenericBSC):
self.ignoredCheckForEndAndExit()
self.assertTrue(self.vty.verify("msc 0", ['']))
self.assertEquals(self.vty.node(), 'config-msc')
- self.ignoredCheckForEndAndExit()
+ self.checkForEndAndExit()
self.assertTrue(self.vty.verify("exit", ['']))
- if self.notIgnoredTest():
- self.assertEquals(self.vty.node(), 'config')
- else:
- self.assertTrue(self.vty.verify("configure terminal", ['']))
+ self.assertEquals(self.vty.node(), 'config')
self.assertTrue(self.vty.verify("bsc", ['']))
self.assertEquals(self.vty.node(), 'config-bsc')
- self.ignoredCheckForEndAndExit()
+ self.checkForEndAndExit()
self.assertTrue(self.vty.verify("exit", ['']))
- if self.notIgnoredTest():
- self.assertEquals(self.vty.node(), 'config')
- else:
- self.assertTrue(self.vty.verify("configure terminal", ['']))
+ self.assertEquals(self.vty.node(), 'config')
self.assertTrue(self.vty.verify("exit", ['']))
self.assertTrue(self.vty.node() is None)