aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/vty_test_runner.py
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-29 10:06:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-29 10:11:21 +0100
commitdb64f2e45adf7ac95070361f5b7ec76a44e084fb (patch)
treef0c0c198d982ac419bb39d154b5eba01889f855b /openbsc/tests/vty_test_runner.py
parent76606d3473b61963a4d87bdad9f002e6191b9ece (diff)
bsc: Allow to disable sending ping/pong to the MSC
Some switches do not like to receive the IPA PING/PONG messages. Allow to disable the handling with "no timeout-ping" and create test cases that verify the switching between the modes. Change the code to trat <= 0 as an invalid timeout. Fixes: SYS#713
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r--openbsc/tests/vty_test_runner.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index ece9ac554..10e1ae425 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -419,6 +419,48 @@ class TestVTYBSC(TestVTYGenericBSC):
res = self.vty.command("show network")
self.assert_(res.startswith('BSC is on Country Code') >= 0)
+ 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", [''])
+ self.vty.verify("timeout-pong 14", [''])
+ res = self.vty.command("show running-config")
+ self.assert_(res.find(" timeout-ping 12") > 0)
+ self.assert_(res.find(" timeout-pong 14") > 0)
+ self.assert_(res.find(" no timeout-ping advanced") > 0)
+
+ self.vty.verify("timeout-ping advanced", [''])
+ res = self.vty.command("show running-config")
+ self.assert_(res.find(" timeout-ping 12") > 0)
+ self.assert_(res.find(" timeout-pong 14") > 0)
+ self.assert_(res.find(" timeout-ping advanced") > 0)
+
+ self.vty.verify("no timeout-ping advanced", [''])
+ res = self.vty.command("show running-config")
+ self.assert_(res.find(" timeout-ping 12") > 0)
+ self.assert_(res.find(" timeout-pong 14") > 0)
+ self.assert_(res.find(" no timeout-ping advanced") > 0)
+
+ self.vty.verify("no timeout-ping", [''])
+ res = self.vty.command("show running-config")
+ self.assertEquals(res.find(" timeout-ping 12"), -1)
+ self.assertEquals(res.find(" timeout-pong 14"), -1)
+ self.assertEquals(res.find(" no timeout-ping advanced"), -1)
+ self.assert_(res.find(" no timeout-ping") > 0)
+
+ self.vty.verify("timeout-ping advanced", ['%ping handling is disabled. Enable it first.'])
+
+ # And back to enabling it
+ self.vty.verify("timeout-ping 12", [''])
+ self.vty.verify("timeout-pong 14", [''])
+ res = self.vty.command("show running-config")
+ self.assert_(res.find(" timeout-ping 12") > 0)
+ self.assert_(res.find(" timeout-pong 14") > 0)
+ self.assert_(res.find(" timeout-ping advanced") > 0)
+
class TestVTYNAT(TestVTYGenericBSC):
def vty_command(self):