mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 12:12:13 +03:00
tests: review every instance of $?
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:
@@ -32,10 +32,8 @@ fi
|
||||
verify_runnable "global"
|
||||
|
||||
# Verify that the required dependencies for testing are installed.
|
||||
@PYTHON@ -c "import cffi" 2>/dev/null
|
||||
if [ $? -eq 1 ]; then
|
||||
@PYTHON@ -c "import cffi" 2>/dev/null ||
|
||||
log_unsupported "python3-cffi not found by Python"
|
||||
fi
|
||||
|
||||
# We don't just try to "import libzfs_core" because we want to skip these tests
|
||||
# only if pyzfs was not installed due to missing, build-time, dependencies; if
|
||||
@@ -43,19 +41,16 @@ fi
|
||||
# mismatch, we want to report it.
|
||||
@PYTHON@ -c '
|
||||
import pkgutil, sys
|
||||
sys.exit(pkgutil.find_loader("libzfs_core") is None)'
|
||||
if [ $? -eq 1 ]; then
|
||||
sys.exit(pkgutil.find_loader("libzfs_core") is None)' ||
|
||||
log_unsupported "libzfs_core not found by Python"
|
||||
fi
|
||||
|
||||
log_assert "Verify the nvlist and libzfs_core Python unittest run successfully"
|
||||
|
||||
# NOTE: don't use log_must() here because it makes output unreadable
|
||||
# log_must buffers stderr, which interacts badly with
|
||||
# no-output timeouts on CI runners
|
||||
@PYTHON@ -m unittest --verbose \
|
||||
libzfs_core.test.test_nvlist.TestNVList \
|
||||
libzfs_core.test.test_libzfs_core.ZFSTest
|
||||
if [ $? -ne 0 ]; then
|
||||
libzfs_core.test.test_libzfs_core.ZFSTest ||
|
||||
log_fail "Python unittest completed with errors"
|
||||
fi
|
||||
|
||||
log_pass "Python unittest completed without errors"
|
||||
|
||||
Reference in New Issue
Block a user