All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 26/24] common: drop HOSTOS
Date: Thu, 17 Sep 2020 19:10:22 -0700	[thread overview]
Message-ID: <20200918021022.GK7954@magnolia> (raw)
In-Reply-To: <160013417420.2923511.6825722200699287884.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

We effectively support only Linux these days, so drop most of the
special casing of HOSTOS.  We'll retain the simple check just in case
someone tries to run this on a different operating system.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/config |   50 ++++++++++++++++++++++----------------------------
 common/rc     |   20 ++------------------
 common/xfs    |    2 +-
 3 files changed, 25 insertions(+), 47 deletions(-)

diff --git a/common/config b/common/config
index 1fe1e0e1..3de87ea7 100644
--- a/common/config
+++ b/common/config
@@ -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"
@@ -242,29 +242,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.
@@ -753,9 +749,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}
diff --git a/common/rc b/common/rc
index bbafc73d..3adeeefe 100644
--- a/common/rc
+++ b/common/rc
@@ -49,19 +49,13 @@ _math()
 
 dd()
 {
-   if [ "$HOSTOS" == "Linux" ]
-   then	
 	command dd --help 2>&1 | grep noxfer >/dev/null
-	
 	if [ "$?" -eq 0 ]
 	    then
 		command dd status=noxfer $@
 	    else
 		command dd $@
-    	fi
-   else
-	command dd $@
-   fi
+	fi
 }
 
 # Prints the md5 checksum of a given file
@@ -992,7 +986,7 @@ _scratch_mkfs_sized()
 
     local blocks=`expr $fssize / $blocksize`
 
