btrfs: add test for zone auto reclaim
[xfstests-dev.git] / common / config
index e356bcda7e7057dfea21da5d8c93021e55d4fcab..1a26934985dd6417f9d2d999556cd0b69aa2a47a 100644 (file)
@@ -46,7 +46,7 @@ export LC_ALL=C
 PATH=".:$PATH"
 
 export HOST=`hostname -s`
-export HOSTOS=`uname -s`
+test `uname -s` = "Linux" || _fatal "fstests only supports Linux"
 
 export MODULAR=0               # using XFS as a module or not
 export BOOT="/boot"            # install target for kernels
@@ -143,7 +143,7 @@ export PS_ALL_FLAGS="-ef"
 
 export DF_PROG="$(type -P df)"
 [ "$DF_PROG" = "" ] && _fatal "df not found"
-[ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T -P"
+export DF_PROG="$DF_PROG -T -P"        # Linux
 
 export XFS_IO_PROG="$(type -P xfs_io)"
 [ "$XFS_IO_PROG" = "" ] && _fatal "xfs_io not found"
@@ -156,6 +156,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f"
 export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)"
 export XFS_REPAIR_PROG="$(type -P xfs_repair)"
 export XFS_DB_PROG="$(type -P xfs_db)"
+export XFS_METADUMP_PROG="$(type -P xfs_metadump)"
 export XFS_ADMIN_PROG="$(type -P xfs_admin)"
 export XFS_GROWFS_PROG=$(type -P xfs_growfs)
 export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)"
@@ -202,6 +203,7 @@ export GETRICHACL_PROG="$(type -P getrichacl)"
 export SETRICHACL_PROG="$(type -P setrichacl)"
 export KEYCTL_PROG="$(type -P keyctl)"
 export XZ_PROG="$(type -P xz)"
+export LZ4_PROG="$(type -P lz4)"
 export FLOCK_PROG="$(type -P flock)"
 export LDD_PROG="$(type -P ldd)"
 export TIMEOUT_PROG="$(type -P timeout)"
@@ -223,6 +225,8 @@ export CC_PROG="$(type -P cc)"
 export FSVERITY_PROG="$(type -P fsverity)"
 export OPENSSL_PROG="$(type -P openssl)"
 export ACCTON_PROG="$(type -P accton)"
+export E2IMAGE_PROG="$(type -P e2image)"
+export BLKZONE_PROG="$(type -P blkzone)"
 
 # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled.
 # newer systems have udevadm command but older systems like RHEL5 don't.
@@ -242,29 +246,25 @@ if [ "$UDEV_SETTLE_PROG" == "" ]; then
 fi
 export UDEV_SETTLE_PROG
 
-case "$HOSTOS" in
-    Linux)
-       export MKFS_XFS_PROG=$(type -P mkfs.xfs)
-       export MKFS_EXT4_PROG=$(type -P mkfs.ext4)
-       export MKFS_UDF_PROG=$(type -P mkudffs)
-       export MKFS_BTRFS_PROG=$(set_mkfs_prog_path_with_opts btrfs)
-       export MKFS_F2FS_PROG=$(set_mkfs_prog_path_with_opts f2fs)
-       export DUMP_F2FS_PROG=$(type -P dump.f2fs)
-       export F2FS_IO_PROG=$(type -P f2fs_io)
-       export BTRFS_UTIL_PROG=$(type -P btrfs)
-       export BTRFS_SHOW_SUPER_PROG=$(type -P btrfs-show-super)
-       export BTRFS_CONVERT_PROG=$(type -P btrfs-convert)
-       export BTRFS_TUNE_PROG=$(type -P btrfstune)
-       export XFS_FSR_PROG=$(type -P xfs_fsr)
-       export MKFS_NFS_PROG="false"
-       export MKFS_CIFS_PROG="false"
-       export MKFS_OVERLAY_PROG="false"
-       export MKFS_REISER4_PROG=$(type -P mkfs.reiser4)
-       export E2FSCK_PROG=$(type -P e2fsck)
-       export TUNE2FS_PROG=$(type -P tune2fs)
-       export FSCK_OVERLAY_PROG=$(type -P fsck.overlay)
-        ;;
-esac
+export MKFS_XFS_PROG=$(type -P mkfs.xfs)
+export MKFS_EXT4_PROG=$(type -P mkfs.ext4)
+export MKFS_UDF_PROG=$(type -P mkudffs)
+export MKFS_BTRFS_PROG=$(set_mkfs_prog_path_with_opts btrfs)
+export MKFS_F2FS_PROG=$(set_mkfs_prog_path_with_opts f2fs)
+export DUMP_F2FS_PROG=$(type -P dump.f2fs)
+export F2FS_IO_PROG=$(type -P f2fs_io)
+export BTRFS_UTIL_PROG=$(type -P btrfs)
+export BTRFS_SHOW_SUPER_PROG=$(type -P btrfs-show-super)
+export BTRFS_CONVERT_PROG=$(type -P btrfs-convert)
+export BTRFS_TUNE_PROG=$(type -P btrfstune)
+export XFS_FSR_PROG=$(type -P xfs_fsr)
+export MKFS_NFS_PROG="false"
+export MKFS_CIFS_PROG="false"
+export MKFS_OVERLAY_PROG="false"
+export MKFS_REISER4_PROG=$(type -P mkfs.reiser4)
+export E2FSCK_PROG=$(type -P e2fsck)
+export TUNE2FS_PROG=$(type -P tune2fs)
+export FSCK_OVERLAY_PROG=$(type -P fsck.overlay)
 
 # SELinux adds extra xattrs which can mess up our expected output.
 # So, mount with a context, and they won't be created.
@@ -413,6 +413,9 @@ _mkfs_opts()
        f2fs)
                export MKFS_OPTIONS="$F2FS_MKFS_OPTIONS"
                ;;
+       btrfs)
+               export MKFS_OPTIONS="$BTRFS_MKFS_OPTIONS"
+               ;;
        *)
                ;;
        esac
@@ -451,7 +454,7 @@ known_hosts()
 # in the section name otherwise the section will not be resognised.
 # Section name must be contained between square brackets.
 get_config_sections() {
-       sed -n -e "s/^\[\([[:alnum:]_]*\)\]/\1/p" < $1
+       sed -n -e "s/^\[\([[:alnum:]_-]*\)\]/\1/p" < $1
 }
 
 if [ ! -f "$HOST_OPTIONS" ]; then
@@ -753,9 +756,7 @@ if [ -z "$CONFIG_INCLUDED" ]; then
 
        # Autodetect fs type based on what's on $TEST_DEV unless it's been set
        # externally
-       if [ -z "$FSTYP" ] && \
-          [ "$HOSTOS" == "Linux" -o "$OSTYPE" == "linux-gnu" ] && \
-          [ ! -z "$TEST_DEV" ]; then
+       if [ -z "$FSTYP" ] && [ ! -z "$TEST_DEV" ]; then
                FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV`
        fi
        FSTYP=${FSTYP:=xfs}