summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2013-09-12 20:57:51 +0400
committerIvan Kluchnikov <kluchnikovi@gmail.com>2013-09-12 20:57:51 +0400
commit450a45488bcb43b7e6467954d8c651ec0f2945c1 (patch)
tree80e642607d3a65f1a688a10a34fc1e6737db0bca
parenta706f4de43f65cc88bba2de981398eacdd46e1a2 (diff)
Added test for "auth policy" VTY command.
-rwxr-xr-x[-rw-r--r--]openbsc/tests/vty_test_runner.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index ab9670c..3594129 100644..100755
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -169,6 +169,42 @@ class TestVTYNITB(TestVTYGenericBSC):
self.assertEquals(res.find('periodic location update 60'), -1)
self.assert_(res.find('no periodic location update') > 0)
+ def testAuthPolicy (self):
+ self.vty.enable()
+ self.vty.command("configure terminal")
+ self.vty.command("network")
+
+ # Test invalid input
+ self.vty.verify("auth policy", ['% Command incomplete.'])
+
+ # Enable auth policy closed
+ self.vty.verify("auth policy closed", [''])
+
+ # Verify settings
+ res = self.vty.command("write terminal")
+ self.assert_(res.find('auth policy closed') > 0)
+
+ # Enable auth policy accept-all
+ self.vty.verify("auth policy accept-all", [''])
+
+ # Verify settings
+ res = self.vty.command("write terminal")
+ self.assert_(res.find('auth policy accept-all') > 0)
+
+ # Enable auth policy token
+ self.vty.verify("auth policy token", [''])
+
+ # Verify settings
+ res = self.vty.command("write terminal")
+ self.assert_(res.find('auth policy token') > 0)
+
+ # Enable auth policy black-list
+ self.vty.verify("auth policy black-list", [''])
+
+ # Verify settings
+ res = self.vty.command("write terminal")
+ self.assert_(res.find('auth policy black-list') > 0)
+
class TestVTYBSC(TestVTYGenericBSC):
def vty_command(self):