* [PATCH 0/5] fstests: remove old SGI QE scripts
@ 2025-03-06 21:34 Dave Chinner
2025-03-06 21:34 ` [PATCH 1/5] fstests: remove setup script Dave Chinner
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
Hi folks,
The scripts this patchset removes are historical relics. They
haven't been maintained, in many cases they don't work, and in a
couple fo cases they are reliant on test machines that SGI
decomissioned almost two decades ago.
There is no point in trying to maintain these scripts, but they
still create dependencies on common fstests code that is now getting
in the way of making changes to fstests infrastructure.
Hence we should simply remove them and get rid of all the technical
debt they contain with them.
-Dave.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] fstests: remove setup script
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
@ 2025-03-06 21:34 ` Dave Chinner
2025-03-06 21:34 ` [PATCH 2/5] fstests: remove old soak script Dave Chinner
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
From: Dave Chinner <dchinner@redhat.com>
THere is a script that will echo the current setup of the fstests
directory. This is largely the same output as running 'check -n' to
do a dry-run outputs. Hence this script is redundant, not likely to
be widely used and is easily replaced with check itself. Remove it.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
setup | 81 -----------------------------------------------------------
1 file changed, 81 deletions(-)
delete mode 100755 setup
diff --git a/setup b/setup
deleted file mode 100755
index 375a54c98..000000000
--- a/setup
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights Reserved.
-#
-usage()
-{
-
- echo "Usage: $0 [options]"'
-
- -s section run only specified section(s) from config file
- -S section exclude the specified section from the config file
-'
- exit 0
-}
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -\? | -h | --help) usage ;;
- -s) RUN_SECTION="$RUN_SECTION $2"; shift ;;
- -S) EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;;
- *) usage ;;
- esac
- shift
-done
-
-if ! . ./common/config
-then
- echo "check: failed to source common/config"
- exit 1
-fi
-
-for section in $HOST_OPTIONS_SECTIONS; do
- OLD_FSTYP=$FSTYP
- OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS
- get_next_config $section
-
- # Do we need to run only some sections ?
- if [ ! -z "$RUN_SECTION" ]; then
- skip=true
- for s in $RUN_SECTION; do
- if [ $section == $s ]; then
- skip=false
- break;
- fi
- done
- if $skip; then
- continue
- fi
- fi
-
- # Did this section get excluded?
- if [ ! -z "$EXCLUDE_SECTION" ]; then
- skip=false
- for s in $EXCLUDE_SECTION; do
- if [ $section == $s ]; then
- skip=true
- break;
- fi
- done
- if $skip; then
- continue
- fi
- fi
-
- [ "$USE_EXTERNAL" = yes ] || USE_EXTERNAL=no
- [ "$USE_LBD_PATCH" = yes ] || USE_LBD_PATCH=no
- [ "$LARGE_SCRATCH_DEV" = yes ] || LARGE_SCRATCH_DEV=no
- [ "$USE_ATTR_SECURE" = yes ] || USE_ATTR_SECURE=no
- [ -z "$FSTYP" ] && FSTYP="xfs"
-
- cat <<EOF
-SECTION -- $section
-
-TEST: DIR=$TEST_DIR DEV=$TEST_DEV rt=[$TEST_RTDEV] log=[$TEST_LOGDEV]
-TAPE: dev=[$TAPE_DEV] rmt=[$RMT_TAPE_DEV] rmtirix=[$RMT_TAPE_USER@$RMT_IRIXTAPE_DEV]
-SCRATCH: MNT=$SCRATCH_MNT DEV=$SCRATCH_DEV rt=[$SCRATCH_RTDEV] log=[$SCRATCH_LOGDEV]
-VARIABLES: external=$USE_EXTERNAL largeblk=$USE_LBD_PATCH fstyp=$FSTYP
- large_scratch_dev=$LARGE_SCRATCH_DEV attrsecure=$USE_ATTR_SECURE
---------
-EOF
-done
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] fstests: remove old soak script
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
2025-03-06 21:34 ` [PATCH 1/5] fstests: remove setup script Dave Chinner
@ 2025-03-06 21:34 ` Dave Chinner
2025-03-06 21:34 ` [PATCH 3/5] fstests: remove crash script Dave Chinner
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
From: Dave Chinner <dchinner@redhat.com>
There is an old script for soak testing using check in the source
tree called "soak". All it does is run fsstress in a loop on the
scratch device, but to do that it needs to include the entire
fstests config/setup scripts.
These days we have much better soak testing capabilities (e.g. the
soak and stress groups, with controllable iterations, durations,
load, etc) so there's no point in keeping old scripts like this
around that add weird dependencies to the core infrastructure.
Remove it.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
soak | 121 -----------------------------------------------------------
1 file changed, 121 deletions(-)
delete mode 100755 soak
diff --git a/soak b/soak
deleted file mode 100755
index d5c4229ad..000000000
--- a/soak
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
-#
-
-# get standard environment, filters and checks
-. ./common/rc
-. ./common/filter
-
-tmp=/tmp/$$
-seq=soak
-status=1 # failure is the default!
-
-_cleanup()
-{
- echo " *** umount"
- _scratch_unmount >/dev/null 2>&1
-}
-
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-ROOT="."
-LOG="$ROOT/soak.log"
-FULL="$ROOT/soak.full"
-
-_log()
-{
- echo "$*" 1>&2
- echo "$*" >>$LOG
- echo "$*" >>$FULL
-}
-
-_logp()
-{
- tee -a $FULL
-}
-
-_fail()
-{
- _log "$*"
- status=1
- exit 1
-}
-
-_require_scratch
-
-passes=-1
-stress=100000
-proc=1
-
-if [ $# -gt 0 ]
-then
- passes=$1
- if [ $# -gt 1 ]
- then
- stress=$2
- if [ $# -gt 2 ]
- then
- proc=$3
- fi
- fi
-fi
-
-echo "" >$FULL
-echo "" >$LOG
-_log "*** soak test started (passes=$passes, stress=$stress, proc=$proc)"
-_log "*** (`date`)"
-
-
-_log " *** init"
-_log " *** unmounting scratch device"
-
-_scratch_unmount 2>&1 >>$FULL
-
-_log " *** clean scratch device"
-
-mkfs_xfs -f $SCRATCH_DEV 2>&1 >>$FULL \
- || _fail " !!! failed to mkfs SCRATCH_DEV"
-
-pass=1
-
-while [ $pass -le $passes -o $passes -lt 0 ]
-do
- _log " *** pass $pass (`date`)"
-
- _log " *** check"
- _check_scratch_fs
-
- _log " *** mounting scratch device"
-
- if ! _scratch_mount 2>&1 | _logp
- then
- _fail " !!! failed to mount"
- fi
-
- if [ $pass != 1 ]
- then
- _log " *** cleanup"
- rm -rf $SCRATCH_MNT/soak_test \
- || _fail " !!! couldn't delete old dir"
-
- _log " *** check"
- _check_scratch_fs
- fi
-
- _log " *** mkdir"
- mkdir $SCRATCH_MNT/soak_test \
- || _fail " !!! couldn't delete old dir"
-
- _log " *** stress"
- ltp/fsstress -d $SCRATCH_MNT/soak_test -p $proc -n $stress $FSSTRESS_AVOID 2>&1 | \
- >>$FULL
-
- _log " *** unmounting scratch device"
-
- _scratch_unmount 2>&1 | _logp \
- || _fail " !!! failed to umount"
-
- let "pass = pass + 1"
-done
-
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] fstests: remove crash script
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
2025-03-06 21:34 ` [PATCH 1/5] fstests: remove setup script Dave Chinner
2025-03-06 21:34 ` [PATCH 2/5] fstests: remove old soak script Dave Chinner
@ 2025-03-06 21:34 ` Dave Chinner
2025-03-06 21:34 ` [PATCH 4/5] fstests: remove tools/auto-qa Dave Chinner
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
From: Dave Chinner <dchinner@redhat.com>
This is an old, early 2000s SGI era script for crash and recovery
testing XFS filesystems. We have much better ways of doing this
today with tools like dm-error, dm-flakey, etc. Nobody has been
using this script for years, so remove it.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
crash/README | 151 --------------
crash/rc.sysinit | 46 -----
crash/xfscrash | 506 -----------------------------------------------
3 files changed, 703 deletions(-)
delete mode 100644 crash/README
delete mode 100644 crash/rc.sysinit
delete mode 100755 crash/xfscrash
diff --git a/crash/README b/crash/README
deleted file mode 100644
index 36f2ec65e..000000000
--- a/crash/README
+++ /dev/null
@@ -1,151 +0,0 @@
-############
-# xfscrash # crash testing setup for XFS
-############
-
-*** disclaimers ***
-
- work-in-progress, buyer-beware, your-mileage-may-vary, this-is-a-hack
-
-*** what xfscrash does ***
-
- xfscrash allows realistic testing of XFS log recovery and XFS check/repair
- by generating log activity on an XFS partition, then rebooting the machine
- at a random point. When the machine comes back up, xfscrash is restarted
- and then tests either the log recovery or xfs_repair on the dirtied
- filesystem. All going well the process continues.
-
-*** getting ready for crash testing ***
-
- Most filesystems (ext2 included) can't withstand having the machine
- they're running on rebooted while they're active. So the crash test
- machine needs to have all filesystems other than the test FS mounted
- read-only so they won't get trashed when the machine reboots.
-
-*** mouting FSes read-only ***
-
- Following is a recipe for making a redhat linux (6.2) machine with a single
- ext2 FS mounted on root able to be booted read-only. Your Mileage May
- Vary - don't try this on an important machine.
-
- The idea is to move anything that needs to be r/w into the /initrd_init
- directory, replacing the moved directories with links to the moved ones.
- That way the /initrd_init directory may be copied to a ramdisk, and
- mounted over /initrd on the root FS which never gets remounted r/w.
-
- # go to single user
- init 1
-
- # make a mount point for the ramdisk
- mkdir /initrd
-
- # link across to the /initrd_init directory for when
- # the ramdisk isn't mounted
- ln -s /initrd_init/dev .
- ln -s /initrd_init/etc .
- ln -s /initrd_init/proc .
- ln -s /initrd_init/sbin .
- ln -s /initrd_init/tmp .
- ln -s /initrd_init/var .
-
- # make the /initrd_init directory
- mkdir /initrd_init
- cd /initrd_init
-
-
- # move /dev
- mv /dev .
- ln -s /dev /initrd/dev
-
- # move /etc
- mv /etc .
- ln -s /etc /initrd/etc
-
- # make proc mount
- mkdir proc
-
- # move /tmp
- mkdir tmp
- rm -rf /tmp
- ln -s /tmp /initrd/tmp
-
- # link /sbin
- ln -s /sbin .
-
- # setup a tree for parts of /var
- mkdir var var/cache var/lock var/lock/console var/lock/subsys
- mkdir var/log var/preserve var/run
-
- touch /var/run/utmp /var/log/utmp /var/log/wtmp
-
- # move parts of /var
- rm -rf /var/cache /var/lock /var/log /var/preserve /var/run
- ln -s /initrd/var/cache /var/cache
- ln -s /initrd/var/lock /var/lock
- ln -s /initrd/var/log /var/log
- ln -s /initrd/var/preserve /var/preserve
- ln -s /initrd/var/run /var/run
-
- # make a mount for /var/shm
- mkdir var/shm
- ln -s /var/shm /initrd/var/shm
-
- # move /var/spool
- mkdir var/spool
- mkdir var/spool/mail var/spool/anacron var/spool/at var/spool/lpd
- mkdir var/spool/rwho var/spool/mqueue var/spool/cron
- rm -rf /var/spool
- ln -s /var/spool /initrd/var/spool
-
- # move /var/tmp
- mkdir var/tmp
- rm -rf /var/tmp
- ln -s /var/tmp /initrd/var/tmp
-
- # trim /dev - too many inodes here - remove anything you don't need
- # (small ramdisk has a small number of inodes)
- rm -rf /initrd/dev/<....>
-
- All going well, all the directories you've made should link through
- /initrd and into /initrd_init, and the machine should come back up
- if you restart it.
-
- You want to keep the contents of /initrd_init to a minimum because
- this stuff has to fit into the ramdisk.
-
-*** getting the ramdisk going ***
-
- See the rc.sysinit file for some details of what to do to get the
- ro-root/ramdisk up and running.
-
- Once everything is going, the root FS should never be remounted to
- r/w on boot and should be in r/o mode when the machine comes up.
-
- All going well, any open files have been redirected through the
- symlinks onto the ramdisk, so you should be able to remount the
- root FS to r/w and then remount it back to r/o.
-
- Since there's no r/w filesystems mounted, it should be ok to
- reboot the machine with 'reboot -fn' and everything should come
- back without dirty filesystems and without having to fsck.
-
-*** starting xfscrash ***
-
- The simplest way to restart xfscrash on reboot is to start it
- in the background from rc.local. The script logs to /dev/tty1,
- /dev/console & a logfile by default, so the output should be
- easy to find.
-
- Link the xfscrash directory off an NFS mounted FS so you can make
- changes while the machine is rebooting and so you can touch the
- 'stop' and 'start' control files.
-
- To configure the system, change the parameters in the configuration
- section of the 'xfscrash' script.
-
- To start the system, touch the 'start' control file and then either
- reboot or manually run the 'xfscrash' script.
-
- To stop the system, touch the 'stop' control file and wait for the
- next cycle to start when the control file will be checked and
- the test terminated.
-
diff --git a/crash/rc.sysinit b/crash/rc.sysinit
deleted file mode 100644
index 0f0781a79..000000000
--- a/crash/rc.sysinit
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
-#
-# xfscrash - control the XFS crash tests
-#
-
-# this is an example of what to add to rc.sysinit on a redhat linux
-# system to get the ro-root/ramdisk system up and running
-
-if [ -f /initrd.active ]
-then
- echo "*** MAKE RAMDISK ***"
- dd if=/dev/zero of=/dev/ram0 bs=1024k count=4
- mkfs -i 1024 /dev/ram0 4096
- echo "*** MOUNT RAMDISK ***"
- mount -n -w /dev/ram0 /mnt
- echo "*** INIT RAMDISK ***"
- cp -a /initrd_init/* /mnt
- rm -f /mnt/00_INITRD_REAL
- touch /mnt/00_INITRD_RAMDISK
- umount -n /mnt
- echo "*** REMOUNT RAMDISK ***"
- mount -n /dev/ram0 /initrd
-
- echo "*** FIX MTAB ***"
- >/etc/mtab
- rm -f /etc/mtab~ /etc/mtab~~
- mount -f -o ro /
- mount -f -o rw /dev/ram0 /initrd
-else
- # old code
-
- # Remount the root filesystem read-write.
- action "Remounting root filesystem in read-write mode" mount -n -o remount,rw /
-
- # Clear mtab
- >/etc/mtab
-
- # Remove stale backups
- rm -f /etc/mtab~ /etc/mtab~~
-
- # Enter root and /proc into mtab.
- mount -f /
- mount -f /proc
-
-fi
diff --git a/crash/xfscrash b/crash/xfscrash
deleted file mode 100755
index 037b3df1e..000000000
--- a/crash/xfscrash
+++ /dev/null
@@ -1,506 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
-#
-# xfscrash - control the XFS crash tests
-#
-
- #######################
-### configuration stuff ########################################################
- #######################
-
-# remount, repair or corrupt
-MODE=remount
-# where to find xfscrash
-XFSCRASH=/xfscrash
-# put log files here
-LOG=$XFSCRASH
-# put output to these places
-OUTPUT="$LOG/xfscrash.log /dev/tty1 /dev/console"
-# awk...
-AWK_PROG=gawk
-# clear FS if >= this percent full at start of run. 100 is a good
-# number - only used on corrupt test so far
-FULL_LIMIT=80
-
-case `hostname -s`
-in
- leesa)
- # mount test partition here
- TEST_MNT=/mnt/arch0
- # build test partition here
- TEST_DEV=/dev/hda6
- # backup test partition to here (or empty)
- BACKUP_DEV=/dev/hda8
- # backup block size for dd
- BACKUP_BS=1024k
- # base stress time
- STRESS_TIME=60
- # stress random time
- STRESS_RANDOM=60
- ;;
- lumpy)
- # mount test partition here
- TEST_MNT=/mnt/scratch_0
- # build test partition here
- TEST_DEV=/dev/sdc5
- # backup test partition to here (or empty)
- BACKUP_DEV= ;#/dev/sdc6
- # backup block size for dd
- BACKUP_BS=10240k
- # base stress time
- STRESS_TIME=360
- # stress random time
- STRESS_RANDOM=360
- ;;
- *)
- echo "!!! no configuration data for host `hostname -s`"
- exit 1
- ;;
-esac
-
-# avoid stress
-
-AVOID="-f resvsp=0 -f unresvsp=0"
-
-# DIY stress command
-STRESS="/usr/local/bin/fsstress -d $TEST_MNT/stress -n 10000000 -p 1 $AVOID"
-#STRESS="/usr/local/bin/randholes -l 10000000 -c 100000 -b 512 $TEST_MNT/stress/holes"
-
-# stress command for the corrupt test
-CORRUPT_STRESS="/usr/local/bin/fsstress -d $TEST_MNT/stress -n 10000 -p 1 $AVOID"
-
-###########################################################################
-
-reboot=-1
-
-_log()
-{
- tee -a $OUTPUT > /dev/null
-}
-
-_echo()
-{
- echo "$*" | _log
-}
-
-_mount()
-{
- _echo " *** Mounting $TEST_DEV on $TEST_MNT"
- if ! mount -t xfs $TEST_DEV $TEST_MNT
- then
- _echo " !!! unable to mount"
- exit 1
- fi
-}
-
-_unmount()
-{
- _echo " *** Unmounting $TEST_DEV"
- if ! umount $TEST_DEV &> /dev/null
- then
- _echo " !!! unable to unmount"
- exit 1
- fi
-}
-
-_check()
-{
- expect=$1
- fail=0
-
- if [ $expect -eq 0 ]
- then
- _echo " *** xfs_repair -n ($LOG/repair_clean.out)"
- xfs_repair -n $TEST_DEV &> $LOG/repair_clean.out || fail=1
- fi
-
- if [ $fail -eq 0 ]
- then
- _echo " *** FS checks ok"
- else
- if [ $expect -eq 0 ]
- then
- _echo " !!! FS check failed - inconsistent FS"
- _echo " !!! (see $LOG/*.out for details)"
- exit 1
- else
- _echo " *** inconsistent fs (as expected)"
- fi
- fi
-}
-
-_check_core()
-{
- if [ -e core ]
- then
- _echo " !!! core file found!"
- exit 1
- fi
-}
-
-_repair()
-{
- rm -f core
- _echo " *** repair"
- _echo " *** repair pass 1 (RO)"
- xfs_repair -n $TEST_DEV &> $LOG/repair_1.out \
- && _echo " !!! no errors found (eh?)" \
- || _echo " *** errors found (expected)"
-
- _check_core
-
- _echo " *** repair pass 2 (RW)"
-
- if xfs_repair $TEST_DEV &> $LOG/repair_2.out
- then
- _echo " *** FS checks ok (now)"
- else
- _echo " !!! xfs_repair returned error code"
- _echo " !!! (see $LOG/repair_*.out for details)"
- exit 1
- fi
-
- _check_core
-
- _echo " *** repair pass 3 (RO)"
- if xfs_repair -n $TEST_DEV &> $LOG/repair_3.out
- then
- _echo " *** FS checks ok"
- else
- _echo " !!! errors found after repair (unexpected)"
- _echo " !!! (see $LOG/repair_*.out for details)"
- exit 1
- fi
-
- _check_core
-}
-
-_cleanup()
-{
- rm -f $XFSCRASH/counter $XFSCRASH/start $XFSCRASH/stop $XFSCRASH/active
-
- if [ $reboot != -1 ]
- then
- kill $reboot
- fi
-
-}
-
-_random()
-{
- od -tu -N 4 /dev/random | gawk -v v=$1 'NR==1 { print $2 % v }'
-}
-
-_backup()
-{
- if [ $count -ne 1 -a "$BACKUP_DEV" != "" ]
- then
- _echo " *** Backing up $TEST_DEV to $BACKUP_DEV"
- if ! dd if=$TEST_DEV of=$BACKUP_DEV bs=$BACKUP_BS &> $LOG/dd.out
- then
- _echo " !!! unable to backup fs"
- _echo " !!! (see $LOG/dd.out)"
- exit 1
- fi
- else
- _echo " *** skipping back up step"
- fi
-}
-
-_logprint()
-{
- _echo " *** dumping log to $LOG/logprint.out"
- rm -f core
- xfs_logprint $TEST_DEV &> $LOG/logprint.out
- if [ -e core ]
- then
- _echo " !!! xfs_logprint dumped core"
- echo "" >> $LOG/logprint.out
- echo "*** CORE DUMPED ***" >> $LOG/logprint.out
- echo "" >> $LOG/logprint.out
- fi
-
- _echo " *** dumping log (-t -i) to $LOG/logprint_inode.out"
-
- rm -f core
- xfs_logprint -t -i $TEST_DEV &> $LOG/logprint_inode.out
- if [ -e core ]
- then
- _echo " !!! xfs_logprint dumped core"
- echo "" >> $LOG/logprint_inode.out
- echo "*** CORE DUMPED ***" >> $LOG/logprint_inode.out
- echo "" >> $LOG/logprint_inode.out
- fi
-
- _echo " *** dumping log (-t -b) to $LOG/logprint_buf.out"
-
- rm -f core
- xfs_logprint -t -b $TEST_DEV &> $LOG/logprint_buf.out
- if [ -e core ]
- then
- _echo " !!! xfs_logprint dumped core"
- echo "" >> $LOG/logprint_buf.out
- echo "*** CORE DUMPED ***" >> $LOG/logprint_buf.out
- echo "" >> $LOG/logprint_buf.out
- fi
-}
-#
-# _df_device : get an IRIX style df line for a given device
-#
-# - returns "" if not mounted
-# - returns fs type in field two (ala IRIX)
-# - joins line together if split by fancy df formatting
-# - strips header etc
-#
-
-_df_device()
-{
- if [ $# -ne 1 ]
- then
- echo "Usage: _df_device device" >&2
- exit 1
- fi
-
- df -T 2> /dev/null | $AWK_PROG -v what=$1 '
- match($1,what) && NF==1 {
- v=$1
- getline
- print v, $0
- exit
- }
- match($1,what) {
- print
- exit
- }
- '
-}
-
-#
-# _df_dir : get an IRIX style df line for device where a directory resides
-#
-# - returns fs type in field two (ala IRIX)
-# - joins line together if split by fancy df formatting
-# - strips header etc
-#
-
-_df_dir()
-{
- if [ $# -ne 1 ]
- then
- echo "Usage: _df_dir device" >&2
- exit 1
- fi
-
- df -T $1 2> /dev/null | $AWK_PROG -v what=$1 '
- NR == 2 && NF==1 {
- v=$1
- getline
- print v, $0;
- exit 0
- }
- NR == 2 {
- print;
- exit 0
- }
- {}
- '
- # otherwise, nada
-}
-
-# return percentage used disk space for mounted device
-
-_used()
-{
- if [ $# -ne 1 ]
- then
- echo "Usage: _used device" >&2
- exit 1
- fi
-
- _df_device $1 | $AWK_PROG '{ sub("%", "") ; print $6 }'
-}
-
-_check_free()
-{
- used=`_used $TEST_DEV`
-
- if [ $used -ge $FULL_LIMIT ]
- then
- _echo " *** $used % used on $TEST_DEV - deleting files"
- rm -rf $TEST_MNT/stress
- fi
-}
-
-# loop, stressing, unounting and checking
-# no (expected) rebooting...
-_corrupt()
-{
- count=0
-
- # don't want to restart if we reboot...
- _cleanup
-
- while true
- do
-
- if [ -e $XFSCRASH/stop ]
- then
- _echo "### XFS Crash stopped "
- exit 0
- fi
-
- _echo "*** run $count"
- let "count = count + 1"
-
- _check 0
- _mount
-
- _check_free
-
- $CORRUPT_STRESS | _log
-
- _unmount
- done
-}
-
-###########################################################################
-
-_echo ""
-_echo ""
-echo "XFSCRASH [output to $OUTPUT]"
-_echo ""
-
-if [ "$1" = "start" ]
-then
- touch $XFSCRASH/start
-fi
-
-if [ "$1" = "stop" ]
-then
- touch $XFSCRASH/stop
-fi
-
-
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-
-if [ -e $XFSCRASH/stop ]
-then
- _echo "### XFS Crash stopped "
- exit 0
-fi
-
-if [ -e $XFSCRASH/start ]
-then
- _echo "### XFS Crash started "
- _cleanup
- rm -f $LOG/*.out $LOG/*.log core
-
- touch $XFSCRASH/active
-
- _echo " *** Building fresh XFS FS"
- umount $TEST_DEV &> /dev/null
- if ! mkfs -t xfs -f $TEST_DEV &> $LOG/mkfs.out
- then
- _echo " !!! unable to mkfs"
- _echo " !!! (see $LOG/mkfs.out)"
- exit 1
- fi
-fi
-
-if [ ! -e $XFSCRASH/active ]
-then
- _echo "### XFS Crash inactive "
- exit 0
-fi
-
-
-if [ -r $XFSCRASH/counter ]
-then
- count=`cat $XFSCRASH/counter`
-else
- count=0
-fi
-_echo "### Crash test run $count (mode=$MODE, log=$LOG/{*.out,*.log})"
-
-let "count = count +1"
-echo $count > $XFSCRASH/counter
-
-# real test starts here
-
-_echo " *** Checking for R/O root"
-if ! mount | grep "on / type" | grep -q "(ro)"
-then
- _echo " !!! root not mounted readonly"
- exit 1
-fi
-
-_echo " *** Loading XFS modules"
-if ! modprobe xfs
-then
- _echo " !!! unable to modprobe xfs"
- exit 1
-fi
-
-_echo " *** Unmounting $TEST_DEV"
-umount $TEST_DEV &> /dev/null
-
-_logprint
-if [ $MODE != "corrupt" ]
-then
- _backup
-fi
-
-case $MODE
-in
- remount)
- _check 1 # expect errors
- _mount
- _unmount
- ;;
- repair)
- _repair
- ;;
- corrupt)
- _corrupt
- exit 0
- ;;
- *)
- _echo "xfscrash: MODE must be remount or repair"
- exit 1
- ;;
-esac
-
-_check 0 # don't expect errors
-_mount
-
-_echo " *** Cleaning XFS FS"
-if ! rm -rf $TEST_MNT/stress $TEST_MNT/lost+found &> $LOG/clean.out
-then
- _echo " !!! unable to clean XFS FS"
- _echo " !!! (see $LOG/clean.out)"
- exit 1
-fi
-
-_echo " *** Making stress directory"
-if ! mkdir $TEST_MNT/stress
-then
- _echo " !!! unable to mkdir stress"
- exit 1
-fi
-
-let "bang = STRESS_TIME + `_random $STRESS_RANDOM`"
-
-_echo " *** Preparing random reboot (in $bang seconds)"
-(
- sleep $bang
- _echo " *** BANG ****"
- reboot -fn
-) &
-reboot=$!
-
-_echo " *** Causing stress & waiting for the inevitable"
-$STRESS | _log
-
-exit 0
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] fstests: remove tools/auto-qa
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
` (2 preceding siblings ...)
2025-03-06 21:34 ` [PATCH 3/5] fstests: remove crash script Dave Chinner
@ 2025-03-06 21:34 ` Dave Chinner
2025-03-06 21:34 ` [PATCH 5/5] fstests: remove old tools from tools directory Dave Chinner
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
From: Dave Chinner <dchinner@redhat.com>
This is a 2000s era SGI test script that no-one uses anymore. It
likely doesn't even work because it is dependent on CVS and/or
the SGI proprietary ptools revision control system for source
control. Hence it clearly hasn't been used for years, so remove it.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tools/auto-qa | 568 --------------------------------------------------
1 file changed, 568 deletions(-)
delete mode 100755 tools/auto-qa
diff --git a/tools/auto-qa b/tools/auto-qa
deleted file mode 100755
index 1beb28359..000000000
--- a/tools/auto-qa
+++ /dev/null
@@ -1,568 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
-#
-# automatic qa system. 31/08/00 dxm@sgi.com
-#
-# Usage: auto_qa start-state [stop-state]
-# Do auto_qa from start-state up to stop-state inclusive
-# or if no stop-state given then do it until reach "done" state.
-#
-
-_log()
-{
- echo "$*" >&2
- echo "$*" >> $LOG
- sync
-}
-
-_fail()
-{
- if [ "$started" = "1" ]
- then
- echo "auto-qa stopped" | wall
- started=0
- fi
-
- _log "$*"
-
- # send special email if a cron'd qa run fails
- case $state
- in
- cron*)
- mail -s "XFS QA status report" $EMAIL < $LOG 2>&1
- ;;
- esac
-
- status=1
- exit 1
-}
-
-_get_kernel_version()
-{
- [ -x "$KWORKAREA" ] || return
- [ -r "$KWORKAREA/Makefile" ] \
- || _fail "can't read kernel makefile $KWORKAREA/Makefile"
-
- eval `awk '
- BEGIN { FS = "[ \t=]+" }
- /^VERSION =/ { a=$2 }
- /^PATCHLEVEL =/ { b=$2 }
- /^SUBLEVEL =/ { c=$2 }
- /^EXTRAVERSION =/ { d=$2 }
- END {
- print "VERSION=" a "." b "." c d " ; SVERSION=" a "." b "." c
- }
- ' < $KWORKAREA/Makefile`
-}
-
-# this should be constant
-
-ROOT="$HOME/qa"
-HOST=`hostname -s`
-if [ ! -z "$CVSROOT" ]; then
- export WORKAREA="$ROOT/xfs-cmds"
-else
- [ -z "$WORKAREA" ] && export WORKAREA="$ROOT/xfs-cmds"
-fi
-
-
-export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin/ptools:/usr/local/bin"
-STATE=$ROOT/qa.state
-QADIR="$WORKAREA/xfstests"
-SUDO="su -c"
-CONFIG="$ROOT/$HOST.config"
-COMMON_CONFIG="$QADIR/common/config"
-SH="/bin/sh"
-LOG="$ROOT/qa.log"
-
-# do some cleanup on exit
-
-_cleanup()
-{
- umount $SCRATCH_DEV &> /dev/null
- umount $TEST_DEV &> /dev/null
- if [ "$started" = 1 ]
- then
- echo "auto-qa stopped" | wall
- started=0
- fi
-}
-status=1
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# clean exit
-
-_success()
-{
- status=0
- exit 0
-}
-
-_get_state()
-{
- state=`cat $STATE`
-}
-
-_set_state()
-{
- echo $1 > $STATE
- _get_state
-}
-
-_change_state()
-{
- new=$1
-
- # if have state XXXX-state then preserve XXXX-newstate
-
- case $state
- in
- *-*)
- case $new
- in
- *-*)
- _set_state $new
- ;;
- *)
- _set_state `echo $state | sed "s/-.*$/-$new/"`
- ;;
- esac
- ;;
- *)
- _set_state $new
- ;;
- esac
-}
-
-_sudo()
-{
- $ROOT/su -c "$*" < /dev/null ;# HACK - we need a hacked su at the mo
-}
-
-_restart()
-{
- exec $ROOT/su -c "(shutdown -r now \"auto-qa rebooting\" )&" < /dev/null
-}
-
-_update_workarea()
-{
- if [ -z "$CVSROOT" ]; then
- _log " *** p_tupdate"
- cd "$1"
- WORKAREA="$1" p_tupdate 2>&1 \
- || _fail " !!! p_tupdate failed"
-
- _log " *** non-trunk files"
- cd "$1"
- WORKAREA="$1" p_list -c 2>&1 \
- || _fail " !!! p_list failed"
- else
- _log " *** cvs update"
- cd "$1"
- cvs -z3 update -d
- fi
-}
-
-_test_mkfs_xfs()
-{
- TEST_OPTIONS=""
- [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
- TEST_OPTIONS="$TEST_OPTIONS -rrtdev=$TEST_RTDEV"
- [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
- TEST_OPTIONS="$TEST_OPTIONS -llogdev=$TEST_LOGDEV"
- _sudo /sbin/mkfs.xfs -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV
- mkfs_status=$?
- if [ "$USE_BIG_LOOPFS" = yes ]; then
- [ -z "$RETAIN_AG_BYTES" ] && RETAIN_AG_BYTES=0
- _sudo $QADIR/tools/ag-wipe -q -r $RETAIN_AG_BYTES $TEST_DEV
- fi
- return $mkfs_status
-}
-
-_test_mount()
-{
- TEST_OPTIONS=""
- [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
- TEST_OPTIONS="$TEST_OPTIONS -ortdev=$TEST_RTDEV"
- [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
- TEST_OPTIONS="$TEST_OPTIONS -ologdev=$TEST_LOGDEV"
- _sudo mount -t xfs $TEST_OPTIONS $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
-}
-
-_i386_install()
-{
- _sudo cp -f "$KWORKAREA/arch/i386/boot/bzImage" "$IMAGE" 2>&1 \
- || _fail " !!! install kernel failed"
- _sudo cp -f "$KWORKAREA/System.map" "$SYSTEMMAP" 2>&1 \
- || _fail " !!! install kernel failed"
- if [ -z "$KMODULES" -o "$KMODULES" = yes ]; then
- _sudo make EXTRAVERSION=-$EXTRA modules_install 2>&1 \
- || _fail " !!! install modules failed"
- fi
-
-
- if [ -z "$KINSTALL" -o "$KINSTALL" = lilo ]; then
- _log " *** reinit lilo"
- _sudo /sbin/lilo 2>&1 \
- || _fail " !!! reinit lilo failed"
- fi
-}
-
-_i386_restart()
-{
- if [ -z "$KINSTALL" -o "$KINSTALL" = lilo ]; then
- _sudo /sbin/lilo -R $EXTRA $KERNEL_OPTIONS 2>&1 \
- || _fail " !!! lilo failed"
- fi
-}
-
-_ia64_install()
-{
- echo not yet implemented
-}
-
-_ia64_restart()
-{
- echo not yet implemented
-}
-
-_check_kernel()
-{
- [ -d "$KWORKAREA" ] || _fail " !!! QA kernel workarea \"$KWORKAREA\" not found"
- [ -r "$CONFIG" ] || _fail " !!! Can't read config file $CONFIG"
-}
-
-
-_log "*** XFS QA (`date`)"
-
-_get_state
-
-# check preconditions for starting state
-case $1
-in
- cron-init)
- case $state
- in
- *done)
- ;;
- *)
- _fail " !!! cron-init while not in \"*done\" state"
- ;;
- esac
- ;;
- cron-restarted)
- # we don't auto restart after reboot, but cron the restart
- # to happen a bit later - it's much easier and safer that way
- if [ "$state" != "cron-restarted" ]
- then
- _fail " !!! cron-restarted while not in \"cron-restarted\" state"
- fi
- ;;
-esac
-
-[ -n "$1" ] && _set_state $1
-[ -n "$2" ] && stop_state=$2
-
-[ "$UID" -eq 0 ] && _fail " !!! QA most be run as a normal user"
-[ -d "$ROOT" ] || _fail " !!! QA root \"$ROOT\" not found"
-[ -d "$WORKAREA" ] || _fail " !!! QA workarea \"$WORKAREA\" not found"
-cd $QADIR
-. "$COMMON_CONFIG" || _fail " !!! Couldn't source $COMMON_CONFIG"
-
-_get_kernel_version
-IMAGE="$BOOT/vmlinuz-$EXTRA"
-SYSTEMMAP="$BOOT/System.map-$VERSION-$EXTRA"
-MODULES="/lib/modules/$SVERSION"
-
-cd $ROOT
-
-started=1
-echo "auto-qa started" | wall
-
-while true
-do
- _get_state
-
- _log " *** state $state start (`date`)"
- _log " (user=$USER, host=$HOST)"
- new_state=""
-
- start_state=$state
-
- case $state
- in
- *init)
- echo "" > $ROOT/qa.log
- echo "" > $ROOT/qa.full
- _log "******************************************************"
- _log "QA init $VERSION (`date`)"
- _log "******************************************************"
- new_state="updatetools"
- ;;
-
- *updatetools)
- _update_workarea "$WORKAREA"
- new_state="cleantools"
- ;;
-
- *cleantools)
- # we need to configure or else we might fail to clean
- for pkg in attr acl xfsprogs xfsdump xfstests
- do
- [ -d $WORKAREA/$pkg ] || continue
- cd $WORKAREA/$pkg
- _log " *** clean $pkg tools"
- make realclean 2>&1 \
- || _fail " !!! clean $pkg failed"
- done
- new_state="buildtools"
- ;;
-
- *buildtools)
- _log " *** build and install tools"
- for pkg in attr acl xfsprogs xfsdump xfstests
- do
- [ -d $WORKAREA/$pkg ] || continue
- cd $WORKAREA/$pkg
-
- make configure 2>&1 \
- || _fail " !!! configure $pkg failed"
- make default 2>&1 \
- || _fail " !!! build $pkg failed"
-
- _sudo make install install-dev 2>&1 \
- || _fail " !!! install $pkg failed"
-
- # attr and acl now have install-lib targets as well
- [ "$pkg" = "attr" -o "$pkg" = "acl" ] || continue
- _sudo make install-lib 2>&1 \
- || _fail " !!! install $pkg failed"
- done
-
- new_state="updatekernel"
- ;;
-
- *updatekernel)
- _check_kernel
- _update_workarea "$KWORKAREA"
- new_state="cleankernel"
- ;;
-
- *cleankernel)
- _check_kernel
- _log " *** clean kernel"
- cd "$KWORKAREA"
- make mrproper 2>&1 \
- || _fail " !!! clean kernel failed"
-
- _log " *** install configuration file"
- cp -f $CONFIG "$KWORKAREA/.config" 2>&1 \
- || _fail " !!! failed to install config"
-
- _log " *** remove version file"
- rm -f include/linux/version.h 2>&1 \
- || _fail " !!! failed to clean version"
-
- new_state="reconfig"
- ;;
-
- *reconfig)
- _check_kernel
- _log " *** reconfig kernel"
-
- # we better start from scratch if this fails
- _change_state "cleankernel"
-
- cd "$KWORKAREA"
- # we want to use default options for any new config options.
- echo -e "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" | \
- make EXTRAVERSION=-$EXTRA oldconfig 2>&1 \
- || _fail " !!! reconfig oldconfig failed"
- make EXTRAVERSION=-$EXTRA dep 2>&1 \
- || _fail " !!! reconfig dep failed"
-
- new_state="buildkernel"
- ;;
-
- *buildkernel)
- _check_kernel
- _log " *** build kernel"
- _log " --- kernel ($IMAGE)"
- [ -z "$KMODULES" -o "$KMODULES" = yes ] && \
- _log " --- modules ($MODULES)"
-
- _change_state "cleankernel" ; # we better start from scratch if this fails
-
- cd "$KWORKAREA"
- [ -z "$KTARGET" ] && KTARGET=bzImage
- [ -z "$KMODULES" -o "$KMODULES" = yes ] && \
- KTARGET="$KTARGET modules"
- make -j4 EXTRAVERSION=-$EXTRA $KTARGET 2>&1 \
- || _fail " !!! build $KTARGET failed"
- new_state="install"
- ;;
-
- *install)
- _check_kernel
- _log " *** blat old modules"
- _sudo rm -rf $MODULES
-
- _log " *** install kernel"
- cd "$KWORKAREA"
- case `uname -m`
- in
- i386|i686) _i386_install ;;
- ia64) _ia64_install ;;
- esac
-
- new_state="restart"
- ;;
-
- *restart)
- _log " *** select qa kernel"
- case `uname -m`
- in
- i386|i686) _i386_restart ;;
- ia64) _ia64_restart ;;
- esac
-
- _log " *** prepare to restart"
- _change_state "restarted"
-
- _log " *** restarting"
-
- _restart # doesn't return
- ;;
-
- *restarted)
- _log " *** QA reentered after restart"
-
- new_state="check"
- ;;
-
- *check)
- uname=`uname -a`
- _log " *** uname $uname"
-
- if [ "$MODULAR" -eq 0 ]; then
- new_state="reset"
- else
- new_state="probe"
- fi
- ;;
-
- *probe)
- _log " *** modules dependencies"
- _sudo depmod -a 2>&1 \
- || _fail " !!! failed to depmod -a"
-
- _log " *** unmounting XFS mounts"
- _sudo umount -a -t xfs 2>&1
-
- _log " *** removing modules"
- for m in xfsidbg xfs kdbm_pg kdbm_vm
- do
- _sudo rmmod $m 2> /dev/null
- done
-
- _log " *** installing modules"
- _sudo modprobe xfs 2>&1 \
- || _fail " !!! failed to modprobe xfs"
-
- new_state="reset"
- ;;
-
- *reset)
-
- _log " *** unmounting TEST_DEV"
- _sudo umount $TEST_DEV 2>&1
-
- _log " *** unmounting SCRATCH_DEV"
- _sudo umount $SCRATCH_DEV 2>&1
-
- _log " *** clean TEST_DEV"
- _test_mkfs_xfs 2>&1 \
- || _fail " !!! failed to mkfs TEST_DEV"
-
- _log " *** mounting TEST_DEV"
- _test_mount 2>&1 \
- || _fail " !!! failed to mount"
-
- new_state="run"
- ;;
-
- soak-run)
- cd $QADIR
-
- _log " *** run soak test"
- _sudo ./soak $SOAK_PASSES $SOAK_STRESS $SOAK_PROC \
- || _fail " !!! failed to run soak test"
-
- new_state="done"
- ;;
-
- bench-run)
- cd $QADIR
-
- # $BENCHMARK is typically unset, which equates to "all"
- #
- _log " *** run benchmarks"
- _sudo ./bench $BENCH_PASSES `id -nu && id -ng` $BENCHMARK \
- || _fail " !!! failed to run benchmarks"
-
- _log ""
- _log " *** send results mail"
- mail -s "XFS QA benchmark results" $EMAIL < $QADIR/bench.out 2>&1
-
- new_state="done"
- ;;
-
- *run)
- cd $QADIR
-
- _log " *** run tests ($CHECK_OPTIONS)"
- _sudo ./check -l $CHECK_OPTIONS 2>&1 | tee $ROOT/qa.out
-
- _log ""
- _log " *** send status mail"
- mail -s "XFS QA status report" $EMAIL < $ROOT/qa.out 2>&1
-
- new_state="done"
- ;;
-
- *done)
- _log "*** requested QA state transitions complete"
-
- _success
- ;;
-
- *nothing)
- new_state="done"
- _log " *** do nothing"
- ;;
-
- *)
- _fail " !!! unknown state $state"
- ;;
- esac
-
- _log " *** state $state done (`date`)"
- [ "$new_state" = "" ] && _fail " !!! no new state set"
-
- if [ -n "$stop_state" ]
- then
- # remove hyphen prefixes
- s1=`echo $start_state | sed 's/.*-//'`
- s2=`echo $stop_state | sed 's/.*-//'`
-
- if [ $s1 = $s2 ]
- then
- # we have been requested to stop here and not go on
- new_state="done"
- fi
- fi
-
- _change_state $new_state
-
-done
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] fstests: remove old tools from tools directory
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
` (3 preceding siblings ...)
2025-03-06 21:34 ` [PATCH 4/5] fstests: remove tools/auto-qa Dave Chinner
@ 2025-03-06 21:34 ` Dave Chinner
2025-03-06 22:59 ` [PATCH 0/5] fstests: remove old SGI QE scripts Darrick J. Wong
2025-03-07 4:04 ` David Disseldorp
6 siblings, 0 replies; 8+ messages in thread
From: Dave Chinner @ 2025-03-06 21:34 UTC (permalink / raw)
To: fstests
From: Dave Chinner <dchinner@redhat.com>
ag-wipe, db-walk, fs-walk and interop are all old 2000s era SGI QA
scripts that are either not usable anymore of have been superceded
by much more recent functionality.
interop only runs on machines with the host named "bruce" or
"whack", requires NFS mounts from a machine named "snort" and access
to a specific user's home dir. I know what all these were; they were
test and build machines in SGI's engineering office in Melbourne,
Australia. That went away in ~2009....
ag-wipe is unused and has been superceded by multiple different sets of
functionality (e.g. ./check --large-fs).
db-walk is unused by fstests and now is native xfs_db functionality.
fs-walk is dumping the md5sum and stat info of every file in a
directory heirachy and only used by the interop script....
Remove them all.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tools/ag-wipe | 171 ------------------------------------------------
tools/db-walk | 178 --------------------------------------------------
tools/fs-walk | 85 ------------------------
tools/interop | 101 ----------------------------
4 files changed, 535 deletions(-)
delete mode 100755 tools/ag-wipe
delete mode 100755 tools/db-walk
delete mode 100755 tools/fs-walk
delete mode 100755 tools/interop
diff --git a/tools/ag-wipe b/tools/ag-wipe
deleted file mode 100755
index 52acf0f80..000000000
--- a/tools/ag-wipe
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/usr/bin/perl -w
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2003-2004 Silicon Graphics, Inc. All Rights Reserved.
-#
-use strict;
-use IO::File;
-use Getopt::Std;
-#
-#
-# Modify a filesystem's superblock and AGF metadata structures
-# so that only a subset of the allocation groups will be used.
-# Intended use is in testing large virtual devices (eg. loop)
-# with extremely large filesystems, where we want to ensure
-# high allocation groups are used as much as possible (where
-# the block addresses are large).
-#
-
-my %opt;
-getopts('cf:l:qr:v', \%opt);
-
-die "Usage: $0 [-f AG] [-l AG] [-r bytes] [-cqv] device\n" unless (@ARGV == 1);
-my $device = shift @ARGV;
-die "$device: no such file\n" unless (-e $device);
-
-my $clearall = defined($opt{'c'}) ? 1 : 0;
-my $retain = defined($opt{'r'}) ? $opt{'r'} : -1;
-my $quiet = defined($opt{'q'}) ? 1 : 0;
-my $verbose = defined($opt{'v'}) ? 1 : 0;
-my $nagfirst = defined($opt{'f'}) ? $opt{'f'} : 0;
-my $naglast = defined($opt{'l'}) ? $opt{'l'} : 0;
-
-#
-# "clearall" means clear everything barring the final AG.
-# "retain" means clearall and retain a specified amount in the
-# second-from-last AG as well (value is the number of bytes).
-# [NB: retain with a value of zero is now the same as clearall].
-#
-if ($retain >= 0) {
- $clearall = 1;
-}
-
-sub xfs_db {
- my $xfsdb = 'xfs_db -x';
- my %hash;
-
- foreach (@_) {
- $xfsdb .= ' -c ' . $_;
- }
- print $xfsdb, ' ', $device, "\n" if ($verbose);
-
- die unless open(DB, "$xfsdb $device 2>/dev/null |");
- while (<DB>) {
- if (/^(\S+) = (.*)$/) {
- print if ($verbose);
- $hash{$1} = $2;
- }
- }
- return %hash;
-}
-
-
-#
-# Stage 1: Get control information from the superblock
-#
-
-my @sbprint = ( '"print fdblocks"', '"print agcount"', '"print blocksize"' );
-my @agffree = ( '"print freeblks"' );
-
-my %sb = xfs_db 'sb', @sbprint;
-print "=== Initially ", $sb{'fdblocks'}, " blocks free across ",
- $sb{'agcount'}, " AGs\n" unless $quiet;
-if ($clearall && ($nagfirst || $naglast)) {
- print STDERR " o Clearall/retain specified with first/last AG\n";
- exit(1);
-}
-if ($nagfirst >= $sb{'agcount'}) {
- print STDERR " o First AG number is too large\n";
- exit(1);
-}
-if ($naglast >= $sb{'agcount'}) {
- print STDERR " o Last AG number is too large\n";
- exit(1);
-}
-if ($naglast - $nagfirst < 0) {
- print STDERR " o No AGs to clear\n";
- exit(1);
-}
-if ($clearall) {
- $naglast = $sb{'agcount'} - 2;
- if ($retain > 0) {
- my %check;
-
- $naglast--;
- $retain /= $sb{'blocksize'}; # convert to fsblocks
- %check = xfs_db "'agf $naglast'", @agffree;
- if ($check{'freeblks'} < $retain) {
- print STDERR " o Insufficient space to retain\n";
- exit(1);
- }
- }
-}
-
-
-#
-# Stage 2: Wipe out all completely masked allocation groups.
-#
-
-my @agfprint = ( '"print freeblks"', '"print flcount"' );
-my @agfcommands = ( '"write freeblks 0"',
- '"write longest 0"', '"write flcount 0"',
- '"write bnolevel 1"', '"write cntlevel 1"',
- '"write flfirst 0"', '"write fllast 0"' );
-my @bnoprint = ( '"addr bnoroot"', '"print numrecs"' );
-my @bnocommands = ( '"addr bnoroot"', '"write numrecs 0"',
- '"write leftsib -1"', '"write rightsib -1"' );
-my @cntprint = ( '"addr cntroot"', '"print numrecs"' );
-my @cntcommands = ( '"addr cntroot"', '"write numrecs 0"',
- '"write leftsib -1"', '"write rightsib -1"' );
-
-print "=== Wiping ", $naglast - $nagfirst + 1,
- " AGs starting from AG #", $nagfirst, "\n" unless $quiet;
-
-my $ag = $nagfirst;
-while ($ag <= $naglast) {
- print " o AG#", $ag, " AGF fields\n" unless $quiet;
-
- my %agf = xfs_db "'agf $ag'", @agfprint;
- xfs_db "'agf $ag'", @agfcommands;
-
- my $blockcnt = $agf{'freeblks'} + $agf{'flcount'};
- $sb{'fdblocks'} -= $blockcnt;
- print " cleared ", $blockcnt, " blocks from AG#", $ag, "\n"
- unless $quiet;
-
- my %btree = xfs_db "'agf $ag'", @bnoprint;
- xfs_db "'agf $ag'", @bnocommands, "'agf $ag'", @cntcommands;
- print " cleared ", $btree{'numrecs'}, " BNO/CNT btree recs in AG#",
- $ag, "\n" unless $quiet;
-
- $ag++;
-}
-
-
-#
-# Stage 3: Wipe out any partially masked allocation group.
-#
-
-if ($retain > 0) {
- print " o AG#", $ag, " AGF fields (partial)\n" unless $quiet;
-
- my %ragf = xfs_db "'agf $ag'", '"print freeblks"',
- '"addr bnoroot"', '"print recs[1].startblock"';
- my $maskblks = $ragf{'freeblks'} - $retain;
- my $newstart = $ragf{'recs[1].startblock'} + $maskblks;
- xfs_db "'agf $ag'",
- "'write freeblks $retain'", "'write longest $retain'",
- "'agf $ag'", '"addr bnoroot"',
- "'write recs[1].startblock $newstart'",
- "'write recs[1].blockcount $retain'",
- "'agf $ag'", '"addr cntroot"',
- "'write recs[1].startblock $newstart'",
- "'write recs[1].blockcount $retain'";
-
- $sb{'fdblocks'} -= $maskblks;
- print " cleared ", $maskblks, " blocks from AG#", $ag, "\n"
- unless $quiet;
-}
-
-print "=== Updating final freespace count, ", $sb{'fdblocks'}, " blocks\n"
- unless $quiet;
-xfs_db "'sb 0'", "'write fdblocks $sb{'fdblocks'}'"
diff --git a/tools/db-walk b/tools/db-walk
deleted file mode 100755
index e09920559..000000000
--- a/tools/db-walk
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/perl -w
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
-#
-# use db to try to traverse the entire filesystem starting at the root
-#
-my $device;
-my $rootino;
-my $agcount;
-my $versionnum;
-my $dir_version;
-my @dir_inodes;
-my @bmap_blocks;
-my @block_inodes;
-my $mode;
-
-sub db($)
-{
- my ($args)=@_;
- my ($ret);
-
- $ret=`xfs_db -r $args $device 2> /dev/null`;
- die "ERROR executing xfs_db -r $args $device" if ($?);
-
- return $ret;
-}
-
-sub fmt($)
-{
- my ($text)=@_;
- my $c=0;
- print " ";
- foreach (split("\n",$text)) {
- s/^core\.//;
-
- if ($c+length($_) >= 70) {
- $c=0;
- print ",\n ";
- }
- if ($c) {
- print ", ";
- $c+=2;
- }
- print "$_";
- $c+=length($_)+2;
- }
- print "\n";
-}
-
-sub inode($)
-{
- my ($num)=@_;
- my ($t);
-
- @dir_inodes=();
-
- $t=db("-c \"inode $num\" -c \"print\"");
- print " *** Inode $num\n";
- fmt($t);
-
- ($mode)= $t=~ /^core.mode = (\d+)$/m;
-
- if ($t=~ /a\.bmx/m) {
- bmap("inode $num","attr");
- foreach (@bmap_blocks) {
- attr_block($_);
- }
- }
- if (eval "$mode & 040000") {
- if ( $t=~ /sfdir/m) {
- while ($t=~ /inumber(?:\.i[48])? = (\d+)$/mg) {
- push(@dir_inodes,$1);
- }
- }
- if ( $t=~ /u\.bmx/m) {
- bmap("inode $num","dir");
- foreach (@bmap_blocks) {
- dir_block($_);
- push(@dir_inodes,@block_inodes);
- }
- }
- } else {
- bmap("inode $num","file") if ( $t=~ /u\.bmx/m);
- }
-}
-
-sub bmap($$)
-{
- my ($cmd,$type)=@_;
- my ($t);
-
- @bmap_blocks=();
-
- $flag=($type eq "attr")?"-a":"";
-
- $t=db("-c \"$cmd\" -c \"bmap $flag\"");
- print " *** bmap $type $cmd\n";
- fmt($t);
-
- if ($type eq "dir" || $type eq "attr") {
- while ($t=~ /startblock (\d+) \(.+\) count (\d+)/mg) {
- for ($b=$1;$b<$1+$2;$b++) {
- push(@bmap_blocks,$b);
- }
- }
- }
-}
-
-sub dir_block($)
-{
- my ($num)=@_;
- my ($t);
-
- @block_inodes=();
-
- $type=($dir_version==2)?"dir2":"dir";
-
- $t=db("-c \"fsblock $num\" -c \"type $type\" -c \"print\"");
- print " *** $type block $num\n";
- # need to drop . and ..
- ($self)= $t=~ /\[(\d+)\].name = \"\.\"/m;
- ($parent)= $t=~ /\[(\d+)\].name = \"\.\.\"/m;
- fmt($t);
-
-
- while ($t=~ /\[(\d+)\].inumber = (\d+)/mg) {
- next if (defined $self && $1 == $self);
- next if (defined $parent && $1 == $parent);
- push(@block_inodes, $2);
- }
-}
-
-sub attr_block($)
-{
- my ($num)=@_;
- my ($t);
-
- $t=db("-c \"fsblock $num\" -c \"type attr\" -c \"print\"");
- print " *** attr block $num\n";
-
- fmt($t);
-}
-
-sub sb($)
-{
- my ($num)=@_;
- my ($t);
-
- $t=db("-c \"sb $num\" -c \"print\"");
- print " *** SB $num\n";
- fmt($t);
-
- ($rootino)= $t=~ /^rootino = (\d+)$/m;
- ($agcount)= $t=~ /^agcount = (\d+)$/m;
- ($versionnum)= $t=~ /^versionnum = (0x[\da-f]+)$/m;
- $dir_version = (eval "$versionnum & 0x2000")?2:1;
-}
-
-die "Usage: $0 <XFS device>\n" unless (@ARGV == 1);
-
-$device=shift @ARGV;
-die "can't read $device\n" unless (-r $device);
-die "$device is not a block device\n" unless (-b _);
-
-chomp($HOST = `hostname -s`);
-
-print "*** db-walk host $HOST device $device\n";
-
-sb(0);
-for ($ag=1;$ag<$agcount;$ag++) {
- sb($ag);
-}
-
-@inodes=($rootino);
-while ($_ = shift @inodes) {
- inode($_);
- push(@inodes,@dir_inodes);
-}
diff --git a/tools/fs-walk b/tools/fs-walk
deleted file mode 100755
index 918e1ad67..000000000
--- a/tools/fs-walk
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl -w
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
-#
-# traverse the entire filesystem dumping info.
-#
-use MD5;
-use Getopt::Std;
-
-my %opt;
-
-sub scan($)
-{
- my ($file)=@_;
- my ($md5)=new MD5;
- my (@stat);
-
- unless (@stat=lstat("$file")) {
- printf("%-" . ($opt{v}?65:32) . "s $file\n", "!!! could not lstat");
- return;
- }
-
- $stat[0]=$stat[8]=""; # wipe the device and access time
- $md5->reset;
- $md5->add(join(" ",@stat));
-
- print join(" ",@stat), "\n";
-
- if ($opt{v}) {
- print $md5->hexdigest . " ";
- $md5->reset;
- }
-
- if (-l "$file") {
- if (!defined($link = readlink $file)) {
- printf("%-32s $file\n", "!!! could not readlink");
- return;
- }
- $md5->add($link);
- } elsif (-f "$file") {
- if (!open(FILE, "$file")) {
- printf("%-32s $file\n", "!!! could not read");
- return;
- }
- $md5->addfile(FILE);
- close (FILE);
- }
- print $md5->hexdigest . " $file\n";
-}
-
-getopts('vs', \%opt);
-
-die "Usage: $0 <dir>\n" unless (@ARGV == 1);
-
-$dir=shift @ARGV;
-die "can't read $dir\n" unless (-r $dir);
-die "$dir is not a directory\n" unless (-d _);
-
-chomp($HOST = `hostname -s`);
-
-print "*** fs-walk host $HOST dir $dir\n";
-
-@todo=$dir;
-while ($dir = shift @todo) {
- scan($dir);
- unless (opendir(DIR,$dir)) {
- printf("%-" . ($opt{v}?65:32) . "s $dir\n", "!!! could not opendir");
- next;
- }
- unless (@all=readdir(DIR)) {
- printf("%-" . ($opt{v}?65:32) . "s $dir\n", "!!! could not readdir");
- next;
- }
- closedir(DIR);
- @dirs=grep(-d "$dir/$_" && !-l "$dir/$_", @all);
- foreach (@all) {
- next if /^\.\.?$/;
- scan("$dir/$_");
- }
-
- foreach (grep(!/^\.\.?$/, @dirs)) {
- push (@todo,"$dir/$_");
- }
-}
-
diff --git a/tools/interop b/tools/interop
deleted file mode 100755
index dc1652c2b..000000000
--- a/tools/interop
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/sbin/perl
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2001 Silicon Graphics, Inc. All Rights Reserved.
-#
-sub setup()
-{
- $PATH="$PATH:/usr/local/bin/ptools:/sbin:/usr/sbin";
- $DISPLAY="clouds:0";
-
- if ("$HOST" eq "bruce") {
- $TOOLS="/home/dxm/isms/slinx-xfs/cmd/xfs/tools";
- $SCRATCH_DEV="/dev/sdf1";
- $SCRATCH_MNT="/mnt/xfs3";
- $MKFS="/sbin/mkfs -t xfs -f";
- $SUDO="/home/dxm/su -c";
- $MOUNT="/bin/mount -t xfs";
- $UMOUNT="/bin/umount";
- $MKFS_EXTRA="-f";
- } elsif ("$HOST" eq "whack") {
- $TOOLS="/hosts/snort/build1/people/dxm/isms/slinx-xfs/cmd/xfs/tools";
- $SCRATCH_DEV="/dev/dsk/20000080e5114459/lun2s0/c2p1";
- $SCRATCH_MNT="/lun2";
- $MKFS="/sbin/mkfs";
- $SUDO="su root -c";
- $MOUNT="/sbin/mount -t xfs";
- $UMOUNT="/sbin/umount";
- $MKFS_EXTRA="";
- } else {
- die "unconfigured host \"$HOST\"\n"
- }
-}
-
-sub run_no_check(@)
-{
- system(@_);
-}
-
-sub run(@)
-{
- system(@_) == 0
- || die "ERROR \"" . join(" ",@_) . "\" returned error\n";
-}
-
-sub run_expect_fail(@)
-{
- system(@_) == 0
- && die "ERROR \"" . join(" ",@_) . "\" returned non-error\n";
-}
-
-sub umount_no_check()
-{
- run_no_check("umount $SCRATCH_DEV");
-}
-
-sub umount()
-{
- run("umount $SCRATCH_DEV");
-}
-
-sub mount($)
-{
- my ($ops)=@_;
- run("mount -t xfs $ops $SCRATCH_DEV $SCRATCH_MNT");
-}
-
-chomp($HOST=`hostname -s`);
-
-die "usage: $ARGV0 <operation> [parameters]\n" unless (scalar(@ARGV));
-print "*** $HOST: Interop started\n";
-print " *** ", join(" ", @ARGV), "\n";
-
-setup();
-
-$op=shift(@ARGV);
-
-umount_no_check();
-
-if ($op eq "init") {
-
- run("mkfs -t xfs $MKFS_EXTRA $SCRATCH_DEV");
-
-} elsif ($op eq "test") {
-
- run("xfs_repair -n $SCRATCH_DEV");
-
-} elsif ($op eq "easy") {
-
- mount("");
- system("mount");
- mkdir("$SCRATCH_MNT/fish",0777);
-
-} elsif ($op eq "check") {
-
- mount("-o ro");
- system("cd $SCRATCH_MNT ; $TOOLS/fs-walk .");
-
-} else {
- die "unknown operation \"$op\"\n";
-}
-
-umount_no_check();
--
2.45.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] fstests: remove old SGI QE scripts
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
` (4 preceding siblings ...)
2025-03-06 21:34 ` [PATCH 5/5] fstests: remove old tools from tools directory Dave Chinner
@ 2025-03-06 22:59 ` Darrick J. Wong
2025-03-07 4:04 ` David Disseldorp
6 siblings, 0 replies; 8+ messages in thread
From: Darrick J. Wong @ 2025-03-06 22:59 UTC (permalink / raw)
To: Dave Chinner; +Cc: fstests
On Fri, Mar 07, 2025 at 08:34:45AM +1100, Dave Chinner wrote:
> Hi folks,
>
> The scripts this patchset removes are historical relics. They
> haven't been maintained, in many cases they don't work, and in a
> couple fo cases they are reliant on test machines that SGI
> decomissioned almost two decades ago.
>
> There is no point in trying to maintain these scripts, but they
> still create dependencies on common fstests code that is now getting
> in the way of making changes to fstests infrastructure.
>
> Hence we should simply remove them and get rid of all the technical
> debt they contain with them.
The whole set looks good to me -- I've definitely never needed, used, or
noticed the old SGI scripts.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> -Dave.
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] fstests: remove old SGI QE scripts
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
` (5 preceding siblings ...)
2025-03-06 22:59 ` [PATCH 0/5] fstests: remove old SGI QE scripts Darrick J. Wong
@ 2025-03-07 4:04 ` David Disseldorp
6 siblings, 0 replies; 8+ messages in thread
From: David Disseldorp @ 2025-03-07 4:04 UTC (permalink / raw)
To: Dave Chinner; +Cc: fstests
On Fri, 7 Mar 2025 08:34:45 +1100, Dave Chinner wrote:
> Hi folks,
>
> The scripts this patchset removes are historical relics. They
> haven't been maintained, in many cases they don't work, and in a
> couple fo cases they are reliant on test machines that SGI
> decomissioned almost two decades ago.
>
> There is no point in trying to maintain these scripts, but they
> still create dependencies on common fstests code that is now getting
> in the way of making changes to fstests infrastructure.
>
> Hence we should simply remove them and get rid of all the technical
> debt they contain with them.
For the series:
Reviewed-by: David Disseldorp <ddiss@suse.de>
Thanks
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-03-07 4:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06 21:34 [PATCH 0/5] fstests: remove old SGI QE scripts Dave Chinner
2025-03-06 21:34 ` [PATCH 1/5] fstests: remove setup script Dave Chinner
2025-03-06 21:34 ` [PATCH 2/5] fstests: remove old soak script Dave Chinner
2025-03-06 21:34 ` [PATCH 3/5] fstests: remove crash script Dave Chinner
2025-03-06 21:34 ` [PATCH 4/5] fstests: remove tools/auto-qa Dave Chinner
2025-03-06 21:34 ` [PATCH 5/5] fstests: remove old tools from tools directory Dave Chinner
2025-03-06 22:59 ` [PATCH 0/5] fstests: remove old SGI QE scripts Darrick J. Wong
2025-03-07 4:04 ` David Disseldorp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox