aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/vty_test_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-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 ab9670ce0..35941290f 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):