summaryrefslogtreecommitdiff
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
parente11e3e01b0749d0355c39f2625b4d106523b79d1 (diff)
downloadchef-19984934bf5eb1f3e4afe80705f1c4b0dc085529.tar.gz
Fix hab testing script.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--.expeditor/verify.pipeline.yml7
-rwxr-xr-xhabitat/tests/test.sh6
-rwxr-xr-xscripts/ci/install-hab.sh1
-rwxr-xr-xscripts/ci/verify-plan.sh1
4 files changed, 6 insertions, 9 deletions
diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml
index c64a203c40..34a2dee47d 100644
--- a/.expeditor/verify.pipeline.yml
+++ b/.expeditor/verify.pipeline.yml
@@ -590,9 +590,6 @@ steps:
linux:
privileged: true
single-use: true
- environment:
- - HAB_NONINTERACTIVE=true
-
- label: ":habicat: Linux plan (kernel2)"
commands:
@@ -604,8 +601,6 @@ steps:
linux:
privileged: true
single-use: true
- environment:
- - HAB_NONINTERACTIVE=true
- label: ":habicat: Windows plan"
commands:
@@ -616,5 +611,3 @@ steps:
privileged: true
single-use: true
shell: ["powershell", "-Command"]
- environment:
- - HAB_NONINTERACTIVE=true
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"
diff --git a/scripts/ci/install-hab.sh b/scripts/ci/install-hab.sh
index b65a89d706..75e910bfab 100755
--- a/scripts/ci/install-hab.sh
+++ b/scripts/ci/install-hab.sh
@@ -3,6 +3,7 @@
set -euo pipefail
export HAB_LICENSE="accept"
+export HAB_NONINTERACTIVE="true"
hab_target="$1"
diff --git a/scripts/ci/verify-plan.sh b/scripts/ci/verify-plan.sh
index 71aac8d767..b207334267 100755
--- a/scripts/ci/verify-plan.sh
+++ b/scripts/ci/verify-plan.sh
@@ -6,6 +6,7 @@ export HAB_ORIGIN='ci'
export PLAN='chef-infra-client'
export CHEF_LICENSE="accept-no-persist"
export HAB_LICENSE="accept-no-persist"
+export HAB_NONINTERACTIVE="true"
# print error message followed by usage and exit
error () {