Skip to content

Commit

Permalink
tests: Skip filesystem tests if kernel module is not available
Browse files Browse the repository at this point in the history
We need to be able to mount the filesystems for most of the tests
so it makes sense to just skip the test if we have the userspace
tools but not the kernel module needed for mounting.
  • Loading branch information
vojtechtrefny committed May 7, 2024
1 parent 3d37037 commit f10742d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/fs_tests/fs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def setUpClass(cls):
except:
cls.f2fs_avail = False

if not BlockDev.utils_have_kernel_module("f2fs"):
cls.f2fs_avail = False

try:
cls.nilfs2_avail = BlockDev.fs_is_tech_avail(BlockDev.FSTech.NILFS2,
BlockDev.FSTechMode.MKFS |
Expand All @@ -69,6 +72,9 @@ def setUpClass(cls):
except:
cls.nilfs2_avail = False

if not BlockDev.utils_have_kernel_module("nilfs2"):
cls.nilfs2_avail = False

try:
cls.exfat_avail = BlockDev.fs_is_tech_avail(BlockDev.FSTech.EXFAT,
BlockDev.FSTechMode.MKFS |
Expand All @@ -88,6 +94,9 @@ def setUpClass(cls):
except:
cls.btrfs_avail = False

if not BlockDev.utils_have_kernel_module("btrfs"):
cls.btrfs_avail = False

try:
cls.udf_avail = BlockDev.fs_is_tech_avail(BlockDev.FSTech.UDF,
BlockDev.FSTechMode.MKFS |
Expand Down

0 comments on commit f10742d

Please sign in to comment.