summaryrefslogtreecommitdiff
path: root/test/py/tests/test_fs/test_basic.py
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2019-02-13 12:15:23 +0100
committerTom Rini <trini@konsulko.com>2019-04-09 15:34:15 -0400
commit290100583dc70185e76ddaa00c1a50abd162a5ad (patch)
tree9abc2399098d9de259d79da0b439fac58b206722 /test/py/tests/test_fs/test_basic.py
parent5cfc73e6e29f37a3a8daf5fd28bc4d5d015f778c (diff)
test: fs: Add filesystem integrity checks
We need to make sure that file writes,file creation, etc. are properly performed and do not corrupt the filesystem. To help with this, introduce the assert_fs_integrity() function that executes the appropriate fsck tool. It should be called at the end of any test that modify the content/organization of the filesystem. Currently only supports FATs and EXT4. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test/py/tests/test_fs/test_basic.py')
-rw-r--r--test/py/tests/test_fs/test_basic.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/py/tests/test_fs/test_basic.py b/test/py/tests/test_fs/test_basic.py
index 140ca29ac7..71f3e86fb1 100644
--- a/test/py/tests/test_fs/test_basic.py
+++ b/test/py/tests/test_fs/test_basic.py
@@ -11,6 +11,7 @@ This test verifies basic read/write operation on file system.
import pytest
import re
from fstest_defs import *
+from fstest_helpers import assert_fs_integrity
@pytest.mark.boardspec('sandbox')
@pytest.mark.slow
@@ -237,6 +238,7 @@ class TestFsBasic(object):
'md5sum %x $filesize' % ADDR,
'setenv filesize'])
assert(md5val[0] in ''.join(output))
+ assert_fs_integrity(fs_type, fs_img)
def test_fs12(self, u_boot_console, fs_obj_basic):
"""
@@ -252,6 +254,7 @@ class TestFsBasic(object):
'host bind 0 %s' % fs_img,
'%swrite host 0:0 %x /. 0x10' % (fs_type, ADDR)])
assert('Unable to write' in ''.join(output))
+ assert_fs_integrity(fs_type, fs_img)
def test_fs13(self, u_boot_console, fs_obj_basic):
"""
@@ -286,3 +289,4 @@ class TestFsBasic(object):
'md5sum %x $filesize' % ADDR,
'setenv filesize'])
assert(md5val[0] in ''.join(output))
+ assert_fs_integrity(fs_type, fs_img)