def test_bup_utimensat(tmpdir): if not xstat._bup_utimensat: return path = tmpdir + b'/foo' open(path, 'w').close() frac_ts = (0, 10**9 // 2) xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0) st = _helpers.stat(path) atime_ts = st[8] mtime_ts = st[9] WVPASSEQ(atime_ts[0], 0) WVPASS(atime_ts[1] == 0 or atime_ts[1] == frac_ts[1]) WVPASSEQ(mtime_ts[0], 0) WVPASS(mtime_ts[1] == 0 or mtime_ts[1] == frac_ts[1])
def test_bup_utimensat(): if not xstat._bup_utimensat: return with no_lingering_errors(), test_tempdir('bup-txstat-') as tmpdir: path = tmpdir + '/foo' open(path, 'w').close() frac_ts = (0, 10**9 / 2) xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0) st = _helpers.stat(path) atime_ts = st[8] mtime_ts = st[9] WVPASSEQ(atime_ts[0], 0) WVPASS(atime_ts[1] == 0 or atime_ts[1] == frac_ts[1]) WVPASSEQ(mtime_ts[0], 0) WVPASS(mtime_ts[1] == 0 or mtime_ts[1] == frac_ts[1])
def test_bup_utimensat(): if not xstat._bup_utimensat: return with no_lingering_errors(): with test_tempdir('bup-txstat-') as tmpdir: path = tmpdir + '/foo' open(path, 'w').close() frac_ts = (0, 10**9 / 2) xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0) st = _helpers.stat(path) atime_ts = st[8] mtime_ts = st[9] WVPASSEQ(atime_ts[0], 0) WVPASS(atime_ts[1] == 0 or atime_ts[1] == frac_ts[1]) WVPASSEQ(mtime_ts[0], 0) WVPASS(mtime_ts[1] == 0 or mtime_ts[1] == frac_ts[1])
def test_bup_utimensat(): if not xstat._bup_utimensat: return tmpdir = tempfile.mkdtemp(prefix="bup-tmetadata-") try: path = tmpdir + "/foo" open(path, "w").close() frac_ts = (0, 10 ** 9 / 2) xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0) st = _helpers.stat(path) atime_ts = st[8] mtime_ts = st[9] WVPASSEQ(atime_ts[0], 0) WVPASS(atime_ts[1] == 0 or atime_ts[1] == frac_ts[1]) WVPASSEQ(mtime_ts[0], 0) WVPASS(mtime_ts[1] == 0 or mtime_ts[1] == frac_ts[1]) finally: subprocess.call(["rm", "-rf", tmpdir])
def test_bup_utimensat(): initial_failures = wvfailure_count() if not xstat._bup_utimensat: return tmpdir = tempfile.mkdtemp(dir=bup_tmp, prefix='bup-txstat-') path = tmpdir + '/foo' open(path, 'w').close() frac_ts = (0, 10**9 / 2) xstat._bup_utimensat(_helpers.AT_FDCWD, path, (frac_ts, frac_ts), 0) st = _helpers.stat(path) atime_ts = st[8] mtime_ts = st[9] WVPASSEQ(atime_ts[0], 0) WVPASS(atime_ts[1] == 0 or atime_ts[1] == frac_ts[1]) WVPASSEQ(mtime_ts[0], 0) WVPASS(mtime_ts[1] == 0 or mtime_ts[1] == frac_ts[1]) if wvfailure_count() == initial_failures: subprocess.call(['rm', '-rf', tmpdir])