summaryrefslogtreecommitdiff
path: root/habitat
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-08-25 16:30:31 -0700
committerPete Higgins <pete@peterhiggins.org>2020-08-25 17:46:59 -0700
commit19984934bf5eb1f3e4afe80705f1c4b0dc085529 (patch)
tree856eab08aacdee5b5d117f97cd5b23f9ffe1fdc2 /habitat
parente11e3e01b0749d0355c39f2625b4d106523b79d1 (diff)
downloadchef-19984934bf5eb1f3e4afe80705f1c4b0dc085529.tar.gz
Fix hab testing script.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
Diffstat (limited to 'habitat')
-rwxr-xr-xhabitat/tests/test.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh
index 0882313c8e..2fcd7dafd5 100755
--- a/habitat/tests/test.sh
+++ b/habitat/tests/test.sh
@@ -4,6 +4,7 @@ set -euo pipefail
export CHEF_LICENSE="accept-no-persist"
export HAB_LICENSE="accept-no-persist"
+export HAB_NONINTERACTIVE="true"
project_root="$(git rev-parse --show-toplevel)"
pkg_ident="$1"
@@ -24,11 +25,12 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident")
cd "${project_root}"
echo "--- :mag_right: Testing ${pkg_ident} executables"
-[[ "$package_version" = "$(hab pkg exec "${pkg_ident}" chef-client --version | sed 's/.*: //')" ]] || error "chef-client is not the expected version"
+actual_version=$(hab pkg exec "${pkg_ident}" chef-client -- --version | sed 's/.*: //')
+[[ "$package_version" = "$actual_version" ]] || error "chef-client is not the expected version. Expected '$package_version', got '$actual_version'"
for executable in 'chef-client' 'ohai' 'chef-shell' 'chef-apply' 'knife' 'chef-solo'; do
echo -en "\t$executable = "
- hab pkg exec "${pkg_ident}" "${executable}" --version || error "${executable} failed to execute properly"
+ hab pkg exec "${pkg_ident}" "${executable}" -- --version || error "${executable} failed to execute properly"
done
echo "--- :mag_right: Testing ${pkg_ident} functionality"