summaryrefslogtreecommitdiff
path: root/test/py/tests/test_fs/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/py/tests/test_fs/conftest.py')
-rw-r--r--test/py/tests/test_fs/conftest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
index ee82169c2a..58e8cd46ee 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -149,8 +149,6 @@ def mk_fs(config, fs_type, size, id):
mkfs_opt = '-F 16'
elif fs_type == 'fat32':
mkfs_opt = '-F 32'
- elif fs_type == 'ext4':
- mkfs_opt = '-O ^metadata_csum'
else:
mkfs_opt = ''
@@ -167,6 +165,10 @@ def mk_fs(config, fs_type, size, id):
% (fs_img, count), shell=True)
check_call('mkfs.%s %s %s'
% (fs_lnxtype, mkfs_opt, fs_img), shell=True)
+ if fs_type == 'ext4':
+ sb_content = check_output('tune2fs -l %s' % fs_img, shell=True).decode()
+ if 'metadata_csum' in sb_content:
+ check_call('tune2fs -O ^metadata_csum %s' % fs_img, shell=True)
return fs_img
except CalledProcessError:
call('rm -f %s' % fs_img, shell=True)