3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2018, loli10K <ezomori.nozomu@gmail.com>. All rights reserved.
17 .
$STF_SUITE/include
/libtest.shlib
21 # Verify the libzfs_core Python test suite can be run successfully
24 # 1. Run the nvlist and libzfs_core Python unittest
25 # 2. Verify the exit code is 0 (no errors)
28 verify_runnable
"global"
30 # Verify that the required dependencies for testing are installed.
31 python
-c "import cffi" 2>/dev
/null
33 log_unsupported
"python-cffi not found by Python"
36 # We don't just try to "import libzfs_core" because we want to skip these tests
37 # only if pyzfs was not installed due to missing, build-time, dependencies; if
38 # we cannot load "libzfs_core" due to other reasons, for instance an API/ABI
39 # mismatch, we want to report it.
42 sys.exit(pkgutil.find_loader("libzfs_core") is None)'
44 log_unsupported
"libzfs_core not found by Python"
47 log_assert
"Verify the nvlist and libzfs_core Python unittest run successfully"
49 # NOTE: don't use log_must() here because it makes output unreadable
50 python
-m unittest
--verbose \
51 libzfs_core.
test.test_nvlist.TestNVList \
52 libzfs_core.
test.test_libzfs_core.ZFSTest
54 log_fail
"Python unittest completed with errors"
57 log_pass
"Python unittest completed without errors"