Skip to content

Commit

Permalink
Add acceptance tests for salt plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Feb 26, 2024
1 parent 873f4d7 commit 02353d0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/salt.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$baseurl = "https://repo.saltproject.io/salt/py3/redhat/${facts['os']['release']['major']}/\$basearch/latest"

yumrepo { 'salt-repo':
descr => "Salt repo for RHEL/CentOS ${facts['os']['release']['major']} PY3",
baseurl => $baseurl,
gpgkey => "${baseurl}/SALT-PROJECT-GPG-PUBKEY-2023.pub",
before => Class['foreman_proxy::plugin::salt'],
}

include foreman_proxy
include foreman_proxy::plugin::salt
12 changes: 12 additions & 0 deletions spec/acceptance/salt_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'spec_helper_acceptance'

describe 'Scenario: install foreman-proxy with openscap plugin', if: ['redhat', 'centos'].include?(os[:family]) do
before(:context) { purge_foreman_proxy }

include_examples 'the example', 'salt.pp'

it_behaves_like 'the default foreman proxy application'

specify { expect(file('/etc/salt/master.d')).to be_directory }
specify { expect(file('/etc/salt/master.d/foreman.conf')).to be_file.and(have_attributes(owner: 'root', group: 'foreman-proxy')) }
end

0 comments on commit 02353d0

Please sign in to comment.