From 5cd85128883e2ccca696d8d67dc3cd6d2e113c58 Mon Sep 17 00:00:00 2001 From: Chris Southall Date: Sat, 21 Dec 2024 22:04:46 +0000 Subject: [PATCH] update unit tests for #94 --- CHANGELOG.md | 3 +++ metadata.json | 2 +- spec/defines/container_spec.rb | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e76396..aa75865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Release 0.7.6 +- Bugfix. fixing the onlyi_prc condition #94. Contributed by utkarsh079 + ## Release 0.7.5 - Bugfix. Resolve image name to ID before fetching digest to resolve false drift #92. Contributed by optiz0r diff --git a/metadata.json b/metadata.json index af94566..b554555 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "southalc-podman", - "version": "0.7.5", + "version": "0.7.6", "author": "Chris Southall", "summary": "Manage podman containers with puppet", "license": "Apache-2.0", diff --git a/spec/defines/container_spec.rb b/spec/defines/container_spec.rb index 9c72436..70120a1 100644 --- a/spec/defines/container_spec.rb +++ b/spec/defines/container_spec.rb @@ -105,11 +105,11 @@ remove_onlyif = if %r{^\/opt\/puppetlabs\/}.match?(os_facts[:ruby]['sitedir']) <<-END.gsub(%r{^\s+\|}, '') - |test $(podman container inspect --format json namevar |/opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') =#{' '} + |test $(podman container inspect --format json namevar |/opt/puppetlabs/puppet/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') = true END else <<-END.gsub(%r{^\s+\|}, '') - |test $(podman container inspect --format json namevar |/usr/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') =#{' '} + |test $(podman container inspect --format json namevar |/usr/bin/ruby -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') = true END end @@ -807,7 +807,7 @@ it { is_expected.to contain_exec('verify_container_image_namevar').with_unless(unless_ruby) } onlyif_ruby = <<-END.gsub(%r{^\s+\|}, '') - |test $(podman container inspect --format json namevar |/test/ing -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') =#{' '} + |test $(podman container inspect --format json namevar |/test/ing -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') = true END it { is_expected.to contain_exec('podman_remove_container_namevar').with_onlyif(onlyif_ruby) } @@ -832,7 +832,7 @@ it { is_expected.to contain_exec('verify_container_image_namevar').with_unless(unless_ruby) } onlyif_ruby = <<-END.gsub(%r{^\s+\|}, '') - |test $(podman container inspect --format json namevar |/test/ing -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') =#{' '} + |test $(podman container inspect --format json namevar |/test/ing -rjson -e 'puts (JSON.parse(STDIN.read))[0]["State"]["Running"]') = true END it { is_expected.to contain_exec('podman_remove_container_namevar').with_onlyif(onlyif_ruby) }