|
1 | 1 | require 'spec_helper_acceptance'
|
| 2 | +require 'json' |
| 3 | + |
| 4 | +shared_examples 'the discovery feature is enabled' do |
| 5 | + describe command('curl -sk https://127.0.0.1:8443/features') do |
| 6 | + it { expect(JSON.parse(subject.stdout)).to include('discovery', 'logs') } |
| 7 | + its(:exit_status) { is_expected.to eq (0) } |
| 8 | + end |
| 9 | +end |
2 | 10 |
|
3 | 11 | describe 'Scenario: install foreman-proxy with discovery plugin' do
|
4 | 12 | before(:context) { purge_foreman_proxy }
|
5 | 13 |
|
6 |
| - include_examples 'the example', 'discovery.pp' |
| 14 | + context 'without params' do |
| 15 | + include_examples 'the example', 'discovery.pp' |
| 16 | + |
| 17 | + it_behaves_like 'the default foreman proxy application' |
| 18 | + it_behaves_like 'the discovery feature is enabled' |
| 19 | + end |
| 20 | + |
| 21 | + context 'with install_images param' do |
| 22 | + include_examples 'the example', 'discovery_images.pp' |
| 23 | + |
| 24 | + it_behaves_like 'the default foreman proxy application' |
| 25 | + it_behaves_like 'the discovery feature is enabled' |
7 | 26 |
|
8 |
| - it_behaves_like 'the default foreman proxy application' |
| 27 | + %w[ |
| 28 | + /boot/fdi-image-latest.tar |
| 29 | + /boot/fdi-image/initrd0.img |
| 30 | + /boot/fdi-image/vmlinuz0 |
| 31 | + ].each do |f| |
| 32 | + describe file(File.join(tftp_root, f)) do |
| 33 | + it { is_expected.to be_file } |
| 34 | + it { is_expected.to be_owned_by 'foreman-proxy' } |
| 35 | + it { is_expected.to be_grouped_into 'foreman-proxy' } |
| 36 | + it { is_expected.to be_mode '644' } |
| 37 | + end |
| 38 | + end |
9 | 39 |
|
10 |
| - describe command('curl -sk https://127.0.0.1:8443/features | grep -q discovery') do |
11 |
| - its(:exit_status) { should eq 0 } |
| 40 | + describe file(File.join(tftp_root, '/boot/fdi-image')) do |
| 41 | + it { is_expected.to be_directory } |
| 42 | + it { is_expected.to be_owned_by 'foreman-proxy' } |
| 43 | + it { is_expected.to be_grouped_into 'foreman-proxy' } |
| 44 | + it { is_expected.to be_mode '755' } |
| 45 | + end |
12 | 46 | end
|
13 | 47 | end
|
0 commit comments