diff --git a/metadata.json b/metadata.json index e2ee030d..1418042d 100644 --- a/metadata.json +++ b/metadata.json @@ -51,7 +51,8 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "20.04" + "20.04", + "22.04" ] }, { diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 92765f54..9e26e738 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -66,6 +66,8 @@ class { 'nodejs': end context 'Debian distribution packages', if: fact('os.family') == 'Debian' do + before(:context) { purge_node } + include_examples 'cleanup' it_behaves_like 'an idempotent resource' do @@ -91,6 +93,8 @@ class { 'nodejs': end context 'set global_config_entry secret' do + before(:context) { purge_node } + include_examples 'cleanup' it_behaves_like 'an idempotent resource' do @@ -115,6 +119,8 @@ class { 'nodejs': } end context 'set global_config_entry secret unquoted' do + before(:context) { purge_node } + include_examples 'cleanup' it_behaves_like 'an idempotent resource' do diff --git a/spec/support/acceptance/purge.rb b/spec/support/acceptance/purge.rb new file mode 100644 index 00000000..271a2a05 --- /dev/null +++ b/spec/support/acceptance/purge.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +def purge_node + case fact('osfamily') + when 'Debian' + on default, 'apt-get purge -y libnode*', { acceptable_exit_codes: [0, 100] } + end +end