mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-06-01 19:54:10 +03:00
tests: don't fail if no fio or python3.sysctl
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13259
This commit is contained in:
@@ -27,34 +27,15 @@
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
log_assert "arc_summary generates output and doesn't return an error code"
|
||||
is_freebsd && ! python3 -c 'import sysctl' 2>/dev/null && log_unsupported "python3 sysctl module missing"
|
||||
|
||||
# Depending on which version of arc_summary is installed some command
|
||||
# line options may not be available. The python3 version includes
|
||||
# several additional flags.
|
||||
python3 -V 2>&1 > /dev/null
|
||||
if (( $? )); then
|
||||
# Some systems have Python 3 installed, but only older versions
|
||||
# that don't have the subprocess.run() functionality. We catch
|
||||
# these with a separate test. Remove this when all systems have
|
||||
# reached 3.5 or greater
|
||||
VERSIONPYTEST=$(python3 -V)
|
||||
if [[ ${VERSIONPYTEST:9:1} -lt 5 ]]; then
|
||||
set -A args "" "-a" "-d" "-p 1"
|
||||
else
|
||||
set -A args "" "-a" "-d" "-p 1" "-g" "-s arc" "-r"
|
||||
fi
|
||||
else
|
||||
set -A args "" "-a" "-d" "-p 1"
|
||||
fi
|
||||
log_assert "arc_summary generates output and doesn't return an error code"
|
||||
|
||||
# Without this, the below checks aren't going to work the way we hope...
|
||||
set -o pipefail
|
||||
|
||||
typeset -i i=0
|
||||
while [[ $i -lt ${#args[*]} ]]; do
|
||||
log_must eval "arc_summary ${args[i]} > /dev/null"
|
||||
((i = i + 1))
|
||||
for arg in "" "-a" "-d" "-p 1" "-g" "-s arc" "-r"; do
|
||||
log_must eval "arc_summary $arg > /dev/null"
|
||||
done
|
||||
|
||||
log_must eval "arc_summary | head > /dev/null"
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
typeset args=("-x" "-5" "-p 7" "--err" "-@")
|
||||
is_freebsd && ! python3 -c 'import sysctl' 2>/dev/null && log_unsupported "python3 sysctl module missing"
|
||||
|
||||
log_assert "arc_summary generates an error code with invalid options"
|
||||
|
||||
for arg in "${args[@]}"; do
|
||||
for arg in "-x" "-5" "-p 7" "--err" "-@"; do
|
||||
log_mustnot eval "arc_summary $arg > /dev/null"
|
||||
done
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#! /bin/ksh -p
|
||||
#!/bin/ksh -p
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
|
||||
is_freebsd && ! python3 -c 'import sysctl' 2>/dev/null && log_unsupported "python3 sysctl module missing"
|
||||
|
||||
set -A args "" "-s \",\"" "-x" "-v" \
|
||||
"-f time,hit%,dh%,ph%,mh%"
|
||||
|
||||
@@ -38,4 +40,3 @@ while [[ $i -lt ${#args[*]} ]]; do
|
||||
((i = i + 1))
|
||||
done
|
||||
log_pass "arcstat generates output and doesn't return an error code"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user