Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# A simple script to load/unload the ZFS module stack.
|
2010-08-26 18:22:58 +00:00
|
|
|
#
|
|
|
|
|
2022-04-04 10:55:41 +00:00
|
|
|
BASE_DIR=${0%/*}
|
2010-08-26 18:22:58 +00:00
|
|
|
SCRIPT_COMMON=common.sh
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
if [ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]; then
|
|
|
|
. "${BASE_DIR}/${SCRIPT_COMMON}"
|
2010-08-26 18:22:58 +00:00
|
|
|
else
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
|
2010-08-26 18:22:58 +00:00
|
|
|
fi
|
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
VERBOSE="no"
|
|
|
|
UNLOAD="no"
|
2021-08-13 20:37:46 +00:00
|
|
|
LOAD="yes"
|
2018-12-07 18:51:42 +00:00
|
|
|
STACK_TRACER="no"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
|
|
|
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
|
|
|
|
LDMOD=${LDMOD:-/sbin/modprobe}
|
2022-04-21 11:32:06 +00:00
|
|
|
DELMOD=${DELMOD:-/sbin/rmmod}
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
|
|
|
KMOD_ZLIB_DEFLATE=${KMOD_ZLIB_DEFLATE:-zlib_deflate}
|
|
|
|
KMOD_ZLIB_INFLATE=${KMOD_ZLIB_INFLATE:-zlib_inflate}
|
|
|
|
KMOD_SPL=${KMOD_SPL:-spl}
|
|
|
|
KMOD_ZFS=${KMOD_ZFS:-zfs}
|
2019-12-19 17:31:16 +00:00
|
|
|
KMOD_FREEBSD=${KMOD_FREEBSD:-openzfs}
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
2010-08-26 18:22:58 +00:00
|
|
|
|
|
|
|
usage() {
|
2022-04-04 10:55:41 +00:00
|
|
|
cat << EOF
|
2010-08-26 18:22:58 +00:00
|
|
|
USAGE:
|
2022-04-04 10:55:41 +00:00
|
|
|
$0 [hvudS]
|
2010-08-26 18:22:58 +00:00
|
|
|
|
|
|
|
DESCRIPTION:
|
|
|
|
Load/unload the ZFS module stack.
|
|
|
|
|
|
|
|
OPTIONS:
|
2022-04-04 10:55:41 +00:00
|
|
|
-h Show this message
|
|
|
|
-v Verbose
|
2021-08-13 20:37:46 +00:00
|
|
|
-r Reload modules
|
2022-04-04 10:55:41 +00:00
|
|
|
-u Unload modules
|
|
|
|
-S Enable kernel stack tracer
|
2010-08-26 18:22:58 +00:00
|
|
|
EOF
|
2022-04-04 10:55:41 +00:00
|
|
|
exit 1
|
2010-08-26 18:22:58 +00:00
|
|
|
}
|
|
|
|
|
2021-08-13 20:37:46 +00:00
|
|
|
while getopts 'hvruS' OPTION; do
|
2010-08-26 18:22:58 +00:00
|
|
|
case $OPTION in
|
|
|
|
v)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
VERBOSE="yes"
|
2010-08-26 18:22:58 +00:00
|
|
|
;;
|
2021-08-13 20:37:46 +00:00
|
|
|
r)
|
|
|
|
UNLOAD="yes"
|
|
|
|
LOAD="yes"
|
|
|
|
;;
|
2010-08-26 18:22:58 +00:00
|
|
|
u)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
UNLOAD="yes"
|
2021-08-13 20:37:46 +00:00
|
|
|
LOAD="no"
|
2010-08-26 18:22:58 +00:00
|
|
|
;;
|
2018-12-07 18:51:42 +00:00
|
|
|
S)
|
|
|
|
STACK_TRACER="yes"
|
|
|
|
;;
|
2022-01-13 18:09:19 +00:00
|
|
|
*)
|
2022-04-04 10:55:41 +00:00
|
|
|
usage
|
2022-01-13 18:09:19 +00:00
|
|
|
;;
|
2010-08-26 18:22:58 +00:00
|
|
|
esac
|
|
|
|
done
|
2022-04-04 10:55:41 +00:00
|
|
|
shift $(( OPTIND - 1 ))
|
|
|
|
[ $# -eq 0 ] || usage
|
2010-08-26 18:22:58 +00:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
kill_zed() {
|
|
|
|
if [ -f "$ZED_PIDFILE" ]; then
|
2022-04-04 10:48:47 +00:00
|
|
|
read -r PID <"$ZED_PIDFILE"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
kill "$PID"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
check_modules_linux() {
|
2017-09-18 21:23:09 +00:00
|
|
|
LOADED_MODULES=""
|
|
|
|
MISSING_MODULES=""
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
2022-03-31 15:20:50 +00:00
|
|
|
for KMOD in $KMOD_SPL $KMOD_ZFS; do
|
2021-11-11 20:27:37 +00:00
|
|
|
NAME="${KMOD##*/}"
|
|
|
|
NAME="${NAME%.ko}"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
2018-01-17 18:17:16 +00:00
|
|
|
if lsmod | grep -E -q "^${NAME}"; then
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
LOADED_MODULES="$LOADED_MODULES\t$NAME\n"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! modinfo "$KMOD" >/dev/null 2>&1; then
|
|
|
|
MISSING_MODULES="$MISSING_MODULES\t${KMOD}\n"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$LOADED_MODULES" ]; then
|
2022-04-04 10:55:41 +00:00
|
|
|
printf "Unload the kernel modules by running '%s -u':\n" "$0"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
printf "%b" "$LOADED_MODULES"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$MISSING_MODULES" ]; then
|
|
|
|
printf "The following kernel modules can not be found:\n"
|
|
|
|
printf "%b" "$MISSING_MODULES"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
load_module_linux() {
|
2017-09-18 21:23:09 +00:00
|
|
|
KMOD=$1
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
2022-04-04 11:08:59 +00:00
|
|
|
FILE=$(modinfo "$KMOD" 2>&1 | awk 'NR == 1 && /zlib/ && /not found/ {print "(builtin)"; exit} /^filename:/ {print $2}')
|
|
|
|
[ "$FILE" = "(builtin)" ] && return
|
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
2022-04-04 10:55:41 +00:00
|
|
|
VERSION=$(modinfo "$KMOD" | awk '/^version:/ {print $2}')
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
echo "Loading: $FILE ($VERSION)"
|
|
|
|
fi
|
|
|
|
|
2021-05-14 09:55:17 +00:00
|
|
|
if ! $LDMOD "$KMOD" >/dev/null 2>&1; then
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
echo "Failed to load $KMOD"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
load_modules_freebsd() {
|
|
|
|
kldload "$KMOD_FREEBSD" || return 1
|
|
|
|
|
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
|
|
|
echo "Successfully loaded ZFS module stack"
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
load_modules_linux() {
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
mkdir -p /etc/zfs
|
|
|
|
|
2022-04-04 11:08:59 +00:00
|
|
|
for KMOD in "$KMOD_ZLIB_DEFLATE" "$KMOD_ZLIB_INFLATE" $KMOD_SPL $KMOD_ZFS; do
|
2019-12-19 17:31:16 +00:00
|
|
|
load_module_linux "$KMOD" || return 1
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
|
|
|
echo "Successfully loaded ZFS module stack"
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
unload_modules_freebsd() {
|
|
|
|
kldunload "$KMOD_FREEBSD" || echo "Failed to unload $KMOD_FREEBSD"
|
|
|
|
|
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
|
|
|
echo "Successfully unloaded ZFS module stack"
|
|
|
|
fi
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
unload_modules_linux() {
|
2022-04-21 11:32:06 +00:00
|
|
|
legacy_kmods="icp zzstd zlua zcommon zunicode znvpair zavl"
|
|
|
|
for KMOD in "$KMOD_ZFS" $legacy_kmods "$KMOD_SPL"; do
|
|
|
|
NAME="${KMOD##*/}"
|
|
|
|
NAME="${NAME%.ko}"
|
|
|
|
! [ -d "/sys/module/$NAME" ] || $DELMOD "$NAME" || return
|
|
|
|
done
|
2017-08-21 17:00:12 +00:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
|
|
|
echo "Successfully unloaded ZFS module stack"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
stack_clear_linux() {
|
2017-09-18 21:23:09 +00:00
|
|
|
STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
|
|
|
|
STACK_TRACER_ENABLED=/proc/sys/kernel/stack_tracer_enabled
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
2018-12-07 18:51:42 +00:00
|
|
|
if [ "$STACK_TRACER" = "yes" ] && [ -e "$STACK_MAX_SIZE" ]; then
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
echo 1 >"$STACK_TRACER_ENABLED"
|
|
|
|
echo 0 >"$STACK_MAX_SIZE"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-12-19 17:31:16 +00:00
|
|
|
stack_check_linux() {
|
2017-09-18 21:23:09 +00:00
|
|
|
STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
|
|
|
|
STACK_TRACE=/sys/kernel/debug/tracing/stack_trace
|
2016-09-12 15:15:20 +00:00
|
|
|
STACK_LIMIT=15362
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
|
|
|
|
if [ -e "$STACK_MAX_SIZE" ]; then
|
2022-04-04 10:48:47 +00:00
|
|
|
read -r STACK_SIZE <"$STACK_MAX_SIZE"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
if [ "$STACK_SIZE" -ge "$STACK_LIMIT" ]; then
|
|
|
|
echo
|
|
|
|
echo "Warning: max stack size $STACK_SIZE bytes"
|
|
|
|
cat "$STACK_TRACE"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-03-09 18:20:15 +00:00
|
|
|
if [ "$(id -u)" != 0 ]; then
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
echo "Must run as root"
|
|
|
|
exit 1
|
2010-08-26 18:22:58 +00:00
|
|
|
fi
|
|
|
|
|
2022-03-03 23:09:08 +00:00
|
|
|
UNAME=$(uname)
|
2019-12-19 17:31:16 +00:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 00:26:38 +00:00
|
|
|
if [ "$UNLOAD" = "yes" ]; then
|
2014-01-21 21:30:03 +00:00
|
|
|
kill_zed
|
2011-02-16 19:10:31 +00:00
|
|
|
umount -t zfs -a
|
2019-12-19 17:31:16 +00:00
|
|
|
case $UNAME in
|
|
|
|
FreeBSD)
|
2022-04-04 10:55:41 +00:00
|
|
|
unload_modules_freebsd
|
2019-12-19 17:31:16 +00:00
|
|
|
;;
|
|
|
|
Linux)
|
2022-04-04 10:55:41 +00:00
|
|
|
stack_check_linux
|
|
|
|
unload_modules_linux
|
2019-12-19 17:31:16 +00:00
|
|
|
;;
|
2022-01-13 18:09:19 +00:00
|
|
|
*)
|
2022-04-04 10:55:41 +00:00
|
|
|
echo "unknown system: $UNAME" >&2
|
|
|
|
exit 1
|
2022-01-13 18:09:19 +00:00
|
|
|
;;
|
2019-12-19 17:31:16 +00:00
|
|
|
esac
|
2021-08-13 20:37:46 +00:00
|
|
|
fi
|
|
|
|
if [ "$LOAD" = "yes" ]; then
|
2019-12-19 17:31:16 +00:00
|
|
|
case $UNAME in
|
|
|
|
FreeBSD)
|
|
|
|
load_modules_freebsd
|
|
|
|
;;
|
|
|
|
Linux)
|
|
|
|
stack_clear_linux
|
|
|
|
check_modules_linux
|
2022-04-04 10:55:41 +00:00
|
|
|
load_modules_linux
|
2019-12-19 17:31:16 +00:00
|
|
|
udevadm trigger
|
|
|
|
udevadm settle
|
|
|
|
;;
|
2022-01-13 18:09:19 +00:00
|
|
|
*)
|
2022-04-04 10:55:41 +00:00
|
|
|
echo "unknown system: $UNAME" >&2
|
|
|
|
exit 1
|
2022-01-13 18:09:19 +00:00
|
|
|
;;
|
2019-12-19 17:31:16 +00:00
|
|
|
esac
|
2010-08-26 18:22:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|