def test_n11(): "jfsck a nonexisting file" try: libjio.jfsck('this file does not exist') except IOError: return raise
def test_n12(): "jfsck with a nonexisting dir" f, jf = bitmp() try: libjio.jfsck(f.name, 'this directory does not exist') except IOError: cleanup(f.name) return raise
def test_n13(): "move journal to a nonexisting dir" import os f, jf = bitmp() n = f.name p = tmppath() jf.write('x') jf.jmove_journal(p) jf.write('y') del jf assert libjio.jfsck(n, p)['total'] == 0 os.unlink(n)
def test_n17(): "move journal to an existing dir" import os f, jf = bitmp() n = f.name p = tmppath() os.mkdir(p) open(p + '/x', 'w') jf.write('x') jf.jmove_journal(p) jf.write('y') del jf os.unlink(p + '/x') assert libjio.jfsck(n, p)['total'] == 0 os.unlink(n)
def fsck(path, flags=0): "Calls libjio's jfsck()." res = libjio.jfsck(path, flags=flags) return res
def fsck(path, flags = 0): "Calls libjio's jfsck()." res = libjio.jfsck(path, flags = flags) return res