-    if [ "$HOSTOS" == "Linux" -a -b "$SCRATCH_DEV" ]; then
+    if [ -b "$SCRATCH_DEV" ]; then
 	local devsize=`blockdev --getsize64 $SCRATCH_DEV`
 	[ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
     fi
@@ -1764,11 +1758,6 @@ _require_logdev()
 #
 _require_loop()
 {
-    if [ "$HOSTOS" != "Linux" ]
-    then
-	_notrun "This test requires linux for loopback device support"
-    fi
-
     modprobe loop >/dev/null 2>&1
     if grep loop /proc/devices >/dev/null 2>&1
     then
@@ -1782,11 +1771,6 @@ _require_loop()
 #
 _require_ext2()
 {
-    if [ "$HOSTOS" != "Linux" ]
-    then
-	_notrun "This test requires linux for ext2 filesystem support"
-    fi
-
     modprobe ext2 >/dev/null 2>&1
     if grep ext2 /proc/filesystems >/dev/null 2>&1
     then
diff --git a/common/xfs b/common/xfs
index 8a3fd30c..0f4b8521 100644
--- a/common/xfs
+++ b/common/xfs
@@ -481,7 +481,7 @@ _check_xfs_filesystem()
 
 	$XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
 		| tee $tmp.logprint | grep -q "<CLEAN>"
-	if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]; then
+	if [ $? -ne 0 ]; then
 		_log_err "_check_xfs_filesystem: filesystem on $device has dirty log"
 		echo "*** xfs_logprint -t output ***"	>>$seqres.full
 		cat $tmp.logprint			>>$seqres.full

  parent reply	other threads:[~2020-09-18  2:44 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  1:42 [PATCH 00/24] fstests: tons of random fixes Darrick J. Wong
2020-09-15  1:43 ` [PATCH 01/24] xfs/331: don't run this test if fallocate isn't supported Darrick J. Wong
2020-09-15 12:39   ` Zorro Lang
2020-09-17  7:50   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 02/24] generic/60[01]: fix test failure when setting new grace limit Darrick J. Wong
2020-09-15 12:55   ` Zorro Lang
2020-09-17  7:51   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 03/24] generic/607: don't break on filesystems that don't support FSGETXATTR on dirs Darrick J. Wong
2020-09-15 13:16   ` Zorro Lang
2020-09-17  1:41   ` Xiao Yang
2020-09-17  3:27     ` Darrick J. Wong
2020-09-17  3:43       ` Xiao Yang
2020-09-17  3:56         ` Darrick J. Wong
2020-09-17  7:52           ` Christoph Hellwig
2020-09-17 15:54             ` Darrick J. Wong
2020-09-17 16:02               ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 04/24] xfs: skip tests that rely on allocation behaviors of the data device Darrick J. Wong
2020-09-16  2:04   ` Zorro Lang
2020-09-17  7:53   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 05/24] xfs/031: make sure we don't set rtinherit=1 on mkfs Darrick J. Wong
2020-09-16  2:21   ` Zorro Lang
2020-09-17  7:53   ` Christoph Hellwig
2020-09-17 15:57     ` Darrick J. Wong
2020-09-17 16:01       ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 06/24] xfs: wrap xfs_db calls to the test device Darrick J. Wong
2020-09-16  2:25   ` Zorro Lang
2020-09-17  7:54   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 07/24] xfs/{111,137}: replace open-coded calls to repair with _scratch_xfs_repair Darrick J. Wong
2020-09-16  2:28   ` Zorro Lang
2020-09-17  7:54   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 08/24] xfs: replace open-coded calls to xfs_logprint with helpers Darrick J. Wong
2020-09-16  2:35   ` Zorro Lang
2020-09-17  7:54   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 09/24] xfs/070: add scratch log device options to direct repair invocation Darrick J. Wong
2020-09-16  2:42   ` Zorro Lang
2020-09-16  3:42     ` Darrick J. Wong
2020-09-16 11:25       ` Zorro Lang
2020-09-17  7:55   ` Christoph Hellwig
2020-09-15  1:43 ` [PATCH 10/24] xfs: add a _require_xfs_copy helper Darrick J. Wong
2020-09-16  3:29   ` Zorro Lang
2020-09-17  7:55   ` Christoph Hellwig
2020-09-15  1:44 ` [PATCH 11/24] overlay/{069,071}: fix undefined variables Darrick J. Wong
2020-09-15  8:48   ` Amir Goldstein
2020-09-15  1:44 ` [PATCH 12/24] overlay/020: make sure the system supports the required namespaces Darrick J. Wong
2020-09-15  8:46   ` Amir Goldstein
2020-09-15  1:44 ` [PATCH 13/24] generic/204: don't flood stdout with ENOSPC messages on an ENOSPC test Darrick J. Wong
2020-09-16  4:14   ` Zorro Lang
2020-09-17  7:56   ` Christoph Hellwig
2020-09-17 16:02     ` Darrick J. Wong
2020-09-15  1:44 ` [PATCH 14/24] common/xfs: extract minimum log size message from mkfs correctly Darrick J. Wong
2020-09-16  5:28   ` Zorro Lang
2020-09-17  7:56   ` Christoph Hellwig
2020-09-15  1:44 ` [PATCH 15/24] xfs/194: actually check if we got 512-byte blocks before proceeding Darrick J. Wong
2020-09-16 11:34   ` Zorro Lang
2020-09-16 21:07     ` Darrick J. Wong
2020-09-15  1:44 ` [PATCH 16/24] xfs/098: adapt to external log devices Darrick J. Wong
2020-09-16 11:36   ` Zorro Lang
2020-09-17  7:58   ` Christoph Hellwig
2020-09-15  1:44 ` [PATCH 17/24] xfs: refactor _xfs_check calls to the scratch device Darrick J. Wong
2020-09-16 11:39   ` Zorro Lang
2020-09-17  7:58   ` Christoph Hellwig
2020-09-17 16:03     ` Darrick J. Wong
2020-09-15  1:44 ` [PATCH 18/24] xfs/291: fix open-coded repair call to mdrestore'd fs image Darrick J. Wong
2020-09-16 11:41   ` Zorro Lang
2020-09-15  1:44 ` [PATCH 19/24] xfs/424: disable external devices Darrick J. Wong
2020-09-16 11:48   ` Zorro Lang
2020-09-17  7:59   ` Christoph Hellwig
2020-09-15  1:45 ` [PATCH 20/24] xfs/449: fix xfs info report output if realtime device specified Darrick J. Wong
2020-09-16 11:50   ` Zorro Lang
2020-09-17  7:59   ` Christoph Hellwig
2020-09-15  1:45 ` [PATCH 21/24] common/rc: teach _scratch_mkfs_sized to set a size on an xfs realtime volume Darrick J. Wong
2020-09-16 12:02   ` Zorro Lang
2020-09-17  8:00   ` Christoph Hellwig
2020-09-17 16:04     ` Darrick J. Wong
2020-09-18  2:08   ` [PATCH v2 " Darrick J. Wong
2020-09-15  1:45 ` [PATCH 22/24] xfs/141: run for longer with TIME_FACTOR Darrick J. Wong
2020-09-16 12:05   ` Zorro Lang
2020-09-17  8:01   ` Christoph Hellwig
2020-09-15  1:45 ` [PATCH 23/24] generic/204: sync before scrub hits EIO Darrick J. Wong
2020-09-16 12:09   ` Zorro Lang
2020-09-17  8:01   ` Christoph Hellwig
2020-09-15  1:45 ` [PATCH 24/24] check: try reloading modules Darrick J. Wong
2020-09-15  8:42   ` Amir Goldstein
2020-09-18  2:10 ` Darrick J. Wong [this message]
2020-09-18  2:11 ` [PATCH 27/24] common/rc: fix indentation in _scratch_mkfs_sized Darrick J. Wong
2020-09-19  5:13   ` Christoph Hellwig
     [not found] ` <20200918020936.GJ7954@magnolia>
2020-09-19  5:13   ` [PATCH 25/24] common: kill _supported_os Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200918021022.GK7954@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.