예제 #1
0
파일: __init__.py 프로젝트: auralic/Samba
 def test_list_dsas(self):
     my_kcc = kcc.KCC(unix_now, False, False, False, False)
     my_kcc.load_samdb("ldap://%s" % os.environ["SERVER"], self.lp,
                       self.creds)
     dsas = my_kcc.list_dsas()
     env = os.environ['TEST_ENV']
     for expected_dsa in ENV_DSAS[env]:
         self.assertIn(expected_dsa, dsas)
예제 #2
0
 def test_list_dsas(self):
     my_kcc = kcc.KCC(unix_now, False, False, False, False)
     my_kcc.load_samdb("ldap://%s" % os.environ["SERVER"], self.lp,
                       self.creds)
     try:
         dsas = my_kcc.list_dsas()
     except kcc.KCCError as e:
         self.fail("kcc.list_dsas failed with %s" % e)
     env = os.environ['TEST_ENV']
     for expected_dsa in ENV_DSAS[env]:
         self.assertIn(expected_dsa, dsas)
예제 #3
0
    def test_verify(self):
        """check that the KCC generates graphs that pass its own verify
        option. This is not a spectacular achievement when there are
        only a couple of nodes to connect, but it shows something.
        """
        my_kcc = kcc.KCC(unix_now, readonly=True, verify=True,
                         debug=False, dot_file_dir=None)

        my_kcc.run("ldap://%s" % os.environ["SERVER"],
                   self.lp, self.creds,
                   attempt_live_connections=False)
예제 #4
0
    def test_verify(self):
        """check that the KCC generates graphs that pass its own verify
        option. This is not a spectacular achievement when there are
        only a couple of nodes to connect, but it shows something.
        """
        my_kcc = kcc.KCC(unix_now,
                         readonly=True,
                         verify=True,
                         debug=False,
                         dot_file_dir=None)

        # As this is flapping with errors under python3, we catch
        # exceptions and turn them into failures..
        try:
            my_kcc.run("ldap://%s" % os.environ["SERVER"],
                       self.lp,
                       self.creds,
                       attempt_live_connections=False)
        except (samba.kcc.graph_utils.GraphError, kcc.KCCError):
            import traceback
            traceback.print_exc()
            self.fail()