|
9 | 9 | describe 'with default settings' do |
10 | 10 | it { should contain_foreman_proxy__plugin__module('container_gateway') } |
11 | 11 | it 'container_gateway.yml should contain the correct configuration' do |
12 | | - expect(get_content(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml')).to include("---") |
13 | | - expect(get_content(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml')).to include(":enabled: https") |
14 | | - expect(get_content(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml')).to include(":pulp_endpoint: https://#{facts[:fqdn]}") |
15 | | - expect(get_content(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml')).to include(":sqlite_db_path: /var/lib/foreman-proxy/smart_proxy_container_gateway.db") |
16 | | - connection_string = get_content(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml').find { |str| str.include?("db_connection_string") } |
17 | | - expect(connection_string.split(/[:@\/]/)[6]).to be_a(String).and have_attributes(length: 32) |
| 12 | + verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml', [ |
| 13 | + '---', |
| 14 | + ':enabled: https', |
| 15 | + ":pulp_endpoint: https://#{facts[:fqdn]}", |
| 16 | + ':sqlite_db_path: /var/lib/foreman-proxy/smart_proxy_container_gateway.db', |
| 17 | + ':db_connection_string: postgres://foreman-proxy:@:/container_gateway' |
| 18 | + ]) |
| 19 | + end |
| 20 | + end |
| 21 | + |
| 22 | + describe 'with overwritten postgres parameters' do |
| 23 | + let :params do { |
| 24 | + :pulp_endpoint => 'https://test.example.com', |
| 25 | + :sqlite_db_path => '/dev/null.db', |
| 26 | + :database_backend => 'postgres', |
| 27 | + :postgresql_host => 'test.example.com', |
| 28 | + :postgresql_port => 5432, |
| 29 | + :postgresql_database => 'container_gateway', |
| 30 | + :postgresql_user => 'foreman-proxy', |
| 31 | + :postgresql_password => 'changeme' |
| 32 | + } end |
| 33 | + |
| 34 | + it 'container_gateway.yml should contain the correct configuration' do |
| 35 | + verify_exact_contents(catalogue, '/etc/foreman-proxy/settings.d/container_gateway.yml', [ |
| 36 | + '---', |
| 37 | + ':enabled: https', |
| 38 | + ':pulp_endpoint: https://test.example.com', |
| 39 | + ':sqlite_db_path: /dev/null.db', |
| 40 | + ':sqlite_timeout: 12345', |
| 41 | + ':db_connection_string: postgres://foreman-proxy:[email protected]:5432/container_gateway' |
| 42 | + ]) |
18 | 43 | end |
19 | 44 | end |
20 | 45 |
|
21 | | - describe 'with overwritten parameters' do |
| 46 | + describe 'with overwritten sqlite parameters' do |
22 | 47 | let :params do { |
23 | 48 | :pulp_endpoint => 'https://test.example.com', |
24 | 49 | :sqlite_db_path => '/dev/null.db', |
|
0 commit comments