コード例 #1
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientIgnoreFQDNCheck(self):
     self.startNuauth()
     client1 = createClient(more_args=["-H","nuauth.inl.fr","-A", self.cacert])
     client2 = createClient(more_args=["-H","localhost","-A", self.cacert,"-N"])
     self.assert_(connectClient(client1))
     self.assert_(connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #2
0
ファイル: test_system.py プロジェクト: regit/nufw
    def testLogin(self):
        username = config.get("test_system", "username")
        password = config.get("test_system", "password")
        client = createClientWithCerts(username, password)
        self.assert_(connectClient(client))
        client.stop()

        client = createClientWithCerts(username, "xxx%sxxx" % password)
        self.assert_(not connectClient(client))
        client.stop()
コード例 #3
0
    def testLogin(self):
        username = config.get("test_system", "username")
        password = config.get("test_system", "password")
        client = createClientWithCerts(username, password)
        self.assert_(connectClient(client))
        client.stop()

        client = createClientWithCerts(username, "xxx%sxxx" % password)
        self.assert_(not connectClient(client))
        client.stop()
コード例 #4
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientIgnoreFQDNCheck(self):
     self.startNuauth()
     client1 = createClient(
         more_args=["-H", "nuauth.inl.fr", "-A", self.cacert])
     client2 = createClient(
         more_args=["-H", "localhost", "-A", self.cacert, "-N"])
     self.assert_(connectClient(client1))
     self.assert_(connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #5
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientExpired(self):
     self.startNuauth()
     client1 = createClientWithCerts()
     self.assert_(connectClient(client1))
     tls_cert = abspath(config.get("test_cert", "user_expired_cert"))
     tls_key  = abspath(config.get("test_cert", "user_expired_key"))
     client2 = createClient(more_args=["-A", self.cacert,"-C",tls_cert,"-K",tls_key])
     self.assert_(not connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #6
0
 def testNuauthExpired(self):
     args = dict()
     args["nuauth_tls_key"] = '"%s"' % abspath(config.get("test_cert", "user_expired_key"))
     args["nuauth_tls_cert"] = '"%s"' % abspath(config.get("test_cert", "user_expired_cert"))
     self.startNuauth(args)
     self.client = createClient(more_args=["-H","nuauth.inl.fr","-A",self.cacert])
     self.assert_(not connectClient(self.client))
     self.client.stop()
     self.client = createClient(more_args=["-H","nuauth.inl.fr","-Q"])
     self.assert_(not connectClient(self.client))
     self.client.stop()
     self.stopNuauth()
コード例 #7
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientExpired(self):
     self.startNuauth()
     client1 = createClientWithCerts()
     self.assert_(connectClient(client1))
     tls_cert = abspath(config.get("test_cert", "user_expired_cert"))
     tls_key = abspath(config.get("test_cert", "user_expired_key"))
     client2 = createClient(
         more_args=["-A", self.cacert, "-C", tls_cert, "-K", tls_key])
     self.assert_(not connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #8
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientRevoked(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "1"
     args["nuauth_tls_crl"] = '"%s"' % abspath(config.get("test_cert", "crl"))
     self.startNuauth(args)
     client1 = createClientWithCerts()
     self.assert_(connectClient(client1))
     tls_cert = abspath(config.get("test_cert", "user_revoked_cert"))
     tls_key  = abspath(config.get("test_cert", "user_revoked_key"))
     client2 = createClient(more_args=["-A", self.cacert,"-C",tls_cert,"-K",tls_key])
     self.assert_(not connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #9
0
    def testSASLAuthNOK(self):
        self.config["nuauth_tls_auth_by_cert"] = 0
        self.config["session_authtype_sasl_groups"] = "\"123\""
        self.nuauth = Nuauth(self.config)

        self.client = self.user.createClientWithCerts()
        self.assert_(not connectClient(self.client))
コード例 #10
0
    def testBlacklistAuthNOK(self):
        self.config["nuauth_tls_auth_by_cert"] = 0
        self.config["session_authtype_blacklist_groups"] = "\"42\""
        self.nuauth = Nuauth(self.config)

        self.client = self.user.createClientWithCerts()
        self.assert_(not connectClient(self.client))
コード例 #11
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientRevoked(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "1"
     args["nuauth_tls_crl"] = '"%s"' % abspath(
         config.get("test_cert", "crl"))
     self.startNuauth(args)
     client1 = createClientWithCerts()
     self.assert_(connectClient(client1))
     tls_cert = abspath(config.get("test_cert", "user_revoked_cert"))
     tls_key = abspath(config.get("test_cert", "user_revoked_key"))
     client2 = createClient(
         more_args=["-A", self.cacert, "-C", tls_cert, "-K", tls_key])
     self.assert_(not connectClient(client2))
     client1.stop()
     client2.stop()
     self.stopNuauth()
コード例 #12
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientInvalidCA(self):
     self.startNuauth()
     cacert = config.get("test_cert", "invalid_cacert")
     client = createClient(more_args=["-A", cacert])
     self.assert_(not connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #13
0
ファイル: test_session_authtype.py プロジェクト: regit/nufw
    def testBlacklistAuthNOK(self):
        self.config["nuauth_tls_auth_by_cert"] = 0
        self.config["session_authtype_blacklist_groups"] = '"42"'
        self.nuauth = Nuauth(self.config)

        self.client = self.user.createClientWithCerts()
        self.assert_(not connectClient(self.client))
コード例 #14
0
    def testLoginNormal(self):
        # Change login policy to 0
        self.config["nuauth_single_ip_client_limit"] = 0
        self.config["nuauth_single_user_client_limit"] = 0
        self.nuauth = Nuauth(self.config)

        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user2
        client2 = self.userB.createClientWithCerts()
        self.assert_(connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #15
0
ファイル: test_session_authtype.py プロジェクト: regit/nufw
    def testSASLAuthNOK(self):
        self.config["nuauth_tls_auth_by_cert"] = 0
        self.config["session_authtype_sasl_groups"] = '"123"'
        self.nuauth = Nuauth(self.config)

        self.client = self.user.createClientWithCerts()
        self.assert_(not connectClient(self.client))
コード例 #16
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientInvalidCA(self):
     self.startNuauth()
     cacert = config.get("test_cert", "invalid_cacert")
     client = createClient(more_args=["-A", cacert])
     self.assert_(not connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #17
0
ファイル: test_user_policy.py プロジェクト: regit/nufw
    def testLoginNormal(self):
        # Change login policy to 0
        self.config["nuauth_single_ip_client_limit"] = 0
        self.config["nuauth_single_user_client_limit"] = 0
        self.nuauth = Nuauth(self.config)

        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user2
        client2 = self.userB.createClientWithCerts()
        self.assert_(connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #18
0
ファイル: test_mysql.py プロジェクト: rusbomber/nufw
    def _login(self, sql):
        # Client login
        client = self.user.createClientWithCerts()
        self.assert_(connectClient(client))

        # Check number of rows
        for when in retry(timeout=QUERY_TIMEOUT):
            cursor = self.query(sql)
            for line in self.nuauth.readlines():
                pass
            if cursor.rowcount:
                break
        self.assertEqual(cursor.rowcount, 1)

        # Read row columns
        (ip_saddr, user_id, username, os_sysname, os_release, os_version,
         end_time) = self.fetchone(cursor)
        if not POSTGRESQL:
            ip_saddr = ntohl(ip_saddr) & 0xFFFFFFFF

        # Check values
        self.assertEqual(IP(ip_saddr), client.ip)
        self.assertEqual(user_id, self.user.uid)
        self.assertEqual(username, client.username)
        self.assertEqual(os_sysname, OS_SYSNAME)
        self.assertEqual(os_release, OS_RELEASE)
        self.assertEqual(os_version, OS_VERSION)
        return client
コード例 #19
0
ファイル: test_mysql.py プロジェクト: regit/nufw
    def _login(self, sql):
        # Client login
        client = self.user.createClientWithCerts()
        self.assert_(connectClient(client))

        # Check number of rows
        for when in retry(timeout=QUERY_TIMEOUT):
            cursor = self.query(sql)
            for line in self.nuauth.readlines():
                pass
            if cursor.rowcount:
                break
        self.assertEqual(cursor.rowcount, 1)

        # Read row columns
        (ip_saddr, user_id, username, os_sysname,
            os_release, os_version, end_time) = self.fetchone(cursor)
        if not POSTGRESQL:
            ip_saddr = ntohl(ip_saddr) & 0xFFFFFFFF

        # Check values
        self.assertEqual(IP(ip_saddr), client.ip)
        self.assertEqual(user_id, self.user.uid)
        self.assertEqual(username, client.username)
        self.assertEqual(os_sysname, OS_SYSNAME)
        self.assertEqual(os_release, OS_RELEASE)
        self.assertEqual(os_version, OS_VERSION)
        return client
コード例 #20
0
    def testLoginIP(self):
        # Change login policy to 1 login/IP
        self.config["nuauth_single_ip_client_limit"] = 1
        self.config["nuauth_single_user_client_limit"] = 0
        self.nuauth = Nuauth(self.config)

        # Different users can't log from same IP
        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user2
        client2 = self.userB.createClientWithCerts()
        self.assert_(not connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #21
0
    def testLoginOne(self):
        # Change login policy to 1 login/user
        self.config["nuauth_single_ip_client_limit"] = 0
        self.config["nuauth_single_user_client_limit"] = 1
        self.nuauth = Nuauth(self.config)

        # User can't log twice
        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user1
        client2 = self.userA.createClientWithCerts()
        self.assert_(not connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #22
0
ファイル: test_user_policy.py プロジェクト: regit/nufw
    def testLoginOne(self):
        # Change login policy to 1 login/user
        self.config["nuauth_single_ip_client_limit"] = 0
        self.config["nuauth_single_user_client_limit"] = 1
        self.nuauth = Nuauth(self.config)

        # User can't log twice
        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user1
        client2 = self.userA.createClientWithCerts()
        self.assert_(not connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #23
0
ファイル: test_user_policy.py プロジェクト: regit/nufw
    def testLoginIP(self):
        # Change login policy to 1 login/IP
        self.config["nuauth_single_ip_client_limit"] = 1
        self.config["nuauth_single_user_client_limit"] = 0
        self.nuauth = Nuauth(self.config)

        # Different users can't log from same IP
        # Test user1
        client1 = self.userA.createClientWithCerts()
        self.assert_(connectClient(client1))

        # Test user2
        client2 = self.userB.createClientWithCerts()
        self.assert_(not connectClient(client2))

        client1.stop()
        client2.stop()
コード例 #24
0
 def testCertAuthGroupNOK(self):
     self.config["nuauth_tls_auth_by_cert"] = "2"
     self.config["session_authtype_ssl_groups"] = "\"100\""
     self.nuauth = Nuauth(self.config)
     # Client
     self.client = self.user.createClientWithCerts()
     self.client.password = "******" % self.user.password
     self.assert_(not connectClient(self.client))
コード例 #25
0
ファイル: test_session_authtype.py プロジェクト: regit/nufw
 def testCertAuthGroupNOK(self):
     self.config["nuauth_tls_auth_by_cert"] = "2"
     self.config["session_authtype_ssl_groups"] = '"100"'
     self.nuauth = Nuauth(self.config)
     # Client
     self.client = self.user.createClientWithCerts()
     self.client.password = "******" % self.user.password
     self.assert_(not connectClient(self.client))
コード例 #26
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientInvalidCRL(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "2"
     self.startNuauth(args)
     invalid_crl = abspath(config.get("test_cert", "invalid_crl"))
     client = createClient(more_args=["-H","nuauth.inl.fr","-A",self.cacert,"-R",invalid_crl])
     self.assert_(not connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #27
0
 def testNuauthRevoked(self):
     args = dict()
     args["nuauth_tls_key"] = '"%s"' % abspath(config.get("test_cert", "user_revoked_key"))
     args["nuauth_tls_cert"] = '"%s"' % abspath(config.get("test_cert", "user_revoked_cert"))
     self.startNuauth(args)
     self.client = createClient(more_args=["-H","nuauth.inl.fr","-A",self.cacert,"-R",abspath("./pki/crl.pem")])
     self.assert_(not connectClient(self.client))
     self.client.stop()
     self.stopNuauth()
コード例 #28
0
def testPort(testcase, iptables, client, port, ok, host=HOST):
    # Enable iptables filtering
    iptables.filterTcp(VALID_PORT)

    # Connect user
    if client:
        testcase.assert_(connectClient(client))

    # Create socket
    testcase.assertEqual(connectTcp(host, port, TIMEOUT), ok)
コード例 #29
0
ファイル: filter.py プロジェクト: regit/nufw
def testPort(testcase, iptables, client, port, ok, host=HOST):
    # Enable iptables filtering
    iptables.filterTcp(VALID_PORT)

    # Connect user
    if client:
        testcase.assert_(connectClient(client))

    # Create socket
    testcase.assertEqual(connectTcp(host, port, TIMEOUT), ok)
コード例 #30
0
ファイル: filter.py プロジェクト: regit/nufw
def testPortFailure(testcase, iptables, client, port, err):
    # Enable iptables filtering
    iptables.filterTcp(VALID_PORT)

    # Connect user
    if client:
        testcase.assert_(connectClient(client))

    # Create socket
    testcase.assertEqual(connectTcpFail(HOST, port, TIMEOUT), err)
コード例 #31
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientValidCert(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "2"
     self.startNuauth(args)
     tls_cert = abspath(config.get("test_cert", "user_cert"))
     tls_key  = abspath(config.get("test_cert", "user_key"))
     client = createClient(more_args=["-A", self.cacert,"-C",tls_cert,"-K",tls_key])
     self.assert_(connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #32
0
def testPortFailure(testcase, iptables, client, port, err):
    # Enable iptables filtering
    iptables.filterTcp(VALID_PORT)

    # Connect user
    if client:
        testcase.assert_(connectClient(client))

    # Create socket
    testcase.assertEqual(connectTcpFail(HOST, port, TIMEOUT), err)
コード例 #33
0
ファイル: test_syslog.py プロジェクト: regit/nufw
    def testLogin(self):
        # Client login
        client = createClientWithCerts()
        self.assert_(connectClient(client))

        # Check log output
        self.assert_(self.findLog("[nuauth] User %s connect on " % client.username))

        # Client logout
        client.stop()
        self.assert_(self.findLog("[nuauth] User %s disconnect on " % client.username))
コード例 #34
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientInvalidCRL(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "2"
     self.startNuauth(args)
     invalid_crl = abspath(config.get("test_cert", "invalid_crl"))
     client = createClient(more_args=[
         "-H", "nuauth.inl.fr", "-A", self.cacert, "-R", invalid_crl
     ])
     self.assert_(not connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #35
0
ファイル: test_cert_auth.py プロジェクト: rusbomber/nufw
    def testInvalidCert(self):
        # Expired certificate
        cacert = config.get("test_cert", "cacert")
        cert = config.get("test_cert", "user_invalid_cert")
        key = config.get("test_cert", "user_invalid_key")

        args = ["-C", cert, "-K", key, "-A", cacert]

        self.client = self.user.createClient(more_args=args)
        self.client.password = "******" % self.user.password
        self.assert_(not connectClient(self.client))
コード例 #36
0
ファイル: test_cert_auth.py プロジェクト: regit/nufw
    def testInvalidCert(self):
        # Expired certificate
        cacert = config.get("test_cert", "cacert")
        cert = config.get("test_cert", "user_invalid_cert")
        key = config.get("test_cert", "user_invalid_key")

        args = ["-C", cert, "-K", key, "-A", cacert]

        self.client = self.user.createClient(more_args=args)
        self.client.password = "******" % self.user.password
        self.assert_(not connectClient(self.client))
コード例 #37
0
ファイル: test_cert_auth.py プロジェクト: regit/nufw
    def testValidCert(self):
        # Client
        cacert = config.get("test_cert", "cacert")
        cert = config.get("test_cert", "user_cert")
        key = config.get("test_cert", "user_key")

        args = ["-C", cert, "-K", key, "-A", cacert]

        self.client = self.user.createClient(more_args=args)
        self.client.password = "******" % self.user.password
        self.assert_(connectClient(self.client))
コード例 #38
0
ファイル: test_tls_client.py プロジェクト: rusbomber/nufw
 def testClientValidCert(self):
     args = dict()
     args["nuauth_tls_request_cert"] = "2"
     self.startNuauth(args)
     tls_cert = abspath(config.get("test_cert", "user_cert"))
     tls_key = abspath(config.get("test_cert", "user_key"))
     client = createClient(
         more_args=["-A", self.cacert, "-C", tls_cert, "-K", tls_key])
     self.assert_(connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #39
0
ファイル: test_cert_auth.py プロジェクト: rusbomber/nufw
    def testValidCert(self):
        # Client
        cacert = config.get("test_cert", "cacert")
        cert = config.get("test_cert", "user_cert")
        key = config.get("test_cert", "user_key")

        args = ["-C", cert, "-K", key, "-A", cacert]

        self.client = self.user.createClient(more_args=args)
        self.client.password = "******" % self.user.password
        self.assert_(connectClient(self.client))
コード例 #40
0
ファイル: test_mark_flag.py プロジェクト: regit/nufw
    def testValid(self):
        # Connect client and filter port
        self.assert_(connectClient(self.client))
        self.iptables.filterTcp(self.port)

        # Test connection without QoS (accept)
        self.assertEqual(connectTcp(HOST, self.port, TIMEOUT), True)

        # Test connection with QoS (drop)
        self.iptables.command("-A POSTROUTING -t mangle -m mark --mark %s -j DROP" % self.mark)
        self.assertEqual(connectTcp(HOST, self.port, TIMEOUT), False)
コード例 #41
0
 def testNuauthInvalidCA(self):
     cacert = abspath(config.get("test_cert", "invalid_cacert"))
     args = dict()
     args["nuauth_tls_cacert"] = "'%s'" % cacert
     # we must disable CRL for this one, else nuauth fails with an
     # error (CRL is not issued by CA)
     args["nuauth_tls_crl"] = None
     self.startNuauth(args)
     self.client = createClientWithCerts()
     self.assert_(not connectClient(self.client))
     self.client.stop()
     self.stopNuauth()
コード例 #42
0
ファイル: test_mark_flag.py プロジェクト: rusbomber/nufw
    def testValid(self):
        # Connect client and filter port
        self.assert_(connectClient(self.client))
        self.iptables.filterTcp(self.port)

        # Test connection without QoS (accept)
        self.assertEqual(connectTcp(HOST, self.port, TIMEOUT), True)

        # Test connection with QoS (drop)
        self.iptables.command(
            "-A POSTROUTING -t mangle -m mark --mark %s -j DROP" % self.mark)
        self.assertEqual(connectTcp(HOST, self.port, TIMEOUT), False)
コード例 #43
0
ファイル: test_syslog.py プロジェクト: rusbomber/nufw
    def testLogin(self):
        # Client login
        client = createClientWithCerts()
        self.assert_(connectClient(client))

        # Check log output
        self.assert_(
            self.findLog("[nuauth] User %s connect on " % client.username))

        # Client logout
        client.stop()
        self.assert_(
            self.findLog("[nuauth] User %s disconnect on " % client.username))
コード例 #44
0
ファイル: test_script.py プロジェクト: regit/nufw
    def testLogin(self):
        # Client login
        client = createClientWithCerts()
        self.assert_(connectClient(client))

        # Check log output
        match = "SCRIPT UP COUNT=2 TEXT >>>%s %s<<<" \
            % (client.username, client.ip)
        self.assert_(self.checkScript(match))

        # Client logout
        client.stop()
        match = "SCRIPT DOWN COUNT=2 TEXT >>>%s %s<<<" \
            % (client.username, client.ip)
        self.assert_(self.checkScript(match))
コード例 #45
0
ファイル: test_script.py プロジェクト: rusbomber/nufw
    def testLogin(self):
        # Client login
        client = createClientWithCerts()
        self.assert_(connectClient(client))

        # Check log output
        match = "SCRIPT UP COUNT=2 TEXT >>>%s %s<<<" \
            % (client.username, client.ip)
        self.assert_(self.checkScript(match))

        # Client logout
        client.stop()
        match = "SCRIPT DOWN COUNT=2 TEXT >>>%s %s<<<" \
            % (client.username, client.ip)
        self.assert_(self.checkScript(match))
コード例 #46
0
ファイル: test_conntrack.py プロジェクト: rusbomber/nufw
    def testConnShutdown(self):
        user = USERDB[0]
        client = user.createClient()
        self.assert_(connectClient(client))

        start = time.time()
        conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        conn.connect((self.dst_host, VALID_PORT))

        src_port = conn.getsockname()[1]

        ct_before = len(get_conntrack_conn(src_port, self.dst_host, VALID_PORT))
        ## Check that only one connection is opened to
        self.assert_(ct_before == 1)

        ## The connection should be killed 10 seconds after being opened
        time.sleep(15)

        ## Check that only one connection is opened to
        ct_after = len(get_conntrack_conn(src_port, self.dst_host, VALID_PORT))
        self.assert_(ct_after == 0)

        conn.close()
        client.stop()
コード例 #47
0
ファイル: test_conntrack.py プロジェクト: regit/nufw
    def testConnShutdown(self):
        user = USERDB[0]
        client = user.createClient()
        self.assert_(connectClient(client))

        start = time.time()
        conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        conn.connect((self.dst_host, VALID_PORT))

        src_port = conn.getsockname()[1]

        ct_before = len(get_conntrack_conn(src_port, self.dst_host, VALID_PORT))
        ## Check that only one connection is opened to
        self.assert_(ct_before == 1)

        ## The connection should be killed 10 seconds after being opened
        time.sleep(15)

        ## Check that only one connection is opened to
        ct_after = len(get_conntrack_conn(src_port, self.dst_host, VALID_PORT))
        self.assert_(ct_after == 0)

        conn.close()
        client.stop()
コード例 #48
0
ファイル: test_plaintext_auth.py プロジェクト: rusbomber/nufw
 def testInvalidPass(self):
     user = USERDB[1]
     client = createClientWithCerts(user.login, user.password+"x")
     self.assert_(not connectClient(client))
     client.stop()
コード例 #49
0
ファイル: test_plaintext_auth.py プロジェクト: rusbomber/nufw
 def testInvalidLogin(self):
     user = USERDB[0]
     client = createClientWithCerts(user.login+"x", user.password)
     self.assert_(not connectClient(client))
     client.stop()
コード例 #50
0
ファイル: test_plaintext_auth.py プロジェクト: rusbomber/nufw
 def testUser2(self):
     user = USERDB[1]
     client = user.createClientWithCerts()
     self.assert_(connectClient(client))
     client.stop()
コード例 #51
0
ファイル: test_session_expire.py プロジェクト: rusbomber/nufw
    def testExpire(self):
        self.assert_(connectClient(self.client))

        sleep(self.expiration + DELAY)

        self.assert_(self.get_session_not_connected())
コード例 #52
0
ファイル: test_client_auth.py プロジェクト: rusbomber/nufw
 def testInvalidPass(self):
     self.client.password = "******" % PASSWORD
     self.assert_(not connectClient(self.client))
コード例 #53
0
ファイル: test_tls_client.py プロジェクト: regit/nufw
 def testClientValidCA(self):
     self.startNuauth()
     client = createClient(more_args=["-A", self.cacert])
     self.assert_(connectClient(client))
     client.stop()
     self.stopNuauth()
コード例 #54
0
ファイル: test_client_auth.py プロジェクト: regit/nufw
 def testInvalidPass(self):
     self.client.password = "******" % PASSWORD
     self.assert_(not connectClient(self.client))