summaryrefslogtreecommitdiff
path: root/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh')
-rw-r--r--usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
index 3d53ef5fae..527c89163f 100644
--- a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
+++ b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
@@ -14,8 +14,10 @@
#
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2019 Joyent, Inc.
# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2022 MNX Cloud, Inc.
#
export PATH="/usr/bin"
@@ -72,6 +74,8 @@ function find_runfile
distro=openindiana
elif [[ 0 -ne $(grep -c OmniOS /etc/release 2>/dev/null) ]]; then
distro=omnios
+ elif [[ 0 -ne $(grep -c SmartOS /etc/release 2>/dev/null) ]]; then
+ distro=smartos
fi
[[ -n $distro ]] && echo $COMMON,$STF_SUITE/runfiles/$distro.run
@@ -128,6 +132,18 @@ function constrain_path
# Special case links
ln -s /usr/gnu/bin/dd $PATHDIR/gnu_dd
+
+ # SmartOS does not ship some required commands by default.
+ # Link to them in the package manager's namespace.
+ pkgsrc_bin=/opt/tools/bin
+ pkgsrc_packages="sudo truncate python base64 shuf sha256sum"
+ for pkg in $pkgsrc_packages; do
+ if [[ ! -x $PATHDIR/$pkg ]]; then
+ rm $PATHDIR/$pkg &&
+ ln -s $pkgsrc_bin/$pkg $PATHDIR/$pkg ||
+ fail "Couldn't link $pkg"
+ fi
+ done
}
constrain_path