Skip to content

Instantly share code, notes, and snippets.

@palmertime
Created September 19, 2016 18:20
Show Gist options
  • Save palmertime/b95256d574e1ab1922c1dbff0d4a3308 to your computer and use it in GitHub Desktop.
Save palmertime/b95256d574e1ab1922c1dbff0d4a3308 to your computer and use it in GitHub Desktop.
beaker pp parameter content
Failures:
1) example class: should run successfully
Failure/Error:
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to match(/error/i)
Beaker::Host::CommandFailure:
Host 'xxxxxxxxxxxxxxx' exited with 1 running:
puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.xxxxxx
Last 10 lines of output were:
Error: Could not parse for environment production: Syntax error at '
rotate_count: 1
rate_limit: 100
hosts:
- '; expected '}' at /tmp/apply_manifest.pp.xxxxxx:17 on node xxxxxxxxxxxxxxx.build.example.com
Error: Could not parse for environment production: Syntax error at '
rotate_count: 1
rate_limit: 100
hosts:
- '; expected '}' at /tmp/apply_manifest.pp.xxxxxx:17 on node xxxxxxxxxxxxxxx.build.example.com
require 'spec_helper_acceptance'
describe 'example class:' do
it 'should run successfully' do
pp = <<-HEREDOC
yumrepo { 'dev':
descr => 'dev',
ensure => present,
baseurl => 'http://yum.example.com/repos/dev/',
enabled => '1',
gpgcheck => '0',
}
class { 'example':
package_version => '1.04',
config_yml => "
loglvl: 5
rotate_size: 10485760
rotate_date: \"\"
rotate_count: 1
rate_limit: 100
hosts:
- \"server.example.com\"",
}
HEREDOC
# Apply twice to ensure no errors the second time.
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to match(/error/i)
end
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).not_to eq(/error/i)
expect(r.exit_code).to be_zero
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment