From 6fe075dcb97e56d7e6371fc3ffb3cf1b8ed8d4ae Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 12:49:03 +0530 Subject: [PATCH 01/25] Testing pipleine Signed-off-by: nitin sanghi --- .expeditor/habitat-test.pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 98d8b936..458d09ea 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -7,6 +7,7 @@ expeditor: automatic: limit: 1 + steps: - label: ":linux: Validate Habitat Builds of Chef-cli" From 28840e8914936ba9e53241ff1579e5d8b9418e96 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 13:03:01 +0530 Subject: [PATCH 02/25] Testing pipleine Signed-off-by: nitin sanghi --- .expeditor/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 29da699e..bc11f923 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -12,6 +12,8 @@ rubygems: release_branches: - workstation-LTS: version_constraint: 5.* + - main: + version_constraint: 5.* github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true From 6cbc98ea9788e18a01006668a60600f9ce300164 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 13:25:00 +0530 Subject: [PATCH 03/25] Testing pipleine Signed-off-by: nitin sanghi --- .expeditor/habitat-test.pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 458d09ea..a8636693 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -12,7 +12,7 @@ steps: - label: ":linux: Validate Habitat Builds of Chef-cli" commands: - - habitat/tests/test.sh + - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: docker: From 17a76a705654ff5436070fd85c308be30ad4fba9 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 13:43:25 +0530 Subject: [PATCH 04/25] Path change for test file Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.ps1 | 2 +- habitat/tests/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index adeb59f6..209c4c83 100755 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -78,7 +78,7 @@ Push-Location $project_root try { Write-Host "Running unit tests..." - /habitat/tests/test.ps1 $pkg_ident + habitat/tests/test.ps1 $pkg_ident } finally { # Ensure we always return to the original directory diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 72e288a4..757f5114 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -21,6 +21,6 @@ cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') -[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" +[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version ${pkg_ident}. Expected '$package_version', got '$actual_version'" From fe9ba195be6ed0c2cdf2561a3ef42bf5853bb750 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 14:15:44 +0530 Subject: [PATCH 05/25] adding locales Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 757f5114..8e3ad492 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -18,7 +18,7 @@ error () { package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" - +dpkg-reconfigure locales echo "--- :mag_right: Testing ${pkg_ident} executables" actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version ${pkg_ident}. Expected '$package_version', got '$actual_version'" From 430767dba018e758c25541d01ff778b666a94d20 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 16:44:57 +0530 Subject: [PATCH 06/25] adding locales Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 8e3ad492..680ecf4a 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -18,9 +18,8 @@ error () { package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" -dpkg-reconfigure locales echo "--- :mag_right: Testing ${pkg_ident} executables" actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') -[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version ${pkg_ident}. Expected '$package_version', got '$actual_version'" +[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 9fe63ca83cf3addeecc007719f3b3b8965e69b17 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 17:03:22 +0530 Subject: [PATCH 07/25] adding locales Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 680ecf4a..89edeae1 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -16,6 +16,7 @@ error () { [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") +echo en_US.UTF-8 UTF-8 >> /var/lib/locales/supported.d/local cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" From 0c162277fbca9b185a0ef73ed2fe3c0376829c9d Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 18:26:30 +0530 Subject: [PATCH 08/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 1 + habitat/tests/test.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 6ded1be3..f0b4d283 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,6 +54,7 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi +sudo apt install locales-all echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 89edeae1..680ecf4a 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -16,7 +16,6 @@ error () { [[ -n "$pkg_ident" ]] || error 'no hab package identity provided' package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") -echo en_US.UTF-8 UTF-8 >> /var/lib/locales/supported.d/local cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" From 78370b822f2ad79e04febc04d11fc190ddcc247e Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 18:31:59 +0530 Subject: [PATCH 09/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index f0b4d283..71cc3b5c 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,7 +54,7 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi -sudo apt install locales-all +dnf --assumeyes install glibc-all-langpacks echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" From 6912735623173b9c44dbecc880b6f93b711e4fe1 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 18:32:16 +0530 Subject: [PATCH 10/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 71cc3b5c..04a968e4 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,7 +54,7 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi -dnf --assumeyes install glibc-all-langpacks +sudo yum install locales-all echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" From df8d347f42cc6accbfedbd48dfc207b8c568bc5f Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 18:45:02 +0530 Subject: [PATCH 11/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 04a968e4..e6182019 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,7 +54,7 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi -sudo yum install locales-all +yum install locales-all echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" From de6bb9a691c41ea8135d59219f282c9402fad278 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 18:57:50 +0530 Subject: [PATCH 12/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index e6182019..5cab67c7 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,7 +54,7 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi -yum install locales-all +dnf --assumeyes install glibc-all-langpacks echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" From 8bb38ed5cd2b6128b52eb78035459cdf94e9a573 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 19:14:25 +0530 Subject: [PATCH 13/25] adding locales Signed-off-by: nitin sanghi --- .expeditor/buildkite/artifact.habitat.test.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 5cab67c7..fb195d1d 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,8 +54,6 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi -dnf --assumeyes install glibc-all-langpacks - echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" echo $project_root From 0e502a06236cfe0911644fb5699c2f4a0f60bef4 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Thu, 5 Dec 2024 19:34:36 +0530 Subject: [PATCH 14/25] adding locales Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 680ecf4a..70485899 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -19,7 +19,7 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" -actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*support ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 38223c6c57c9fe58ae2873c8771fe85cb91a341a Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 09:41:19 +0530 Subject: [PATCH 15/25] ignoring warn change sed regex Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 70485899..af9285dc 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -19,7 +19,7 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" -actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*support ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*support. ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From b5903fe33707ec7ed4c5024e7c1e1c0a6cde5c11 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 10:24:28 +0530 Subject: [PATCH 16/25] ignoring warn change sed regex Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index af9285dc..680ecf4a 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -19,7 +19,7 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" echo "--- :mag_right: Testing ${pkg_ident} executables" -actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*support. ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 1d4080d96702ecf2daf7723b4e371eac480b94e4 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 11:46:16 +0530 Subject: [PATCH 17/25] ignoring warn change sed regex Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 680ecf4a..c7c37545 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -18,8 +18,9 @@ error () { package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" -echo "--- :mag_right: Testing ${pkg_ident} executables" -actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +echo "Testing ${pkg_ident} executables" +version=$(hab pkg exec "${pkg_ident}" chef-cli -v +actual_version= $version | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 948dcd9d55ec97900234ae8aa58babfb2d406b16 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 12:06:15 +0530 Subject: [PATCH 18/25] ignoring warn change sed regex Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index c7c37545..39fb6042 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -19,8 +19,8 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" echo "Testing ${pkg_ident} executables" -version=$(hab pkg exec "${pkg_ident}" chef-cli -v -actual_version= $version | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +version=$(hab pkg exec "${pkg_ident}" chef-cli -v) +actual_version= $(echo $version | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 1e68228b82f15790cafb1607a3cfb6868cac9713 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 12:40:54 +0530 Subject: [PATCH 19/25] change version command Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 3 ++- s.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 s.sh diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 39fb6042..5edab835 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -20,7 +20,8 @@ package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" echo "Testing ${pkg_ident} executables" version=$(hab pkg exec "${pkg_ident}" chef-cli -v) -actual_version= $(echo $version | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +echo $version +actual_version= $(echo "$version" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" diff --git a/s.sh b/s.sh new file mode 100755 index 00000000..4f7668d9 --- /dev/null +++ b/s.sh @@ -0,0 +1,5 @@ +pkg_ident="sanghinitin/chef-cli/5.6.15/20241205082855" +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/') +echo $actual_version From d0d63cb20a71f5432cc5faf69dc4b67400129cb9 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 13:22:10 +0530 Subject: [PATCH 20/25] change version command Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- s.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 5edab835..67cd8b3f 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -21,7 +21,7 @@ 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}" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" diff --git a/s.sh b/s.sh index 4f7668d9..cb1fc73e 100755 --- a/s.sh +++ b/s.sh @@ -1,5 +1,5 @@ pkg_ident="sanghinitin/chef-cli/5.6.15/20241205082855" 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 "[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 From 9a731f349cab74ee351d4a2923828241c2cb7139 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 13:34:42 +0530 Subject: [PATCH 21/25] change version command Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 67cd8b3f..880451c2 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -21,7 +21,7 @@ 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" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From f5ca2227b390de10e4c9d328f6586c50a6a15bb6 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 14:23:29 +0530 Subject: [PATCH 22/25] change version command Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 880451c2..3aead886 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -22,6 +22,7 @@ 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/') +echo $actual_version [[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" From 23848b5f1325b4a79fd42f540821a9c93fef1503 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 14:51:04 +0530 Subject: [PATCH 23/25] change version command Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 6 ++++-- s.sh | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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 + From 1d4fd625f51fe059d02bf3c521beb1e4faa168fc Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 15:05:01 +0530 Subject: [PATCH 24/25] change version command Signed-off-by: nitin sanghi --- s.sh | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100755 s.sh diff --git a/s.sh b/s.sh deleted file mode 100755 index a5c91537..00000000 --- a/s.sh +++ /dev/null @@ -1,14 +0,0 @@ -pkg_ident="sanghinitin/chef-cli/5.6.15/20241205082855" -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 - From 533f373936874fc84e07d7e097e4e6d2ffe52d99 Mon Sep 17 00:00:00 2001 From: nitin sanghi Date: Fri, 6 Dec 2024 15:05:39 +0530 Subject: [PATCH 25/25] change version command regex Signed-off-by: nitin sanghi --- habitat/tests/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index e9d7438c..d5d01cdc 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -21,7 +21,7 @@ cd "${project_root}" echo "Testing ${pkg_ident} executables" version=$(hab pkg exec "${pkg_ident}" chef-cli -v) echo $version -actual_version=$(echo "$version" | grep -Po ([0-9]+\.[0-9]+\.[0-9]+)) +actual_version=$(echo "$version" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') echo $actual_version if [[ "$actual_version" != *"$package_version"* ]]; then