From 20093de25c22fad1aa21b9c1317e5291908cd303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Tue, 22 Mar 2022 20:09:35 +0100 Subject: [PATCH] tests: move C test helpers into test cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Reviewed-by: John Kennedy Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia ZiemiaƄska Closes #13259 --- tests/runfiles/common.run | 4 +- tests/runfiles/sanity.run | 4 +- tests/zfs-tests/cmd/.gitignore | 11 +++++ tests/zfs-tests/cmd/Makefile.am | 42 +++++++++++++++++++ .../functional => cmd}/checksum/edonr_test.c | 0 .../functional => cmd}/checksum/sha2_test.c | 0 .../functional => cmd}/checksum/skein_test.c | 0 .../functional/cp_files => cmd}/cp_files.c | 0 .../{tests/functional/ctime => cmd}/ctime.c | 0 .../acl/off => cmd}/dosmode_readonly_write.c | 0 .../cli_root/zpool_events => cmd}/ereports.c | 2 +- .../suid => cmd}/suid_write_to_file.c | 0 .../truncate => cmd}/truncate_test.c | 0 .../events => cmd}/zed_fd_spill-zedlet.c | 0 .../socket.c => cmd/zfs_diff-socket.c} | 0 tests/zfs-tests/include/commands.cfg | 13 +++++- .../tests/functional/acl/off/.gitignore | 1 - .../tests/functional/acl/off/Makefile.am | 7 ---- .../tests/functional/acl/off/dosmode.ksh | 3 +- .../tests/functional/checksum/.gitignore | 4 -- .../tests/functional/checksum/Makefile.am | 18 -------- .../functional/checksum/run_edonr_test.ksh | 2 +- .../functional/checksum/run_sha2_test.ksh | 2 +- .../functional/checksum/run_skein_test.ksh | 2 +- .../functional/cli_root/zfs_diff/.gitignore | 1 - .../functional/cli_root/zfs_diff/Makefile.am | 7 ---- .../cli_root/zfs_diff/zfs_diff_types.ksh | 2 +- .../cli_root/zpool_events/.gitignore | 1 - .../cli_root/zpool_events/Makefile.am | 10 ----- .../zpool_events_clear_retained.ksh | 4 +- .../zpool_events/zpool_events_duplicates.ksh | 4 +- .../tests/functional/cp_files/.gitignore | 1 - .../tests/functional/cp_files/Makefile.am | 7 ---- .../functional/cp_files/cp_files_001_pos.ksh | 5 +-- .../tests/functional/ctime/.gitignore | 1 - .../tests/functional/ctime/Makefile.am | 7 ---- .../tests/functional/ctime/ctime_001_pos.ksh | 2 +- .../tests/functional/events/.gitignore | 1 - .../tests/functional/events/Makefile.am | 6 --- .../tests/functional/events/zed_fd_spill.ksh | 9 ++-- .../tests/functional/hkdf/Makefile.am | 11 +---- .../tests/functional/hkdf/cleanup.ksh | 22 ---------- .../tests/functional/hkdf/run_hkdf_test.ksh | 30 ------------- .../zfs-tests/tests/functional/hkdf/setup.ksh | 22 ---------- .../tests/functional/libzfs/Makefile.am | 7 +--- .../tests/functional/suid/.gitignore | 1 - .../tests/functional/suid/Makefile.am | 7 ---- .../functional/suid/suid_write_to_none.ksh | 2 +- .../functional/suid/suid_write_to_sgid.ksh | 2 +- .../functional/suid/suid_write_to_suid.ksh | 2 +- .../suid/suid_write_to_suid_sgid.ksh | 2 +- .../functional/suid/suid_write_zil_replay.ksh | 16 +++---- .../tests/functional/truncate/.gitignore | 1 - .../tests/functional/truncate/Makefile.am | 7 ---- .../truncate/truncate_timestamps.ksh | 4 +- 55 files changed, 103 insertions(+), 216 deletions(-) rename tests/zfs-tests/{tests/functional => cmd}/checksum/edonr_test.c (100%) rename tests/zfs-tests/{tests/functional => cmd}/checksum/sha2_test.c (100%) rename tests/zfs-tests/{tests/functional => cmd}/checksum/skein_test.c (100%) rename tests/zfs-tests/{tests/functional/cp_files => cmd}/cp_files.c (100%) rename tests/zfs-tests/{tests/functional/ctime => cmd}/ctime.c (100%) rename tests/zfs-tests/{tests/functional/acl/off => cmd}/dosmode_readonly_write.c (100%) rename tests/zfs-tests/{tests/functional/cli_root/zpool_events => cmd}/ereports.c (98%) rename tests/zfs-tests/{tests/functional/suid => cmd}/suid_write_to_file.c (100%) rename tests/zfs-tests/{tests/functional/truncate => cmd}/truncate_test.c (100%) rename tests/zfs-tests/{tests/functional/events => cmd}/zed_fd_spill-zedlet.c (100%) rename tests/zfs-tests/{tests/functional/cli_root/zfs_diff/socket.c => cmd/zfs_diff-socket.c} (100%) delete mode 100644 tests/zfs-tests/tests/functional/acl/off/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/checksum/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/cli_root/zfs_diff/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/cp_files/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/ctime/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/events/.gitignore delete mode 100755 tests/zfs-tests/tests/functional/hkdf/cleanup.ksh delete mode 100755 tests/zfs-tests/tests/functional/hkdf/run_hkdf_test.ksh delete mode 100755 tests/zfs-tests/tests/functional/hkdf/setup.ksh delete mode 100644 tests/zfs-tests/tests/functional/suid/.gitignore delete mode 100644 tests/zfs-tests/tests/functional/truncate/.gitignore diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run index 87b669db7d..1cd439c434 100644 --- a/tests/runfiles/common.run +++ b/tests/runfiles/common.run @@ -640,7 +640,9 @@ tests = ['history_001_pos', 'history_002_pos', 'history_003_pos', tags = ['functional', 'history'] [tests/functional/hkdf] -tests = ['run_hkdf_test'] +pre = +post = +tests = ['hkdf_test'] tags = ['functional', 'hkdf'] [tests/functional/inheritance] diff --git a/tests/runfiles/sanity.run b/tests/runfiles/sanity.run index 9faf0e4d99..0ed693c2f4 100644 --- a/tests/runfiles/sanity.run +++ b/tests/runfiles/sanity.run @@ -438,7 +438,9 @@ tests = ['history_004_pos', 'history_005_neg', 'history_007_pos', tags = ['functional', 'history'] [tests/functional/hkdf] -tests = ['run_hkdf_test'] +pre = +post = +tests = ['hkdf_test'] tags = ['functional', 'hkdf'] [tests/functional/inuse] diff --git a/tests/zfs-tests/cmd/.gitignore b/tests/zfs-tests/cmd/.gitignore index ea4d2613c5..e28fed8f12 100644 --- a/tests/zfs-tests/cmd/.gitignore +++ b/tests/zfs-tests/cmd/.gitignore @@ -32,3 +32,14 @@ /user_ns_exec /write_dos_attributes /xattrtest +/zed_fd_spill-zedlet +/suid_write_to_file +/cp_files +/ctime +/truncate_test +/ereports +/zfs_diff-socket +/dosmode_readonly_write +/edonr_test +/skein_test +/sha2_test diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am index ca3befb277..3b6f41ca08 100644 --- a/tests/zfs-tests/cmd/Makefile.am +++ b/tests/zfs-tests/cmd/Makefile.am @@ -124,6 +124,45 @@ pkgexec_PROGRAMS += threadsappend threadsappend_SOURCES = threadsappend.c threadsappend_LDADD = -lpthread +pkgexec_PROGRAMS += suid_write_to_file +suid_write_to_file_SOURCES = suid_write_to_file.c + +pkgexec_PROGRAMS += cp_files +cp_files_SOURCES = cp_files.c + +pkgexec_PROGRAMS += ctime +ctime_SOURCES = ctime.c + +pkgexec_PROGRAMS += truncate_test +truncate_test_SOURCES = truncate_test.c + +pkgexec_PROGRAMS += ereports +ereports_SOURCES = ereports.c +ereports_LDADD = \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la \ + $(abs_top_builddir)/lib/libzfs/libzfs.la + +pkgexec_PROGRAMS += zfs_diff-socket +zfs_diff_socket_SOURCES = zfs_diff-socket.c + +pkgexec_PROGRAMS += dosmode_readonly_write +dosmode_readonly_write_SOURCES = dosmode_readonly_write.c + + +pkgexec_PROGRAMS += edonr_test skein_test sha2_test +skein_test_SOURCES = checksum/skein_test.c +sha2_test_SOURCES = checksum/sha2_test.c +edonr_test_SOURCES = checksum/edonr_test.c +skein_test_LDADD = \ + $(abs_top_builddir)/lib/libicp/libicp.la \ + $(abs_top_builddir)/lib/libspl/libspl_assert.la +sha2_test_LDADD = \ + $(abs_top_builddir)/lib/libicp/libicp.la \ + $(abs_top_builddir)/lib/libspl/libspl_assert.la +edonr_test_LDADD = \ + $(abs_top_builddir)/lib/libicp/libicp.la \ + $(abs_top_builddir)/lib/libspl/libspl_assert.la + if BUILD_LINUX pkgexec_PROGRAMS += getversion @@ -142,4 +181,7 @@ user_ns_exec_SOURCES = user_ns_exec.c pkgexec_PROGRAMS += xattrtest xattrtest_SOURCES = xattrtest.c + +pkgexec_PROGRAMS += zed_fd_spill-zedlet +zed_fd_spill_zedlet_SOURCES = zed_fd_spill-zedlet.c endif diff --git a/tests/zfs-tests/tests/functional/checksum/edonr_test.c b/tests/zfs-tests/cmd/checksum/edonr_test.c similarity index 100% rename from tests/zfs-tests/tests/functional/checksum/edonr_test.c rename to tests/zfs-tests/cmd/checksum/edonr_test.c diff --git a/tests/zfs-tests/tests/functional/checksum/sha2_test.c b/tests/zfs-tests/cmd/checksum/sha2_test.c similarity index 100% rename from tests/zfs-tests/tests/functional/checksum/sha2_test.c rename to tests/zfs-tests/cmd/checksum/sha2_test.c diff --git a/tests/zfs-tests/tests/functional/checksum/skein_test.c b/tests/zfs-tests/cmd/checksum/skein_test.c similarity index 100% rename from tests/zfs-tests/tests/functional/checksum/skein_test.c rename to tests/zfs-tests/cmd/checksum/skein_test.c diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_files.c b/tests/zfs-tests/cmd/cp_files.c similarity index 100% rename from tests/zfs-tests/tests/functional/cp_files/cp_files.c rename to tests/zfs-tests/cmd/cp_files.c diff --git a/tests/zfs-tests/tests/functional/ctime/ctime.c b/tests/zfs-tests/cmd/ctime.c similarity index 100% rename from tests/zfs-tests/tests/functional/ctime/ctime.c rename to tests/zfs-tests/cmd/ctime.c diff --git a/tests/zfs-tests/tests/functional/acl/off/dosmode_readonly_write.c b/tests/zfs-tests/cmd/dosmode_readonly_write.c similarity index 100% rename from tests/zfs-tests/tests/functional/acl/off/dosmode_readonly_write.c rename to tests/zfs-tests/cmd/dosmode_readonly_write.c diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c b/tests/zfs-tests/cmd/ereports.c similarity index 98% rename from tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c rename to tests/zfs-tests/cmd/ereports.c index bff3bb1ee8..392f5952d2 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c +++ b/tests/zfs-tests/cmd/ereports.c @@ -42,7 +42,7 @@ * When the class and all of these values match, then an ereport is * considered to be a duplicate. */ -static const char *criteria_name[] = { +static const char *const criteria_name[] = { FM_EREPORT_PAYLOAD_ZFS_POOL, FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, FM_EREPORT_PAYLOAD_ZFS_ZIO_ERR, diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_file.c b/tests/zfs-tests/cmd/suid_write_to_file.c similarity index 100% rename from tests/zfs-tests/tests/functional/suid/suid_write_to_file.c rename to tests/zfs-tests/cmd/suid_write_to_file.c diff --git a/tests/zfs-tests/tests/functional/truncate/truncate_test.c b/tests/zfs-tests/cmd/truncate_test.c similarity index 100% rename from tests/zfs-tests/tests/functional/truncate/truncate_test.c rename to tests/zfs-tests/cmd/truncate_test.c diff --git a/tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c b/tests/zfs-tests/cmd/zed_fd_spill-zedlet.c similarity index 100% rename from tests/zfs-tests/tests/functional/events/zed_fd_spill-zedlet.c rename to tests/zfs-tests/cmd/zed_fd_spill-zedlet.c diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/socket.c b/tests/zfs-tests/cmd/zfs_diff-socket.c similarity index 100% rename from tests/zfs-tests/tests/functional/cli_root/zfs_diff/socket.c rename to tests/zfs-tests/cmd/zfs_diff-socket.c diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index 0951f719b9..6e45d1ffc0 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -206,4 +206,15 @@ export ZFSTEST_FILES='badsend user_ns_exec write_dos_attributes xattrtest - stride_dd' + stride_dd + zed_fd_spill-zedlet + suid_write_to_file + cp_files + edonr_test + skein_test + sha2_test + ctime + truncate_test + ereports + zfs_diff-socket + dosmode_readonly_write' diff --git a/tests/zfs-tests/tests/functional/acl/off/.gitignore b/tests/zfs-tests/tests/functional/acl/off/.gitignore deleted file mode 100644 index f3c93191ce..0000000000 --- a/tests/zfs-tests/tests/functional/acl/off/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/dosmode_readonly_write diff --git a/tests/zfs-tests/tests/functional/acl/off/Makefile.am b/tests/zfs-tests/tests/functional/acl/off/Makefile.am index ae6a9c69d9..e315acc65f 100644 --- a/tests/zfs-tests/tests/functional/acl/off/Makefile.am +++ b/tests/zfs-tests/tests/functional/acl/off/Makefile.am @@ -1,5 +1,3 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/acl/off dist_pkgdata_SCRIPTS = \ @@ -7,8 +5,3 @@ dist_pkgdata_SCRIPTS = \ posixmode.ksh \ cleanup.ksh \ setup.ksh - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/acl/off - -pkgexec_PROGRAMS = dosmode_readonly_write -dosmode_readonly_write_SOURCES = dosmode_readonly_write.c diff --git a/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh b/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh index 329eaef55d..bab2109b9d 100755 --- a/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh +++ b/tests/zfs-tests/tests/functional/acl/off/dosmode.ksh @@ -64,7 +64,6 @@ function hasflag log_assert "Verify DOS mode flags function correctly" log_onexit cleanup -tests_base=$STF_SUITE/tests/functional/acl/off testfile=$TESTDIR/testfile owner=$ZFS_ACL_STAFF1 other=$ZFS_ACL_STAFF2 @@ -157,7 +156,7 @@ log_must rm $testfile # READONLY is set. We have a special test program for that. log_must user_run $owner touch $testfile log_mustnot user_run $other $changeflags rdonly $testfile -log_must user_run $owner $tests_base/dosmode_readonly_write $testfile +log_must user_run $owner dosmode_readonly_write $testfile log_mustnot user_run $other $changeflags nordonly $testfile log_must hasflag rdonly $testfile if ! is_linux; then diff --git a/tests/zfs-tests/tests/functional/checksum/.gitignore b/tests/zfs-tests/tests/functional/checksum/.gitignore deleted file mode 100644 index 0411d5aa47..0000000000 --- a/tests/zfs-tests/tests/functional/checksum/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -skein_test -edonr_test -sha2_test - diff --git a/tests/zfs-tests/tests/functional/checksum/Makefile.am b/tests/zfs-tests/tests/functional/checksum/Makefile.am index 717098aa07..2eed764bef 100644 --- a/tests/zfs-tests/tests/functional/checksum/Makefile.am +++ b/tests/zfs-tests/tests/functional/checksum/Makefile.am @@ -1,9 +1,3 @@ -include $(top_srcdir)/config/Rules.am - -LDADD = \ - $(abs_top_builddir)/lib/libicp/libicp.la \ - $(abs_top_builddir)/lib/libspl/libspl_assert.la - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/checksum dist_pkgdata_SCRIPTS = \ @@ -17,15 +11,3 @@ dist_pkgdata_SCRIPTS = \ dist_pkgdata_DATA = \ default.cfg - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/checksum - -pkgexec_PROGRAMS = \ - edonr_test \ - skein_test \ - sha2_test - -skein_test_SOURCES = skein_test.c -sha2_test_SOURCES = sha2_test.c - -edonr_test_SOURCES = edonr_test.c diff --git a/tests/zfs-tests/tests/functional/checksum/run_edonr_test.ksh b/tests/zfs-tests/tests/functional/checksum/run_edonr_test.ksh index 42e88a8c8e..de5b21918e 100755 --- a/tests/zfs-tests/tests/functional/checksum/run_edonr_test.ksh +++ b/tests/zfs-tests/tests/functional/checksum/run_edonr_test.ksh @@ -25,6 +25,6 @@ log_assert "Run the tests for the EdonR hash algorithm." freq=$(get_cpu_freq) -log_must $STF_SUITE/tests/functional/checksum/edonr_test $freq +log_must edonr_test $freq log_pass "EdonR tests passed." diff --git a/tests/zfs-tests/tests/functional/checksum/run_sha2_test.ksh b/tests/zfs-tests/tests/functional/checksum/run_sha2_test.ksh index e238d7a53e..23954a5d35 100755 --- a/tests/zfs-tests/tests/functional/checksum/run_sha2_test.ksh +++ b/tests/zfs-tests/tests/functional/checksum/run_sha2_test.ksh @@ -25,6 +25,6 @@ log_assert "Run the tests for the SHA-2 hash algorithm." freq=$(get_cpu_freq) -log_must $STF_SUITE/tests/functional/checksum/sha2_test $freq +log_must sha2_test $freq log_pass "SHA-2 tests passed." diff --git a/tests/zfs-tests/tests/functional/checksum/run_skein_test.ksh b/tests/zfs-tests/tests/functional/checksum/run_skein_test.ksh index b3a33c3ca8..d59bde206d 100755 --- a/tests/zfs-tests/tests/functional/checksum/run_skein_test.ksh +++ b/tests/zfs-tests/tests/functional/checksum/run_skein_test.ksh @@ -25,6 +25,6 @@ log_assert "Run the tests for the Skein hash algorithm." freq=$(get_cpu_freq) -log_must $STF_SUITE/tests/functional/checksum/skein_test $freq +log_must skein_test $freq log_pass "Skein tests passed." diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/.gitignore b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/.gitignore deleted file mode 100644 index 7fa74c3575..0000000000 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/socket diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/Makefile.am index bfb01dcb8f..136cfe186d 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/Makefile.am +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/Makefile.am @@ -1,5 +1,3 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zfs_diff dist_pkgdata_SCRIPTS = \ @@ -11,8 +9,3 @@ dist_pkgdata_SCRIPTS = \ zfs_diff_mangle.ksh \ zfs_diff_timestamp.ksh \ zfs_diff_types.ksh - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zfs_diff - -pkgexec_PROGRAMS = socket -socket_SOURCES = socket.c diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_types.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_types.ksh index 07b14e7aec..414fde336c 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_types.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_types.ksh @@ -123,7 +123,7 @@ verify_object_class "$MNTPOINT/dir" "/" # 2. = (Socket) log_must zfs snapshot "$TESTSNAP1" -log_must $STF_SUITE/tests/functional/cli_root/zfs_diff/socket "$MNTPOINT/sock" +log_must zfs_diff-socket "$MNTPOINT/sock" log_must zfs snapshot "$TESTSNAP2" verify_object_class "$MNTPOINT/sock" "=" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore b/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore deleted file mode 100644 index a1f8c14838..0000000000 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ereports diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am b/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am index 765df10222..e1a9fd404b 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am @@ -1,7 +1,4 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_events -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_events dist_pkgdata_SCRIPTS = \ setup.ksh \ @@ -17,10 +14,3 @@ dist_pkgdata_SCRIPTS = \ dist_pkgdata_DATA = \ zpool_events.cfg \ zpool_events.kshlib - -ereports_LDADD = \ - $(abs_top_builddir)/lib/libnvpair/libnvpair.la \ - $(abs_top_builddir)/lib/libzfs/libzfs.la - -pkgexec_PROGRAMS = ereports -ereports_SOURCES = ereports.c diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh index 76d9c525e4..9b5b5e1a02 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear_retained.ksh @@ -55,8 +55,6 @@ OLD_LEN_MAX=$(get_tunable ZEVENT_LEN_MAX) RETAIN_MAX=$(get_tunable ZEVENT_RETAIN_MAX) OLD_CHECKSUMS=$(get_tunable CHECKSUM_EVENTS_PER_SECOND) -EREPORTS="$STF_SUITE/tests/functional/cli_root/zpool_events/ereports" - function cleanup { log_must set_tunable64 CHECKSUM_EVENTS_PER_SECOND $OLD_CHECKSUMS @@ -78,7 +76,7 @@ function damage_and_repair log_must dd conv=notrunc if=$SUPPLY of=$VDEV1 bs=1M seek=4 count=$DAMAGEBLKS log_must zpool scrub $POOL log_must zpool wait -t scrub $POOL - log_note "pass $1 observed $($EREPORTS | grep -c checksum) checksum ereports" + log_note "pass $1 observed $(ereports | grep -c checksum) checksum ereports" repaired=$(zpool status $POOL | awk '/scan: scrub repaired/ {print $4}') if [ "$repaired" == "0B" ]; then diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh index 142ebacd45..08ab6a2fab 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh @@ -46,8 +46,6 @@ FILESIZE="10M" OLD_LEN_MAX=$(get_tunable ZEVENT_LEN_MAX) RETAIN_MAX=$(get_tunable ZEVENT_RETAIN_MAX) -EREPORTS="$STF_SUITE/tests/functional/cli_root/zpool_events/ereports" - duplicates=false function cleanup @@ -117,7 +115,7 @@ function do_dup_test log_must zinject -c all - ereports="$($EREPORTS | sort)" + ereports="$(ereports | sort)" actual=$(echo "$ereports" | wc -l) unique=$(echo "$ereports" | uniq | wc -l) log_note "$actual total $ERR $RW ereports where $unique were unique" diff --git a/tests/zfs-tests/tests/functional/cp_files/.gitignore b/tests/zfs-tests/tests/functional/cp_files/.gitignore deleted file mode 100644 index eac05e1553..0000000000 --- a/tests/zfs-tests/tests/functional/cp_files/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/cp_files diff --git a/tests/zfs-tests/tests/functional/cp_files/Makefile.am b/tests/zfs-tests/tests/functional/cp_files/Makefile.am index 06c31f5f3f..92e258f0d2 100644 --- a/tests/zfs-tests/tests/functional/cp_files/Makefile.am +++ b/tests/zfs-tests/tests/functional/cp_files/Makefile.am @@ -1,13 +1,6 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cp_files dist_pkgdata_SCRIPTS = \ cp_files_001_pos.ksh \ cleanup.ksh \ setup.ksh - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cp_files - -pkgexec_PROGRAMS = cp_files -cp_files_SOURCES= cp_files.c diff --git a/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh b/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh index 208ecfeed3..3a814ca362 100755 --- a/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh @@ -55,8 +55,7 @@ log_onexit cleanup NR_FILES=60000 BATCH=1000 -log_must mkdir $TESTDIR/src -log_must mkdir $TESTDIR/dst +log_must mkdir $TESTDIR/src $TESTDIR/dst WD=$PWD cd $TESTDIR/src @@ -67,7 +66,7 @@ cd $WD log_must test $NR_FILES -eq $(ls -U $TESTDIR/src | wc -l) # copy files from src to dst, use cp_files to make sure we copy in readdir order -log_must $STF_SUITE/tests/functional/cp_files/cp_files $TESTDIR/src $TESTDIR/dst +log_must cp_files $TESTDIR/src $TESTDIR/dst log_must test $NR_FILES -eq $(ls -U $TESTDIR/dst | wc -l) diff --git a/tests/zfs-tests/tests/functional/ctime/.gitignore b/tests/zfs-tests/tests/functional/ctime/.gitignore deleted file mode 100644 index 9e4539d5fe..0000000000 --- a/tests/zfs-tests/tests/functional/ctime/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/ctime diff --git a/tests/zfs-tests/tests/functional/ctime/Makefile.am b/tests/zfs-tests/tests/functional/ctime/Makefile.am index e7479ae810..724e5b99ee 100644 --- a/tests/zfs-tests/tests/functional/ctime/Makefile.am +++ b/tests/zfs-tests/tests/functional/ctime/Makefile.am @@ -1,13 +1,6 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/ctime dist_pkgdata_SCRIPTS = \ ctime_001_pos.ksh \ cleanup.ksh \ setup.ksh - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/ctime - -pkgexec_PROGRAMS = ctime -ctime_SOURCES = ctime.c diff --git a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh index de12efe46b..035785772d 100755 --- a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh @@ -38,7 +38,7 @@ log_note "Verify [acm]time is modified appropriately." for arg in ${args[*]}; do log_note "Testing with xattr set to $arg" log_must zfs set xattr=$arg $TESTPOOL - log_must $STF_SUITE/tests/functional/ctime/ctime + log_must ctime done log_pass "PASS" diff --git a/tests/zfs-tests/tests/functional/events/.gitignore b/tests/zfs-tests/tests/functional/events/.gitignore deleted file mode 100644 index ed5af03a10..0000000000 --- a/tests/zfs-tests/tests/functional/events/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/zed_fd_spill-zedlet diff --git a/tests/zfs-tests/tests/functional/events/Makefile.am b/tests/zfs-tests/tests/functional/events/Makefile.am index 92ce5dbc38..7d8ae61676 100644 --- a/tests/zfs-tests/tests/functional/events/Makefile.am +++ b/tests/zfs-tests/tests/functional/events/Makefile.am @@ -1,5 +1,3 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/events dist_pkgdata_SCRIPTS = \ setup.ksh \ @@ -12,7 +10,3 @@ dist_pkgdata_SCRIPTS = \ dist_pkgdata_DATA = \ events.cfg \ events_common.kshlib - -pkgexecdir = $(pkgdatadir) -pkgexec_PROGRAMS = zed_fd_spill-zedlet -zed_fd_spill_zedlet_SOURCES = zed_fd_spill-zedlet.c diff --git a/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh b/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh index 4ae136d0f3..d70dd0c7b4 100755 --- a/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh +++ b/tests/zfs-tests/tests/functional/events/zed_fd_spill.ksh @@ -48,13 +48,12 @@ logdir="$(mktemp -d)" log_must ln -s "$logdir" /tmp/zts-zed_fd_spill-logdir -self="$(readlink -f "$0")" -zedlet="${self%/*}/zed_fd_spill-zedlet" -log_must ln -s $zedlet "${ZEDLET_DIR}/all-dumpfds" +zedlet="$(command -v zed_fd_spill-zedlet)" +log_must ln -s "$zedlet" "${ZEDLET_DIR}/all-dumpfds" # zed will cry foul and refuse to run it if this isn't true -sudo chown root $zedlet -sudo chmod 700 $zedlet +sudo chown root "$zedlet" +sudo chmod 700 "$zedlet" log_must zpool events -c log_must zed_stop diff --git a/tests/zfs-tests/tests/functional/hkdf/Makefile.am b/tests/zfs-tests/tests/functional/hkdf/Makefile.am index 8ac9053223..1d126c4a90 100644 --- a/tests/zfs-tests/tests/functional/hkdf/Makefile.am +++ b/tests/zfs-tests/tests/functional/hkdf/Makefile.am @@ -1,17 +1,8 @@ include $(top_srcdir)/config/Rules.am -pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/hkdf - -dist_pkgdata_SCRIPTS = \ - setup.ksh \ - cleanup.ksh \ - run_hkdf_test.ksh - pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/hkdf -pkgexec_PROGRAMS = \ - hkdf_test - +pkgexec_PROGRAMS = hkdf_test hkdf_test_SOURCES = hkdf_test.c hkdf_test_LDADD = \ $(abs_top_builddir)/lib/libzpool/libzpool.la diff --git a/tests/zfs-tests/tests/functional/hkdf/cleanup.ksh b/tests/zfs-tests/tests/functional/hkdf/cleanup.ksh deleted file mode 100755 index 2bdca1950d..0000000000 --- a/tests/zfs-tests/tests/functional/hkdf/cleanup.ksh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/ksh - -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet at -# http://www.illumos.org/license/CDDL. -# - -# -# Copyright (c) 2017 by Datto Inc. All rights reserved. -# - -. $STF_SUITE/include/libtest.shlib - -verify_runnable "global" - -log_pass diff --git a/tests/zfs-tests/tests/functional/hkdf/run_hkdf_test.ksh b/tests/zfs-tests/tests/functional/hkdf/run_hkdf_test.ksh deleted file mode 100755 index 5fde0b837d..0000000000 --- a/tests/zfs-tests/tests/functional/hkdf/run_hkdf_test.ksh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/ksh - -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet at -# http://www.illumos.org/license/CDDL. -# - -# -# Copyright (c) 2017 by Datto Inc. All rights reserved. -# - -. $STF_SUITE/include/libtest.shlib - -# -# DESCRIPTION: -# Call the hkdf_test tool to test ZFS's HKDF implementation against -# a few test vectors. -# - -log_assert "Run the tests for the HKDF algorithm." - -log_must $STF_SUITE/tests/functional/hkdf/hkdf_test - -log_pass "HKDF tests pass." diff --git a/tests/zfs-tests/tests/functional/hkdf/setup.ksh b/tests/zfs-tests/tests/functional/hkdf/setup.ksh deleted file mode 100755 index 2bdca1950d..0000000000 --- a/tests/zfs-tests/tests/functional/hkdf/setup.ksh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/ksh - -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet at -# http://www.illumos.org/license/CDDL. -# - -# -# Copyright (c) 2017 by Datto Inc. All rights reserved. -# - -. $STF_SUITE/include/libtest.shlib - -verify_runnable "global" - -log_pass diff --git a/tests/zfs-tests/tests/functional/libzfs/Makefile.am b/tests/zfs-tests/tests/functional/libzfs/Makefile.am index 53cb635444..51482f4e63 100644 --- a/tests/zfs-tests/tests/functional/libzfs/Makefile.am +++ b/tests/zfs-tests/tests/functional/libzfs/Makefile.am @@ -1,7 +1,6 @@ include $(top_srcdir)/config/Rules.am pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/libzfs - pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/libzfs dist_pkgdata_SCRIPTS = \ @@ -9,9 +8,7 @@ dist_pkgdata_SCRIPTS = \ setup.ksh \ libzfs_input.ksh -many_fds_LDADD = \ - $(abs_top_builddir)/lib/libzfs/libzfs.la - pkgexec_PROGRAMS = many_fds many_fds_SOURCES = many_fds.c - +many_fds_LDADD = \ + $(abs_top_builddir)/lib/libzfs/libzfs.la diff --git a/tests/zfs-tests/tests/functional/suid/.gitignore b/tests/zfs-tests/tests/functional/suid/.gitignore deleted file mode 100644 index a9a3db79ba..0000000000 --- a/tests/zfs-tests/tests/functional/suid/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/suid_write_to_file diff --git a/tests/zfs-tests/tests/functional/suid/Makefile.am b/tests/zfs-tests/tests/functional/suid/Makefile.am index 0145c1205f..439b41adc7 100644 --- a/tests/zfs-tests/tests/functional/suid/Makefile.am +++ b/tests/zfs-tests/tests/functional/suid/Makefile.am @@ -1,5 +1,3 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/suid dist_pkgdata_SCRIPTS = \ @@ -10,8 +8,3 @@ dist_pkgdata_SCRIPTS = \ suid_write_zil_replay.ksh \ cleanup.ksh \ setup.ksh - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/suid - -pkgexec_PROGRAMS = suid_write_to_file -suid_write_to_file_SOURCES = suid_write_to_file.c diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh index 470350f960..907c94e3fd 100755 --- a/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh +++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_none.ksh @@ -47,6 +47,6 @@ function cleanup log_onexit cleanup log_note "Verify write(2) to regular file by non-owner" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "NONE" "PRECRASH" +log_must suid_write_to_file "NONE" "PRECRASH" log_pass "Verify write(2) to regular file by non-owner passed" diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh index 3c95a40265..4554bc3c00 100755 --- a/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh +++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_sgid.ksh @@ -47,6 +47,6 @@ function cleanup log_onexit cleanup log_note "Verify write(2) to SGID file by non-owner" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SGID" "PRECRASH" +log_must suid_write_to_file "SGID" "PRECRASH" log_pass "Verify write(2) to SGID file by non-owner passed" diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh index 4183cbeefc..541e1125d5 100755 --- a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh +++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid.ksh @@ -47,6 +47,6 @@ function cleanup log_onexit cleanup log_note "Verify write(2) to SUID file by non-owner" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID" "PRECRASH" +log_must suid_write_to_file "SUID" "PRECRASH" log_pass "Verify write(2) to SUID file by non-owner passed" diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh index f7a08a55fc..57361d2e39 100755 --- a/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh +++ b/tests/zfs-tests/tests/functional/suid/suid_write_to_suid_sgid.ksh @@ -47,6 +47,6 @@ function cleanup log_onexit cleanup log_note "Verify write(2) to SUID/SGID file by non-owner" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID_SGID" "PRECRASH" +log_must suid_write_to_file "SUID_SGID" "PRECRASH" log_pass "Verify write(2) to SUID/SGID file by non-owner passed" diff --git a/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh b/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh index 81f431f6b6..8843e67da2 100755 --- a/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh +++ b/tests/zfs-tests/tests/functional/suid/suid_write_zil_replay.ksh @@ -65,10 +65,10 @@ log_must zpool freeze $TESTPOOL # # 3. Unprivileged write to a setuid file # -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "NONE" "PRECRASH" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID" "PRECRASH" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SGID" "PRECRASH" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID_SGID" "PRECRASH" +log_must suid_write_to_file "NONE" "PRECRASH" +log_must suid_write_to_file "SUID" "PRECRASH" +log_must suid_write_to_file "SGID" "PRECRASH" +log_must suid_write_to_file "SUID_SGID" "PRECRASH" # # 4. Unmount filesystem and export the pool @@ -91,9 +91,9 @@ log_must zpool export $TESTPOOL # log_must zpool import -f -d $VDIR $TESTPOOL -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "NONE" "REPLAY" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID" "REPLAY" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SGID" "REPLAY" -log_must $STF_SUITE/tests/functional/suid/suid_write_to_file "SUID_SGID" "REPLAY" +log_must suid_write_to_file "NONE" "REPLAY" +log_must suid_write_to_file "SUID" "REPLAY" +log_must suid_write_to_file "SGID" "REPLAY" +log_must suid_write_to_file "SUID_SGID" "REPLAY" log_pass diff --git a/tests/zfs-tests/tests/functional/truncate/.gitignore b/tests/zfs-tests/tests/functional/truncate/.gitignore deleted file mode 100644 index f28d93573c..0000000000 --- a/tests/zfs-tests/tests/functional/truncate/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/truncate_test diff --git a/tests/zfs-tests/tests/functional/truncate/Makefile.am b/tests/zfs-tests/tests/functional/truncate/Makefile.am index b2d804b5d4..14a2b301f1 100644 --- a/tests/zfs-tests/tests/functional/truncate/Makefile.am +++ b/tests/zfs-tests/tests/functional/truncate/Makefile.am @@ -1,5 +1,3 @@ -include $(top_srcdir)/config/Rules.am - pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/truncate dist_pkgdata_SCRIPTS = \ @@ -11,8 +9,3 @@ dist_pkgdata_SCRIPTS = \ dist_pkgdata_DATA = \ truncate.cfg - -pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/truncate - -pkgexec_PROGRAMS = truncate_test -truncate_test_SOURCES = truncate_test.c diff --git a/tests/zfs-tests/tests/functional/truncate/truncate_timestamps.ksh b/tests/zfs-tests/tests/functional/truncate/truncate_timestamps.ksh index 27b28e82eb..3793178701 100755 --- a/tests/zfs-tests/tests/functional/truncate/truncate_timestamps.ksh +++ b/tests/zfs-tests/tests/functional/truncate/truncate_timestamps.ksh @@ -42,7 +42,7 @@ function verify_truncate #