|
46 | 46 | end |
47 | 47 |
|
48 | 48 | describe 'ENC override integration with --enc-override' do |
| 49 | + before(:all) do |
| 50 | + @result = OctocatalogDiff::Integration.integration( |
| 51 | + spec_repo: 'enc-overrides', |
| 52 | + spec_fact_file: 'valid-facts.yaml', |
| 53 | + hiera_config: 'hiera.yaml', |
| 54 | + hiera_path: 'hieradata', |
| 55 | + argv: [ |
| 56 | + '--enc', |
| 57 | + OctocatalogDiff::Spec.fixture_path('repos/enc-overrides/enc.sh'), |
| 58 | + '--enc-override', 'role=two' |
| 59 | + ] |
| 60 | + ) |
| 61 | + end |
| 62 | + |
| 63 | + it 'should succeed' do |
| 64 | + expect(@result.exitcode).not_to eq(-1), OctocatalogDiff::Integration.format_exception(@result) |
| 65 | + expect(@result.exitcode).to eq(0), "Runtime error: #{@result.logs}" |
| 66 | + end |
| 67 | + |
| 68 | + it 'should show no changes' do |
| 69 | + expect(@result.diffs).to eq([]) |
| 70 | + end |
| 71 | + |
| 72 | + it 'should contain proper resources in to-catalog' do |
| 73 | + to_catalog = @result.to |
| 74 | + expect(to_catalog).to be_a_kind_of(OctocatalogDiff::API::V1::Catalog) |
| 75 | + |
| 76 | + file_one = to_catalog.resource(type: 'File', title: '/tmp/one') |
| 77 | + expect(file_one['parameters']['content']).to eq('two') |
| 78 | + |
| 79 | + file_two = to_catalog.resource(type: 'File', title: '/tmp/two') |
| 80 | + expect(file_two['parameters']['content']).to eq('two') |
| 81 | + end |
| 82 | + |
| 83 | + it 'should log proper messages' do |
| 84 | + expect(@result.log_messages).to include('DEBUG - ENC override message goes here') |
| 85 | + end |
49 | 86 | end |
50 | 87 |
|
51 | 88 | describe 'ENC override integration with --to-enc-override' do |
|
0 commit comments