From ab24877bd3459c84a9220a06acbbbfbb337e59a9 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Tue, 12 Jun 2018 10:42:26 -0700 Subject: [PATCH] ZTS: deletes home directories in /export/home In the cleanup for the privilege tests, an empty variable, empty because the corresponding setup is skipped on Linux, results in /export/home being deleted. This patch adds an assertion that the variable is not empty, and causes the cleanup to be skipped on Linux as well. Reviewed by: John Wren Kennedy Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Reviewed-by: Paul Dagnelie Signed-off-by: John Gallagher External-issue: LX-1099 Closes #7615 --- tests/zfs-tests/tests/functional/privilege/cleanup.ksh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/zfs-tests/tests/functional/privilege/cleanup.ksh b/tests/zfs-tests/tests/functional/privilege/cleanup.ksh index b7a1e419f..5d3ec7b85 100755 --- a/tests/zfs-tests/tests/functional/privilege/cleanup.ksh +++ b/tests/zfs-tests/tests/functional/privilege/cleanup.ksh @@ -31,9 +31,15 @@ . $STF_SUITE/include/libtest.shlib +if is_linux; then + log_unsupported "Privilege tests require pfexec command" +fi + verify_runnable "global" ZFS_USER=$(cat /tmp/zfs-privs-test-user.txt) +[[ -z $ZFS_USER ]] && log_fail "no ZFS_USER found" + USES_NIS=$(cat /tmp/zfs-privs-test-nis.txt) if [ "${USES_NIS}" == "true" ]