From: Andreas Dilger Date: Tue, 18 Feb 2014 23:29:55 +0000 (-0500) Subject: tests: skip unsupported tests on MacOS systems X-Git-Tag: v1.42.10~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b97799c7472c2a9ead804db9651130651e8e033;p=thirdparty%2Fe2fsprogs.git tests: skip unsupported tests on MacOS systems The "mkswap" program is not available on MacOS, so just use the existing swap0.img.bz2 and swap1.img.bz2 files directly. Because MacOS HFS+ doesn't support sparse files (welcome to the 80's) the m_bigjournal test takes forever to zero out the whole 42GB test filesystem. Skip this test for Darwin kernels for now. Unfortunately, neither "df -T" nor "stat -f -c %T" is available on MacOS to directly determine the filesystem type, and I'm too lazy to parse the output of "mount" and match it to the path of the test directory in shell, so it just checks the kernel type and assumes the filesystem type is HFS and skips the test. Since this test runs on Linux the majority of the time, the loss of test coverage is minimal. If MacOS should ever get a real filesystem, this can be revisited. Signed-off-by: Andreas Dilger Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/blkid/test_probe.in b/lib/blkid/test_probe.in index 9b3edf529..a7b29a2e7 100644 --- a/lib/blkid/test_probe.in +++ b/lib/blkid/test_probe.in @@ -21,11 +21,11 @@ do echo "non-existent" continue fi - if [ "$i" = "swap0" ]; then + if [ "$i" = "swap0" ] && which mkswap > /dev/null; then # swap is native-endian, so regenerate before testing dd if=/dev/zero of=$IMAGE bs=16k count=64 2> /dev/null mkswap -v0 $IMAGE > /dev/null - elif [ "$i" = "swap1" ]; then + elif [ "$i" = "swap1" ] && which mkswap > /dev/null; then # swap is native-endian, so regenerate before testing dd if=/dev/zero of=$IMAGE bs=16k count=64 2> /dev/null # check if mkswap supports the "-U" option diff --git a/tests/m_bigjournal/script b/tests/m_bigjournal/script index 1e21fdfec..4c1ed9a82 100644 --- a/tests/m_bigjournal/script +++ b/tests/m_bigjournal/script @@ -1,4 +1,8 @@ DESCRIPTION="journal over 4GB in size" FS_SIZE=11000000 MKE2FS_OPTS="-t ext4 -G 512 -N 1280 -J size=5000 -q -E lazy_journal_init,lazy_itable_init,nodiscard" +if [ $(uname -s) = "Darwin" ]; then + echo "$test_name: $DESCRIPTION: skipped for HFS+ (no sparse files)" + return 0 +fi . $cmd_dir/run_mke2fs