Ejemplo n.º 1
0
    def testCtime(self):
        """Check to see if ctime read, compared"""
        rp = rpath.RPath(self.lc, self.prefix, ("ctimetest.1", ))
        rp2 = rpath.RPath(self.lc, self.prefix, ("ctimetest.2", ))
        rp.touch()
        rp.chmod(0o700)
        rpath.copy_with_attribs(rp, rp2)
        assert rpath._cmp_file_attribs(rp, rp2)

        time.sleep(1)
        rp2.chmod(0o755)
        rp2.chmod(0o700)
        rp2.setdata()
        assert rp2.getctime() > rp.getctime()
        assert not rpath._cmp_file_attribs(rp, rp2)
        rp.delete()
        rp2.delete()
Ejemplo n.º 2
0
    def testsnapshot(self):
        """Test making of a snapshot"""
        Globals.compression = None
        snap_rp = increment.Increment(rf, sym, target)
        self.check_time(snap_rp)
        self.assertTrue(rpath._cmp_file_attribs(snap_rp, sym))
        self.assertTrue(rpath.cmp(snap_rp, sym))
        snap_rp.delete()

        snap_rp2 = increment.Increment(sym, rf, target)
        self.check_time(snap_rp2)
        self.assertTrue(snap_rp2._equal_verbose(rf, check_index=0))
        self.assertTrue(rpath.cmp(snap_rp2, rf))
        snap_rp2.delete()