Add negative authentication test
authorSimo Sorce <simo@redhat.com>
Wed, 18 Mar 2015 00:18:21 +0000 (20:18 -0400)
committerSimo Sorce <simo@redhat.com>
Wed, 18 Mar 2015 00:37:55 +0000 (20:37 -0400)
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Nathan Kinder <nkinder@redhat.com>
tests/test1.py

index 34b9c88..8589f38 100755 (executable)
@@ -143,3 +143,13 @@ if __name__ == '__main__':
         print >> sys.stderr, " ERROR: %s" % repr(e)
         sys.exit(1)
     print " SUCCESS"
         print >> sys.stderr, " ERROR: %s" % repr(e)
         sys.exit(1)
     print " SUCCESS"
+
+    print "test1: Try authentication failure ...",
+    newsess = HttpSessions()
+    newsess.add_server(idpname, 'http://127.0.0.10:45080', user, 'wrong')
+    try:
+        newsess.auth_to_idp(idpname)
+        print >> sys.stderr, " ERROR: Authentication should have failed"
+        sys.exit(1)
+    except Exception, e:  # pylint: disable=broad-except
+        print " SUCCESS"