]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tests: skip unsupported tests on MacOS systems
authorAndreas Dilger <adilger@dilger.ca>
Tue, 18 Feb 2014 23:29:55 +0000 (18:29 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 18 Feb 2014 23:30:00 +0000 (18:30 -0500)
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 <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/test_probe.in
tests/m_bigjournal/script

index 9b3edf52992ff27f8d327b11e090b1374d51fbb9..a7b29a2e73df7ab5212ad225180511a48f4fefb1 100644 (file)
@@ -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
index 1e21fdfec32653671d7227f23b8db6d55f52acf3..4c1ed9a828ed8ac03cff6f344252ce107d476d4c 100644 (file)
@@ -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