Skip to content

Commit ce1d232

Browse files
committed
Update puppetdb tests for actual errors passed
1 parent 6073ebe commit ce1d232

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

spec/octocatalog-diff/integration/puppetdb_spec.rb

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
opts = { argv: ['-n', 'not-found-node.github.net'], spec_repo: 'tiny-repo' }
2323
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
2424
expect(result[:exitcode]).to eq(-1), OctocatalogDiff::Integration.format_exception(result)
25-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
26-
expect(result[:exception].message).to match(/FactRetrievalError: Node not-found-node.github.net not found in PuppetDB/)
25+
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::FactRetrievalError')
26+
expect(result[:exception].message).to match(/Node not-found-node.github.net not found in PuppetDB/)
2727
end
2828
end
2929

@@ -53,8 +53,7 @@
5353
opts = { argv: args, spec_repo: 'tiny-repo' }
5454
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
5555
expect(result[:exitcode]).to eq(-1), OctocatalogDiff::Integration.format_exception(result)
56-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
57-
expect(result[:exception].message).to match(/OpenSSL::SSL::SSLError/)
56+
expect(result[:exception].class.to_s).to eq('OpenSSL::SSL::SSLError')
5857
end
5958

6059
it 'should fail if server certificate was not signed by CA', retry: 3 do
@@ -71,8 +70,7 @@
7170
opts = { argv: args, spec_repo: 'tiny-repo' }
7271
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
7372
expect(result[:exitcode]).to eq(-1), OctocatalogDiff::Integration.format_exception(result)
74-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
75-
expect(result[:exception].message).to match(/OpenSSL::SSL::SSLError/)
73+
expect(result[:exception].class.to_s).to eq('OpenSSL::SSL::SSLError')
7674
end
7775
end
7876

@@ -88,8 +86,7 @@
8886
it 'should fail to connect to authenticated puppetdb with no client cert', retry: 3 do
8987
opts = { argv: ['-n', 'rspec-node.github.net'], spec_repo: 'tiny-repo' }
9088
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
91-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
92-
expect(result[:exception].message).to match(/OpenSSL::SSL::SSLError/)
89+
expect(result[:exception].class.to_s).to eq('OpenSSL::SSL::SSLError')
9390
end
9491

9592
it 'should connect to authenticated puppetdb with client keypair', retry: 3 do
@@ -127,8 +124,7 @@
127124
opts = { argv: arg, spec_repo: 'tiny-repo' }
128125
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
129126
expect(result[:exitcode]).to eq(-1), OctocatalogDiff::Integration.format_exception(result)
130-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
131-
expect(result[:exception].message).to match(/OpenSSL::PKey::RSAError/)
127+
expect(result[:exception].class.to_s).to eq('OpenSSL::PKey::RSAError')
132128
end
133129

134130
it 'should fail with password-protected client cert and missing password to authenticated puppetdb', retry: 3 do
@@ -140,8 +136,7 @@
140136
opts = { argv: arg, spec_repo: 'tiny-repo' }
141137
result = OctocatalogDiff::Integration.integration_with_puppetdb(s_opts, opts)
142138
expect(result[:exitcode]).to eq(-1), OctocatalogDiff::Integration.format_exception(result)
143-
expect(result[:exception].class.to_s).to eq('OctocatalogDiff::Errors::CatalogError')
144-
expect(result[:exception].message).to match(/OpenSSL::PKey::RSAError/)
139+
expect(result[:exception].class.to_s).to eq('OpenSSL::PKey::RSAError')
145140
end
146141
end
147142
end

0 commit comments

Comments
 (0)