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)
def setUp(self): self.ccd = "./tests/clients/ccd" self.lockfile = clients._try_lock_ccd(self.ccd) self.fakelockfile = "./tests/files/nosuchlockfile"
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))
def testTryLockedLockCCD(self): self.assertFalse(clients._try_lock_ccd(ccd=self.ccd))
def setUp(self): self.ccd = "./tests/clients/ccd" self.lockfile = clients._try_lock_ccd(ccd=self.ccd) self.lockfile2 = ""