Esempio n. 1
0
def test_n11():
	"jfsck a nonexisting file"
	try:
		libjio.jfsck('this file does not exist')
	except IOError:
		return
	raise
Esempio n. 2
0
def test_n11():
    "jfsck a nonexisting file"
    try:
        libjio.jfsck('this file does not exist')
    except IOError:
        return
    raise
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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)
Esempio n. 6
0
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)
Esempio n. 7
0
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)
Esempio n. 8
0
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)
Esempio n. 9
0
def fsck(path, flags=0):
    "Calls libjio's jfsck()."
    res = libjio.jfsck(path, flags=flags)
    return res
Esempio n. 10
0
def fsck(path, flags = 0):
	"Calls libjio's jfsck()."
	res = libjio.jfsck(path, flags = flags)
	return res