diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2019-02-13 12:15:23 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-04-09 15:34:15 -0400 |
commit | 290100583dc70185e76ddaa00c1a50abd162a5ad (patch) | |
tree | 9abc2399098d9de259d79da0b439fac58b206722 /test/py/tests/test_fs/test_mkdir.py | |
parent | 5cfc73e6e29f37a3a8daf5fd28bc4d5d015f778c (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_mkdir.py')
-rw-r--r-- | test/py/tests/test_fs/test_mkdir.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/py/tests/test_fs/test_mkdir.py b/test/py/tests/test_fs/test_mkdir.py index b3fe11cf3b..fa9561ec35 100644 --- a/test/py/tests/test_fs/test_mkdir.py +++ b/test/py/tests/test_fs/test_mkdir.py @@ -9,6 +9,7 @@ This test verifies mkdir operation on file system. """ import pytest +from fstest_helpers import assert_fs_integrity @pytest.mark.boardspec('sandbox') @pytest.mark.slow @@ -29,6 +30,8 @@ class TestMkdir(object): '%sls host 0:0 dir1' % fs_type) assert('./' in output) assert('../' in output) + assert_fs_integrity(fs_type, fs_img) + def test_mkdir2(self, u_boot_console, fs_obj_mkdir): """ @@ -46,6 +49,7 @@ class TestMkdir(object): '%sls host 0:0 dir1/dir2' % fs_type) assert('./' in output) assert('../' in output) + assert_fs_integrity(fs_type, fs_img) def test_mkdir3(self, u_boot_console, fs_obj_mkdir): """ @@ -58,6 +62,7 @@ class TestMkdir(object): 'host bind 0 %s' % fs_img, '%smkdir host 0:0 none/dir3' % fs_type]) assert('Unable to create a directory' in ''.join(output)) + assert_fs_integrity(fs_type, fs_img) def test_mkdir4(self, u_boot_console, fs_obj_mkdir): """ @@ -69,6 +74,7 @@ class TestMkdir(object): 'host bind 0 %s' % fs_img, '%smkdir host 0:0 .' % fs_type]) assert('Unable to create a directory' in ''.join(output)) + assert_fs_integrity(fs_type, fs_img) def test_mkdir5(self, u_boot_console, fs_obj_mkdir): """ @@ -80,6 +86,7 @@ class TestMkdir(object): 'host bind 0 %s' % fs_img, '%smkdir host 0:0 ..' % fs_type]) assert('Unable to create a directory' in ''.join(output)) + assert_fs_integrity(fs_type, fs_img) def test_mkdir6(self, u_boot_console, fs_obj_mkdir): """ @@ -111,3 +118,4 @@ class TestMkdir(object): '%sls host 0:0 dir6/0123456789abcdef13/..' % fs_type) assert('0123456789abcdef00/' in output) assert('0123456789abcdef13/' in output) + assert_fs_integrity(fs_type, fs_img) |