diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/default/controls/config_spec.rb new file mode 100644 index 0000000..48b8768 --- /dev/null +++ b/test/integration/default/controls/config_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +control 'epel repo configuration' do + title 'should match desired lines' + + epel_version = + case platform[:name] + when 'amazon' + case platform[:release] + when '2' + '7' + when '2018.03' + '6' + end + when 'centos' + platform[:release][0] + end + + describe file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-#{epel_version}") do + it { should be_file } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } + its('mode') { should cmp '0644' } + end +end diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb new file mode 100644 index 0000000..bac42eb --- /dev/null +++ b/test/integration/default/controls/packages_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +control 'epel package' do + title 'should be installed' + + pkg = 'epel-release' + version = + case platform[:name] + when 'amazon' + case platform[:release] + when '2' + '7-12' + when '2018.03' + '6-8' + end + when 'centos' + if platform[:release].start_with?('8') + '8-7.el8' + elsif platform[:release].start_with?('7') + '7-12' + elsif platform[:release].start_with?('6') + '6-8' + end + end + + describe package(pkg) do + it { should be_installed } + its('version') { should eq version } + end +end