Ejemplo n.º 1
0
    def testPathHashing(self):
        abspath = os.path.abspath(self.ccd)
        path_components = abspath.split(os.sep)[1:]

        # for example: 'etc_openvpn_clients'
        underscored = "_".join(path_components)

        # for example: '/etc_openvpn_clients'
        non_unique = os.sep + underscored

        self.lockfile2 = clients._try_lock_ccd(ccd=non_unique)
        self.assertTrue(self.lockfile2)
Ejemplo n.º 2
0
 def setUp(self):
     self.ccd = "./tests/clients/ccd"
     self.lockfile = clients._try_lock_ccd(self.ccd)
     self.fakelockfile = "./tests/files/nosuchlockfile"
Ejemplo n.º 3
0
 def testTimeoutLocked(self):
     self.lockfile = clients._try_lock_ccd(ccd=self.ccd)
     self.assertFalse(
         clients._wait_for_lock(ccd=self.ccd, timeout=0.1, wait=0.1))
Ejemplo n.º 4
0
 def testTryLockedLockCCD(self):
     self.assertFalse(clients._try_lock_ccd(ccd=self.ccd))
Ejemplo n.º 5
0
 def setUp(self):
     self.ccd = "./tests/clients/ccd"
     self.lockfile = clients._try_lock_ccd(ccd=self.ccd)
     self.lockfile2 = ""