summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount
diff options
context:
space:
mode:
authorRuediger Meier2016-03-12 12:23:32 +0100
committerRuediger Meier2016-03-13 21:47:38 +0100
commit131e54379454f4b39cbb77ee9d306a56c0873ad5 (patch)
tree200eb0701c024a2900cacb5d05a77eaa701e7979 /tests/ts/mount
parenttests: remove invalid argument in libmount/debug (diff)
downloadkernel-qcow2-util-linux-131e54379454f4b39cbb77ee9d306a56c0873ad5.tar.gz
kernel-qcow2-util-linux-131e54379454f4b39cbb77ee9d306a56c0873ad5.tar.xz
kernel-qcow2-util-linux-131e54379454f4b39cbb77ee9d306a56c0873ad5.zip
tests: improve skipping of old btrfs-tools
Older Linux distributions came with differently incomplete btrfs-tools 0.19+git versions (2009-2013). Old mkfs.btrfs needs minimum device size 256M. Note the most simple way to skip btrfs-tools < 3.14 would be btrfs property --help 2>&1 || ts_skip "btrfs too old" but I want to include 3.12 because of Ubuntu Trusty on travis. This patch partly reverts/rewrites the following commits: 7e604f3c - tests: don't skip case "output undefined" 076153f8 - tests: don't compare btrfs mount options 370d31f7 - tests: skip btrfs tests if version too old Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/mount')
-rwxr-xr-xtests/ts/mount/fstab-btrfs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/ts/mount/fstab-btrfs b/tests/ts/mount/fstab-btrfs
index 30aed1d32..6abbd0be1 100755
--- a/tests/ts/mount/fstab-btrfs
+++ b/tests/ts/mount/fstab-btrfs
@@ -30,8 +30,10 @@ ts_check_prog "mkfs.btrfs"
ts_check_prog "btrfs"
# btrfs feature check
-btrfs inspect rootid bla 2>&1 | grep -q "unknown token" \
- && ts_skip "btrfs too old"
+if ! btrfs inspect-internal --help &>/dev/null || \
+ btrfs inspect-internal rootid bla 2>&1 | grep -q "unknown token"; then
+ ts_skip "btrfs too old"
+fi
TS_MOUNTPOINT_ANY="$TS_MOUNTPOINT"
TS_MOUNTPOINT_CREATE="$TS_MOUNTPOINT-create"
@@ -62,7 +64,7 @@ mkdir bind-point
mkdir -p d1/dd1/ddd1
cd ./d1/dd1/ddd1
btrfs subvol create s2 >/dev/null
-DEFAULT_SUBVOLID=$(btrfs inspect rootid s2)
+DEFAULT_SUBVOLID=$(btrfs inspect-internal rootid s2)
btrfs subvol set-default $DEFAULT_SUBVOLID . >/dev/null
NON_DEFAULT_SUBVOLID=$(btrfs subvol list "$TS_MOUNTPOINT_CREATE" | while read dummy id rest ; do if test $id = $DEFAULT_SUBVOLID ; then continue ; fi ; echo $id ; done)
cd ../../../..