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:
наб 2022-03-08 13:36:03 +01:00 committed by Brian Behlendorf
parent bd328a588b
commit 2d9da5e1c8
37 changed files with 74 additions and 29 deletions

View File

@ -3376,6 +3376,7 @@ function write_compressible
done
done
else
command -v fio > /dev/null || log_unsupported "fio missing"
log_must eval fio \
--name=job \
--fallocate=0 \

View File

@ -26,5 +26,7 @@
. $STF_SUITE/include/libtest.shlib
is_freebsd && ! python3 -c 'import sysctl' 2>/dev/null && log_unsupported "python3 sysctl module missing"
DISK=${DISKS%% *}
default_setup $DISK

View File

@ -44,6 +44,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Looping around a cache device succeeds."
function cleanup

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -52,6 +52,8 @@ export DIRECT=1
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "L2ARC with compressed_arc enabled succeeds."
origin_carc_setting=$(get_tunable COMPRESSED_ARC_ENABLED)

View File

@ -52,6 +52,8 @@ export DIRECT=1
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "L2ARC with compressed_arc disabled succeeds."
origin_carc_setting=$(get_tunable COMPRESSED_ARC_ENABLED)

View File

@ -53,6 +53,8 @@ export DIRECT=1
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "L2ARC with encryption enabled succeeds."
origin_carc_setting=$(get_tunable COMPRESSED_ARC_ENABLED)

View File

@ -53,6 +53,8 @@ export DIRECT=1
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "L2ARC with compressed_arc disabled succeeds."
origin_carc_setting=$(get_tunable COMPRESSED_ARC_ENABLED)

View File

@ -44,7 +44,7 @@ if [[ $(linux_version) -lt $(linux_version "5.1") ]]; then
log_unsupported "Requires io_uring support"
fi
fio --ioengine=io_uring --parse-only || log_unsupported "io_uring support required"
fio --ioengine=io_uring --parse-only || log_unsupported "fio io_uring support required"
function cleanup
{

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
log_must rm -f "$mntpnt/rw*"

View File

@ -37,7 +37,7 @@
# 2. Repeat the test with additional fio(1) options.
#
if ! compare_version_gte $(fio --version) "fio-2.3"; then
if ! compare_version_gte "$(fio --version)" "fio-2.3"; then
log_unsupported "Requires fio-2.3 or newer"
fi

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
log_must rm -f "$mntpnt/rw*"

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
log_must rm -f "/$TESTPOOL/rw*"

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
log_must rm -f "$mntpnt/rw*"

View File

@ -40,6 +40,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "L2ARC MFU/MRU arcstats do not leak."
function cleanup

View File

@ -38,6 +38,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "l2arc_misses does not increment upon reads from a pool without l2arc."
function cleanup

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "l2arc_mfuonly does not cache MRU buffers."
function cleanup

View File

@ -49,6 +49,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Persistent L2ARC with an unencrypted ZFS file system succeeds."
function cleanup

View File

@ -52,6 +52,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Persistent L2ARC with an encrypted ZFS file system succeeds."
function cleanup

View File

@ -38,6 +38,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Persistent L2ARC fails as expected when L2ARC_REBUILD_ENABLED = 0."
function cleanup

View File

@ -40,6 +40,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev not present."
function cleanup

View File

@ -39,6 +39,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Off/onlining an L2ARC device results in rebuilding L2ARC, vdev present."
function cleanup

View File

@ -30,6 +30,8 @@
verify_runnable "both"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
destroy_pool $TESTPOOL

View File

@ -32,6 +32,8 @@
# 4. Reattach it to make a mirror
#
command -v fio > /dev/null || log_unsupported "fio missing"
TMPDIR=${TMPDIR:-$TEST_BASE_DIR}
DISK1="$TMPDIR/dsk1"

View File

@ -31,6 +31,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
#

View File

@ -36,6 +36,8 @@
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
log_assert "Trim of L2ARC succeeds."
function cleanup

View File

@ -38,6 +38,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -38,6 +38,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -28,6 +28,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -37,6 +37,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -18,6 +18,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -28,6 +28,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -34,6 +34,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -32,6 +32,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat

View File

@ -37,6 +37,8 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/perf/perf.shlib
command -v fio > /dev/null || log_unsupported "fio missing"
function cleanup
{
# kill fio and iostat