From 60efc85006c208f44ebb1679255c73f064d1c775 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 12:54:26 +0530 Subject: [PATCH 1/7] Bundle knife plugins for Habitat package Signed-off-by: Ashique Saidalavi --- .github/workflows/gem_tests.yml | 1 + .github/workflows/lint.yml | 2 +- .github/workflows/unit_specs.yml | 1 + Gemfile | 6 ++ Gemfile.lock | 107 ++++++++++++++++++++++++++++++- habitat/plan.ps1 | 1 + habitat/plan.sh | 1 + habitat/tests/test.ps1 | 8 +++ habitat/tests/test.sh | 7 ++ 9 files changed, 130 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gem_tests.yml b/.github/workflows/gem_tests.yml index aaa0f32f..28ff33cd 100644 --- a/.github/workflows/gem_tests.yml +++ b/.github/workflows/gem_tests.yml @@ -17,6 +17,7 @@ concurrency: env: CHEF_LICENSE: accept-no-persist FORCE_FFI_YAJL: ext + BUNDLE_WITHOUT: habitat jobs: knife-windows: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2149beb6..a835306a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: cookstyle: runs-on: ubuntu-latest env: - BUNDLE_WITHOUT: ruby_shadow:packaging + BUNDLE_WITHOUT: ruby_shadow:packaging:habitat steps: - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/unit_specs.yml b/.github/workflows/unit_specs.yml index bc520ab0..55e95e66 100644 --- a/.github/workflows/unit_specs.yml +++ b/.github/workflows/unit_specs.yml @@ -17,6 +17,7 @@ concurrency: env: CHEF_LICENSE: accept-no-persist FORCE_FFI_YAJL: ext + BUNDLE_WITHOUT: habitat jobs: unit: diff --git a/Gemfile b/Gemfile index a3176408..34bb70d3 100644 --- a/Gemfile +++ b/Gemfile @@ -41,3 +41,9 @@ group :omnibus_package, :pry do gem "pry-byebug" gem "pry-stack_explorer" end + +group :habitat do + gem 'knife-ec2', '~> 2.2.0' + gem 'knife-google', '~> 5.0.15' + gem 'knife-windows', '~> 5.0.7' +end diff --git a/Gemfile.lock b/Gemfile.lock index cc5dff89..589e2520 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - knife (19.0.117) + knife (19.0.128) abbrev bcrypt_pbkdf (~> 1.1) chef-licensing (~> 1.2) @@ -28,12 +28,25 @@ GEM remote: https://rubygems.org/ specs: abbrev (0.1.2) + activesupport (8.1.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) aws-eventstream (1.4.0) aws-partitions (1.1235.0) - aws-sdk-core (3.244.0) + aws-sdk-core (3.252.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -41,6 +54,9 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger + aws-sdk-ec2 (1.624.0) + aws-sdk-core (~> 3, >= 3.248.0) + aws-sigv4 (~> 1.5) aws-sdk-kms (1.123.0) aws-sdk-core (~> 3, >= 3.244.0) aws-sigv4 (~> 1.5) @@ -167,6 +183,7 @@ GEM net-ssh coderay (1.1.3) concurrent-ruby (1.3.6) + connection_pool (3.0.2) cookstyle (8.6.10) rubocop (= 1.84.2) corefoundation (0.3.13) @@ -177,11 +194,15 @@ GEM csv (3.3.5) date (3.5.1) debug_inspector (1.2.0) + declarative (0.0.20) diff-lcs (1.6.2) domain_name (0.6.20240107) + drb (2.2.3) ed25519 (1.4.0) erubi (1.13.1) erubis (2.7.0) + excon (1.5.0) + logger faraday (2.14.2) faraday-net_http (>= 2.0, < 3.5) json @@ -208,6 +229,40 @@ GEM ffi-yajl (2.7.11) libyajl2 (>= 2.1) fuzzyurl (0.9.0) + gcewinpass (1.1.0) + google-api-client (~> 0.13) + gems (1.3.0) + google-api-client (0.53.0) + google-apis-core (~> 0.1) + google-apis-generator (~> 0.1) + google-apis-core (0.18.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (~> 1.9) + httpclient (>= 2.8.3, < 3.a) + mini_mime (~> 1.0) + mutex_m + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + google-apis-discovery_v1 (0.21.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-generator (0.19.0) + activesupport (>= 5.0) + gems (~> 1.2) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-discovery_v1 (~> 0.18) + thor (>= 0.20, < 2.a) + google-cloud-env (2.3.1) + base64 (~> 0.2) + faraday (>= 1.0, < 3.a) + google-logging-utils (0.2.0) + googleauth (1.17.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + jwt (>= 1.4, < 4.0) + os (>= 0.9, < 2.0) + pstore (~> 0.1) + signet (>= 0.16, < 2.a) gssapi (1.3.1) ffi (>= 1.0.1) hashdiff (1.2.1) @@ -220,6 +275,8 @@ GEM domain_name (~> 0.5) httpclient (2.9.0) mutex_m + i18n (1.15.1) + concurrent-ruby (~> 1.0) iniparse (1.5.0) inspec-core (7.0.107) addressable (~> 2.4) @@ -253,6 +310,28 @@ GEM ipaddress (0.8.3) jmespath (1.6.2) json (2.19.9) + jwt (3.2.0) + base64 + knife-cloud (4.0.15) + chef (>= 15.11) + excon (>= 0.50) + mixlib-shellout + knife-ec2 (2.2.0) + abbrev (~> 0.1) + aws-sdk-ec2 (~> 1.95) + aws-sdk-s3 (~> 1.43) + knife (>= 18.0) + syslog (~> 0.3) + knife-google (5.0.15) + gcewinpass (~> 1.1) + google-api-client (>= 0.23.9, <= 0.53.0) + knife (>= 18.0) + knife-cloud (>= 4.0.0) + syslog (~> 0.3) + knife-windows (5.0.7) + chef (>= 18.2) + chef-winrm (~> 2.3) + chef-winrm-elevated (~> 1.2) language_server-protocol (3.17.0.5) libyajl2 (2.1.0) license-acceptance (2.1.13) @@ -271,6 +350,10 @@ GEM logger mime-types-data (~> 3.2025, >= 3.2025.0507) mime-types-data (3.2026.0331) + mini_mime (1.1.5) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) mixlib-archive (1.3.3) mixlib-log mixlib-authentication (3.0.10) @@ -318,6 +401,7 @@ GEM plist (~> 3.1) train-core wmi-lite (~> 1.0) + os (1.1.4) ostruct (0.6.3) parallel (1.28.0) parser (3.3.11.1) @@ -350,11 +434,16 @@ GEM regexp_parser (2.12.0) reline (0.6.3) io-console (~> 0.5) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + retriable (3.8.0) rexml (3.4.4) rspec (3.13.2) rspec-core (~> 3.13.0) @@ -390,7 +479,12 @@ GEM rubyntlm (0.6.5) base64 rubyzip (2.4.1) + securerandom (0.4.1) semverse (3.0.2) + signet (0.22.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 4.0) socksify (1.8.1) sslshake (1.3.1) strings (0.2.1) @@ -406,6 +500,7 @@ GEM date timeout (0.6.1) tomlrb (1.3.0) + trailblazer-option (0.1.2) train-core (3.16.5) addressable (~> 2.5) ffi (>= 1.16.0, < 1.18) @@ -442,6 +537,9 @@ GEM pastel (~> 0.8) strings (~> 0.2.0) tty-screen (~> 0.8) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uber (0.1.0) unf_ext (0.0.9.1) unicode-display_width (2.6.0) unicode_utils (1.4.0) @@ -480,6 +578,9 @@ DEPENDENCIES crack (< 1.0.2) csv knife! + knife-ec2 (~> 2.2.0) + knife-google (~> 5.0.15) + knife-windows (~> 5.0.7) libyajl2 (>= 2.1) mixlib-authentication (= 3.0.10) ohai (>= 19.1) @@ -494,4 +595,4 @@ DEPENDENCIES webmock BUNDLED WITH - 2.6.6 + 2.6.9 diff --git a/habitat/plan.ps1 b/habitat/plan.ps1 index 5c5b4083..00a2fe1c 100644 --- a/habitat/plan.ps1 +++ b/habitat/plan.ps1 @@ -43,6 +43,7 @@ function Invoke-Build { Write-BuildLine " ** Configuring bundler for this build environment" bundle config --local without integration deploy maintenance development omnibus_package test + bundle config --local with habitat bundle config --local jobs 4 bundle config --local retry 5 bundle config --local silence_root_warning 1 diff --git a/habitat/plan.sh b/habitat/plan.sh index 3b889c0e..2902d433 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -73,6 +73,7 @@ do_build() { pushd "$HAB_CACHE_SRC_PATH/$pkg_dirname" bundle config set --local path "$GEM_HOME" bundle config --local without integration deploy maintenance development omnibus_package test + bundle config --local with habitat bundle config --local jobs 4 bundle config --local retry 5 bundle config --local silence_root_warning 1 diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index 58bef6c8..394b9524 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -26,3 +26,11 @@ Write-Output $actual_version if ($actual_version -notlike "*$package_version*") { Error "knife version is not the expected version. Expected '$package_version', got '$actual_version'" } + +Write-Output "Verifying bundled knife plugins are available" +foreach ($plugin in @("ec2", "google", "windows")) { + & hab pkg exec $pkg_ident knife $plugin --help *> $null + if ($LASTEXITCODE -ne 0) { + Error "knife plugin '$plugin' is not available in package '$pkg_ident'" + } +} diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 809f80b7..c829e3cf 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -27,3 +27,10 @@ echo $actual_version if [[ "$actual_version" != *"$package_version"* ]]; then error "knife version is not the expected version. Expected '$package_version', got '$actual_version'" fi + +echo "Verifying bundled knife plugins are available" +for plugin in "ec2" "google" "windows"; do + if ! hab pkg exec "${pkg_ident}" knife "${plugin}" --help >/dev/null 2>&1; then + error "knife plugin '${plugin}' is not available in package '${pkg_ident}'" + fi +done From ec5a3db683a766acbb255750d97cecde35fb336b Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 15:27:49 +0530 Subject: [PATCH 2/7] Fixed the habitat tests Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 10 +++++++--- habitat/tests/test.sh | 12 +++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index 394b9524..3c75a690 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -28,9 +28,13 @@ if ($actual_version -notlike "*$package_version*") { } Write-Output "Verifying bundled knife plugins are available" -foreach ($plugin in @("ec2", "google", "windows")) { - & hab pkg exec $pkg_ident knife $plugin --help *> $null +foreach ($pluginCommand in @( + @("ec2", "server", "list"), + @("google", "server", "list"), + @("winrm") +)) { + & hab pkg exec $pkg_ident knife @pluginCommand --help *> $null if ($LASTEXITCODE -ne 0) { - Error "knife plugin '$plugin' is not available in package '$pkg_ident'" + Error "knife plugin command '$($pluginCommand -join ' ')' is not available in package '$pkg_ident'" } } diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index c829e3cf..0c11dbad 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -29,8 +29,14 @@ if [[ "$actual_version" != *"$package_version"* ]]; then fi echo "Verifying bundled knife plugins are available" -for plugin in "ec2" "google" "windows"; do - if ! hab pkg exec "${pkg_ident}" knife "${plugin}" --help >/dev/null 2>&1; then - error "knife plugin '${plugin}' is not available in package '${pkg_ident}'" +plugin_commands=( + "ec2 server list" + "google server list" + "winrm" +) + +for plugin_command in "${plugin_commands[@]}"; do + if ! hab pkg exec "${pkg_ident}" knife ${plugin_command} --help >/dev/null 2>&1; then + error "knife plugin command '${plugin_command}' is not available in package '${pkg_ident}'" fi done From 0c5906c6538f5f6678d60e2d6c65466ee93d2bc8 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 16:52:35 +0530 Subject: [PATCH 3/7] Fix Habitat test plugin command assertions to use actual working subcommands Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 17 ++++++++++------- habitat/tests/test.sh | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index 3c75a690..e0614c23 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -28,13 +28,16 @@ if ($actual_version -notlike "*$package_version*") { } Write-Output "Verifying bundled knife plugins are available" -foreach ($pluginCommand in @( - @("ec2", "server", "list"), - @("google", "server", "list"), - @("winrm") -)) { - & hab pkg exec $pkg_ident knife @pluginCommand --help *> $null +$plugin_commands = @( + "ec2 server list", + "google server list", + "windows bootstrap" +) + +foreach ($plugin_command in $plugin_commands) { + & hab pkg exec $pkg_ident knife $plugin_command --help *> $null if ($LASTEXITCODE -ne 0) { - Error "knife plugin command '$($pluginCommand -join ' ')' is not available in package '$pkg_ident'" + Error "knife plugin command '$plugin_command' is not available in package '$pkg_ident'" } } +Write-Output "All bundled plugins verified successfully" diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 0c11dbad..5953860b 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -32,7 +32,7 @@ echo "Verifying bundled knife plugins are available" plugin_commands=( "ec2 server list" "google server list" - "winrm" + "windows bootstrap" ) for plugin_command in "${plugin_commands[@]}"; do @@ -40,3 +40,4 @@ for plugin_command in "${plugin_commands[@]}"; do error "knife plugin command '${plugin_command}' is not available in package '${pkg_ident}'" fi done +echo "All bundled plugins verified successfully" From 62abe15e085934bab966968c7ba8fd33c01d008e Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 16:56:56 +0530 Subject: [PATCH 4/7] Wrap knife commands in bash/powershell subshell for proper argument passing in hab pkg exec Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 5 +++-- habitat/tests/test.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index e0614c23..5e6acd14 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -35,9 +35,10 @@ $plugin_commands = @( ) foreach ($plugin_command in $plugin_commands) { - & hab pkg exec $pkg_ident knife $plugin_command --help *> $null + & hab pkg exec $pkg_ident powershell -Command "knife $plugin_command --help" *> $null if ($LASTEXITCODE -ne 0) { - Error "knife plugin command '$plugin_command' is not available in package '$pkg_ident'" + Write-Error "knife plugin command '$plugin_command' is not available in package '$pkg_ident'" + exit 1 } } Write-Output "All bundled plugins verified successfully" diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 5953860b..ecb8af7c 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -36,8 +36,9 @@ plugin_commands=( ) for plugin_command in "${plugin_commands[@]}"; do - if ! hab pkg exec "${pkg_ident}" knife ${plugin_command} --help >/dev/null 2>&1; then - error "knife plugin command '${plugin_command}' is not available in package '${pkg_ident}'" + if ! hab pkg exec "${pkg_ident}" bash -c "knife ${plugin_command} --help" >/dev/null 2>&1; then + echo -e "\nERROR: knife plugin command '${plugin_command}' is not available in package '${pkg_ident}'\n" >&2 + exit 1 fi done echo "All bundled plugins verified successfully" From 8dcfbf77f866942ee4a4ccca61713011a08ba972 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 17:03:24 +0530 Subject: [PATCH 5/7] Check for plugin presence by verifying subcommand help output instead of running actual commands Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 18 ++++++++++-------- habitat/tests/test.sh | 20 +++++++++++++------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index 5e6acd14..c99db080 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -28,16 +28,18 @@ if ($actual_version -notlike "*$package_version*") { } Write-Output "Verifying bundled knife plugins are available" -$plugin_commands = @( - "ec2 server list", - "google server list", - "windows bootstrap" +$plugin_checks = @( + @{name = "ec2"; pattern = "Available ec2 subcommands"}, + @{name = "google"; pattern = "Available google subcommands"}, + @{name = "windows"; pattern = "Available windows subcommands"} ) -foreach ($plugin_command in $plugin_commands) { - & hab pkg exec $pkg_ident powershell -Command "knife $plugin_command --help" *> $null - if ($LASTEXITCODE -ne 0) { - Write-Error "knife plugin command '$plugin_command' is not available in package '$pkg_ident'" +foreach ($check in $plugin_checks) { + $output = & hab pkg exec $pkg_ident powershell -Command "knife $($check.name) 2>&1" 2>&1 | Out-String + if ($output -match $check.pattern) { + Write-Output "✓ Plugin '$($check.name)' is available" + } else { + Write-Error "knife plugin '$($check.name)' is not available in package '$pkg_ident'" exit 1 } } diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index ecb8af7c..243a0b10 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -29,15 +29,21 @@ if [[ "$actual_version" != *"$package_version"* ]]; then fi echo "Verifying bundled knife plugins are available" -plugin_commands=( - "ec2 server list" - "google server list" - "windows bootstrap" +plugin_checks=( + "ec2:Available ec2 subcommands" + "google:Available google subcommands" + "windows:Available windows subcommands" ) -for plugin_command in "${plugin_commands[@]}"; do - if ! hab pkg exec "${pkg_ident}" bash -c "knife ${plugin_command} --help" >/dev/null 2>&1; then - echo -e "\nERROR: knife plugin command '${plugin_command}' is not available in package '${pkg_ident}'\n" >&2 +for plugin_check in "${plugin_checks[@]}"; do + plugin_name="${plugin_check%%:*}" + expected_output="${plugin_check#*:}" + + output=$(hab pkg exec "${pkg_ident}" bash -c "knife ${plugin_name} 2>&1" || true) + if echo "${output}" | grep -q "${expected_output}"; then + echo "✓ Plugin '${plugin_name}' is available" + else + echo -e "\nERROR: knife plugin '${plugin_name}' is not available in package '${pkg_ident}'\n" >&2 exit 1 fi done From ceca38b5aadc59d4b41a32ee3383a170444a669a Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 18:15:34 +0530 Subject: [PATCH 6/7] Fix Windows habitat test parsing by using ASCII plugin status output Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 2 +- habitat/tests/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index c99db080..5c853ed1 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -37,7 +37,7 @@ $plugin_checks = @( foreach ($check in $plugin_checks) { $output = & hab pkg exec $pkg_ident powershell -Command "knife $($check.name) 2>&1" 2>&1 | Out-String if ($output -match $check.pattern) { - Write-Output "✓ Plugin '$($check.name)' is available" + Write-Output "Plugin '$($check.name)' is available" } else { Write-Error "knife plugin '$($check.name)' is not available in package '$pkg_ident'" exit 1 diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 243a0b10..da056e87 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -41,7 +41,7 @@ for plugin_check in "${plugin_checks[@]}"; do output=$(hab pkg exec "${pkg_ident}" bash -c "knife ${plugin_name} 2>&1" || true) if echo "${output}" | grep -q "${expected_output}"; then - echo "✓ Plugin '${plugin_name}' is available" + echo "Plugin '${plugin_name}' is available" else echo -e "\nERROR: knife plugin '${plugin_name}' is not available in package '${pkg_ident}'\n" >&2 exit 1 From 80f103722bf4ae7f4538e854255440326649f661 Mon Sep 17 00:00:00 2001 From: Ashique Saidalavi Date: Fri, 19 Jun 2026 19:15:17 +0530 Subject: [PATCH 7/7] Tolerate expected knife plugin probe failures in Windows Habitat test Signed-off-by: Ashique Saidalavi --- habitat/tests/test.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/habitat/tests/test.ps1 b/habitat/tests/test.ps1 index 5c853ed1..1f88c0e4 100644 --- a/habitat/tests/test.ps1 +++ b/habitat/tests/test.ps1 @@ -35,7 +35,10 @@ $plugin_checks = @( ) foreach ($check in $plugin_checks) { - $output = & hab pkg exec $pkg_ident powershell -Command "knife $($check.name) 2>&1" 2>&1 | Out-String + $output = & { + $ErrorActionPreference = "Continue" + & hab pkg exec $pkg_ident knife $($check.name) 2>&1 + } | Out-String if ($output -match $check.pattern) { Write-Output "Plugin '$($check.name)' is available" } else {