diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-06 17:46:08 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-06 17:46:08 +0200 |
commit | c15c61c401e6f934fbf35c0c87d0777ff857f7c6 (patch) | |
tree | e65e29b5e7832bae4fefaefe3212c4104dfbd3b4 /openbsc/tests/vty_test_runner.py | |
parent | 4f5b8237ec2182861fbe075f4cce56a9c7caf904 (diff) |
sgsn: Add VTY configuration for the CDR module
Make it possible to set a filename to use for the CDR. By
default no CDR will be generated. Forbid to set the interval
of 0 seconds as this will cause a lot of work. Add a very
basic VTY test.
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 3581b67c9..4cd46653e 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -891,6 +891,34 @@ class TestVTYSGSN(TestVTYGenericBSC): res = self.vty.command("show running-config") self.assertEquals(res.find("apn internet"), -1) + def testVtyCDR(self): + self.vty.enable() + self.assertTrue(self.vty.verify('configure terminal', [''])) + self.assertEquals(self.vty.node(), 'config') + self.assertTrue(self.vty.verify('sgsn', [''])) + self.assertEquals(self.vty.node(), 'config-sgsn') + + res = self.vty.command("show running-config") + self.assert_(res.find("no cdr filename") > 0) + + self.vty.command("cdr filename bla.cdr") + res = self.vty.command("show running-config") + self.assertEquals(res.find("no cdr filename"), -1) + self.assert_(res.find(" cdr filename bla.cdr") > 0) + + self.vty.command("no cdr filename") + res = self.vty.command("show running-config") + self.assert_(res.find("no cdr filename") > 0) + self.assertEquals(res.find(" cdr filename bla.cdr"), -1) + + res = self.vty.command("show running-config") + self.assert_(res.find(" cdr interval 600") > 0) + + self.vty.command("cdr interval 900") + res = self.vty.command("show running-config") + self.assert_(res.find(" cdr interval 900") > 0) + self.assertEquals(res.find(" cdr interval 600"), -1) + def add_nat_test(suite, workdir): if not os.path.isfile(os.path.join(workdir, "src/osmo-bsc_nat/osmo-bsc_nat")): print("Skipping the NAT test") |