diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 3aead886..e9d7438c 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -21,8 +21,10 @@ cd "${project_root}" echo "Testing ${pkg_ident} executables" version=$(hab pkg exec "${pkg_ident}" chef-cli -v) echo $version -actual_version=$(echo "$version" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +actual_version=$(echo "$version" | grep -Po ([0-9]+\.[0-9]+\.[0-9]+)) echo $actual_version -[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" +if [[ "$actual_version" != *"$package_version"* ]]; then + error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" +fi diff --git a/s.sh b/s.sh index cb1fc73e..a5c91537 100755 --- a/s.sh +++ b/s.sh @@ -3,3 +3,12 @@ version=$(hab pkg exec "${pkg_ident}" chef-cli -v) echo $version actual_version=$(echo "[2024-12-06T07:35:58+00:00] WARN: Please install an English UTF-8 locale for Chef Infra Client to use, falling back to C locale and disabling UTF-8 support. Chef CLI version: 5.6.15" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') echo $actual_version + + + +STR='[2024-12-06T09:05:46+00:00] WARN: Please install an English UTF-8 locale for Chef Infra Client to use, falling back to C locale and disabling UTF-8 support. 5.6.15' +SUB='5.6.15' +if [[ "$STR" != *"$SUB"* ]]; then + error "rIt's there." +fi +