|
1 | 1 | require 'spec_helper_acceptance'
|
2 | 2 |
|
3 | 3 | describe 'Scenario: install foreman-proxy with discovery plugin' do
|
| 4 | + root = case host_inventory['facter']['os']['name'] |
| 5 | + when 'Debian' |
| 6 | + '/srv/tftp' |
| 7 | + when 'Ubuntu' |
| 8 | + if host_inventory['facter']['os']['release']['major'].to_f >= 20.04 |
| 9 | + '/srv/tftp' |
| 10 | + else |
| 11 | + '/var/lib/tftpboot' |
| 12 | + end |
| 13 | + else |
| 14 | + '/var/lib/tftpboot' |
| 15 | + end |
| 16 | + |
4 | 17 | before(:context) { purge_foreman_proxy }
|
5 | 18 |
|
6 |
| - include_examples 'the example', 'discovery.pp' |
| 19 | + context 'without params' do |
| 20 | + include_examples 'the example', 'discovery.pp' |
| 21 | + |
| 22 | + it_behaves_like 'the default foreman proxy application' |
| 23 | + |
| 24 | + describe command('curl -sk https://127.0.0.1:8443/features | grep -q discovery') do |
| 25 | + its(:exit_status) { should eq 0 } |
| 26 | + end |
| 27 | + end |
| 28 | + |
| 29 | + context 'with install_images param' do |
| 30 | + include_examples 'the example', 'discovery_images.pp' |
| 31 | + |
| 32 | + it_behaves_like 'the default foreman proxy application' |
| 33 | + |
| 34 | + describe command('curl -sk https://127.0.0.1:8443/features | grep -q discovery') do |
| 35 | + its(:exit_status) { should eq 0 } |
| 36 | + end |
7 | 37 |
|
8 |
| - it_behaves_like 'the default foreman proxy application' |
| 38 | + %w[ |
| 39 | + /boot/fdi-image-latest.tar |
| 40 | + /boot/fdi-image/initrd0.img |
| 41 | + /boot/fdi-image/vmlinuz0 |
| 42 | + ].each do |f| |
| 43 | + describe file(File.join(root, f)) do |
| 44 | + it { is_expected.to be_file } |
| 45 | + it { is_expected.to be_owned_by 'foreman-proxy' } |
| 46 | + it { is_expected.to be_grouped_into 'foreman-proxy' } |
| 47 | + it { is_expected.to be_mode '644' } |
| 48 | + end |
| 49 | + end |
9 | 50 |
|
10 |
| - describe command('curl -sk https://127.0.0.1:8443/features | grep -q discovery') do |
11 |
| - its(:exit_status) { should eq 0 } |
| 51 | + describe file(File.join(root, '/boot/fdi-image')) do |
| 52 | + it { is_expected.to be_directory } |
| 53 | + it { is_expected.to be_owned_by 'foreman-proxy' } |
| 54 | + it { is_expected.to be_grouped_into 'foreman-proxy' } |
| 55 | + it { is_expected.to be_mode '755' } |
| 56 | + end |
12 | 57 | end
|
13 | 58 | end
|
0 commit comments