summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2013-10-18 12:26:34 +0400
committerIvan Kluchnikov <kluchnikovi@gmail.com>2013-10-18 12:26:34 +0400
commit96a2240ed40eb7b98234b74ce4a6d4ae23e937e0 (patch)
tree850edc08966e3d6511355099ad068a8eb13a5e9f
parent8c806541a874bb4b0ecd6974c38a4958e25d59f6 (diff)
Added test for "auth policy" VTY command.kluchnikov/blacklist
-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 0bd79720e..baa89ba44 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -231,6 +231,42 @@ class TestVTYNITB(TestVTYGenericBSC):
res = self.vty.command('show subscriber imsi '+imsi)
self.assert_(res.find(" IMSI: "+imsi) > 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 blacklist
+ self.vty.verify("auth policy blacklist", [''])
+
+ # Verify settings
+ res = self.vty.command("write terminal")
+ self.assert_(res.find("auth policy blacklist") > 0)
+
class TestVTYBSC(TestVTYGenericBSC):
def vty_command(self):