From 74b4d349b3740cf654f762e4afe1e51afc9febb8 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Wed, 29 Jan 2020 14:23:20 -0500 Subject: [PATCH] ZTS: Reverse constrained path lookup order FreeBSD base system zfs utils are in /sbin. ZoF utils install to /usr/local/sbin. Ensure we link to the ZoF utils not the base utils when searching for utils to constrain paths to for the tests. Reviewed-by: John Kennedy Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #9906 --- scripts/zfs-tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh index ca680953e..e1e114128 100755 --- a/scripts/zfs-tests.sh +++ b/scripts/zfs-tests.sh @@ -239,8 +239,11 @@ create_links() { constrain_path() { . "$STF_SUITE/include/commands.cfg" - SYSTEM_DIRS="/bin /sbin /usr/bin /usr/sbin" - SYSTEM_DIRS+=" /usr/local/bin /usr/local/sbin" + # On FreeBSD, base system zfs utils are in /sbin and OpenZFS utils + # install to /usr/local/sbin. To avoid testing the wrong utils we + # need /usr/local to come before / in the path search order. + SYSTEM_DIRS="/usr/local/bin /usr/local/sbin" + SYSTEM_DIRS+=" /usr/bin /usr/sbin /bin /sbin" if [ "$INTREE" = "yes" ]; then # Constrained path set to ./zfs/bin/