diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-09-02 20:58:38 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-09-02 21:55:56 +0200 |
commit | 0df1ab97a2acfe272124634c9484883dd210070d (patch) | |
tree | d61394288fbef1eb0b717e90462e655662b8706c /openbsc/tests/vty_test_runner.py | |
parent | 4c9dff5d8ecf99cdf3f354e3df38bed4cdc2be9c (diff) |
vty: Attempt to fix the build when SMPP is not enabled
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 15a73ce7e..ab9670ce0 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -109,6 +109,11 @@ class TestVTYNITB(TestVTYGenericBSC): def testConfigNetworkTree(self): self._testConfigNetworkTree() + def checkForSmpp(self): + """SMPP is not always enabled, check if it is""" + res = self.vty.command("list") + return "smpp" in res + def testVtyTree(self): self.vty.enable() self.assertTrue(self.vty.verify("configure terminal", [''])) @@ -118,11 +123,14 @@ class TestVTYNITB(TestVTYGenericBSC): self.assertEquals(self.vty.node(), 'config-mncc-int') self.checkForEndAndExit() self.assertTrue(self.vty.verify('exit', [''])) - self.assertEquals(self.vty.node(), 'config') - self.assertTrue(self.vty.verify('smpp', [''])) - self.assertEquals(self.vty.node(), 'config-smpp') - self.ignoredCheckForEndAndExit() - self.assertTrue(self.vty.verify("exit", [''])) + + if self.checkForSmpp(): + self.assertEquals(self.vty.node(), 'config') + self.assertTrue(self.vty.verify('smpp', [''])) + self.assertEquals(self.vty.node(), 'config-smpp') + self.ignoredCheckForEndAndExit() + self.assertTrue(self.vty.verify("exit", [''])) + self.assertEquals(self.vty.node(), 'config') self.assertTrue(self.vty.verify("exit", [''])) self.assertTrue(self.vty.node() is None) @@ -130,9 +138,12 @@ class TestVTYNITB(TestVTYGenericBSC): # Check searching for outer node's commands self.vty.command("configure terminal") self.vty.command('mncc-int') - self.vty.command('smpp') - self.assertEquals(self.vty.node(), 'config-smpp') - self.vty.command('mncc-int') + + if self.checkForSmpp(): + self.vty.command('smpp') + self.assertEquals(self.vty.node(), 'config-smpp') + self.vty.command('mncc-int') + self.assertEquals(self.vty.node(), 'config-mncc-int') def testEnableDisablePeriodicLU(self): |