1*4882a593SmuzhiyunAdd checks for both mkfs.vfat and the vfat file system in the kernel before 2*4882a593Smuzhiyunrunning tests. 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunUpstream-Status: Submitted [https://alioth-lists.debian.net/pipermail/parted-devel/2021-August/005653.html] 5*4882a593SmuzhiyunSigned-off-by: Ross Burton <ross.burton@arm.com> 6*4882a593Smuzhiyun 7*4882a593Smuzhiyundiff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh 8*4882a593Smuzhiyunindex 4c6c75f..2cc7577 100644 9*4882a593Smuzhiyun--- a/tests/t-lib-helpers.sh 10*4882a593Smuzhiyun+++ b/tests/t-lib-helpers.sh 11*4882a593Smuzhiyun@@ -418,3 +418,13 @@ require_64bit_() 12*4882a593Smuzhiyun ;; 13*4882a593Smuzhiyun esac 14*4882a593Smuzhiyun } 15*4882a593Smuzhiyun+ 16*4882a593Smuzhiyun+# Check if the specified filesystem is either built into the kernel, or can be loaded 17*4882a593Smuzhiyun+# as a module 18*4882a593Smuzhiyun+# Usage: has_filesystem vfat 19*4882a593Smuzhiyun+# Ruturns 0 if the filesystem is available, otherwise skips the test 20*4882a593Smuzhiyun+require_filesystem_() 21*4882a593Smuzhiyun+{ 22*4882a593Smuzhiyun+ grep -q $1 /proc/filesystems && return 0 23*4882a593Smuzhiyun+ modprobe --quiet --dry-run $1 || skip_ "this test requires kernel support for $1" 24*4882a593Smuzhiyun+} 25*4882a593Smuzhiyundiff --git a/tests/t1100-busy-label.sh b/tests/t1100-busy-label.sh 26*4882a593Smuzhiyunindex f1a13df..0f47b08 100755 27*4882a593Smuzhiyun--- a/tests/t1100-busy-label.sh 28*4882a593Smuzhiyun+++ b/tests/t1100-busy-label.sh 29*4882a593Smuzhiyun@@ -19,6 +19,9 @@ 30*4882a593Smuzhiyun . "${srcdir=.}/init.sh"; path_prepend_ ../parted 31*4882a593Smuzhiyun require_root_ 32*4882a593Smuzhiyun require_scsi_debug_module_ 33*4882a593Smuzhiyun+require_fat_ 34*4882a593Smuzhiyun+require_filesystem_ vfat 35*4882a593Smuzhiyun+ 36*4882a593Smuzhiyun ss=$sector_size_ 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun scsi_debug_setup_ sector_size=$ss dev_size_mb=90 > dev-name || 39*4882a593Smuzhiyundiff --git a/tests/t1101-busy-partition.sh b/tests/t1101-busy-partition.sh 40*4882a593Smuzhiyunindex e35e6f0..c813848 100755 41*4882a593Smuzhiyun--- a/tests/t1101-busy-partition.sh 42*4882a593Smuzhiyun+++ b/tests/t1101-busy-partition.sh 43*4882a593Smuzhiyun@@ -22,6 +22,8 @@ test "$VERBOSE" = yes && parted --version 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun require_root_ 46*4882a593Smuzhiyun require_scsi_debug_module_ 47*4882a593Smuzhiyun+require_fat_ 48*4882a593Smuzhiyun+require_filesystem_ vfat 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun # create memory-backed device 51*4882a593Smuzhiyun scsi_debug_setup_ dev_size_mb=80 > dev-name || 52