Created
February 12, 2016 16:05
-
-
Save brettswift/02c7fdf57eccef97b441 to your computer and use it in GitHub Desktop.
beaker ec2 module not found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/ | |
total 8 | |
drwxr-xr-x. 7 root root 4096 Feb 12 15:57 shaw_firewall | |
drwxr-xr-x. 6 root root 4096 Feb 12 15:56 stdlib | |
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/shaw_firewall/ | |
total 32 | |
-rw-r--r--. 1 root root 210 Feb 12 15:57 beaker_docker_tips | |
-rw-r--r--. 1 root root 265 Feb 12 15:57 CHANGELOG | |
drwxr-xr-x. 2 root root 4096 Feb 12 15:58 ci | |
drwxr-xr-x. 3 root root 4096 Feb 12 15:57 config | |
-rw-r--r--. 1 root root 1562 Feb 12 15:58 CONTRIBUTING.md | |
drwxr-xr-x. 4 root root 4096 Feb 12 15:58 environments | |
drwxr-xr-x. 3 root root 4096 Feb 12 15:57 junit | |
drwxr-xr-x. 2 root root 4096 Feb 12 15:57 manifests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './spec/spec_helper_acceptance.rb' | |
describe 'shaw_firewall class' do | |
context 'default parameters' do | |
# Using puppet_apply as a helper | |
it 'should work with no errors' do | |
pp = <<-EOS | |
include shaw_firewall | |
firewall { '101 allow http and https access': | |
dport => [8080,8081], | |
proto => tcp, | |
action => accept, | |
} | |
EOS | |
# Run it twice and test for idempotency | |
apply_manifest(pp, :catch_failures => true) | |
apply_manifest(pp, :catch_changes => true) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ be rspec spec/acceptance | |
~~~~ | |
localhost $ scp /Users/bswift/src/live_modules/shaw_firewall centos-64-x64:/etc/puppetlabs/code/modules {:ignore => [".bundle", ".git", ".idea", ".vagrant", ".vendor", "vendor", "acceptance", "bundle", "spec", "tests", "log", ".", ".."]} | |
~~~~~ | |
Failures: | |
1) shaw_firewall class default parameters should work with no errors | |
Failure/Error: apply_manifest(pp, :catch_failures => true) | |
Beaker::Host::CommandFailure: | |
Host 'centos-64-x64' exited with 1 running: | |
puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.JzInka | |
Last 10 lines of output were: | |
Error: Could not find class shaw_firewall for centos-64-x64.us-west-2.compute.internal on node centos-64-x64.us-west-2.compute.internal | |
Error: Could not find class shaw_firewall for centos-64-x64.us-west-2.compute.internal on node centos-64-x64.us-west-2.compute.internal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'beaker-rspec' | |
require 'beaker-rspec/helpers/serverspec' | |
should_provision = ENV['BEAKER_provision'] | |
hosts.each do |host| | |
# Install Puppet | |
if should_provision != 'no' #assist with quick testing | |
install_package host, 'rubygems' | |
on host, install_puppet | |
end | |
end | |
UNSUPPORTED_PLATFORMS = ['Suse', 'windows', 'AIX', 'Solaris'] | |
FIXTURES_MODULE_IGNORE_LIST = ['.bundle', '.git', '.idea', '.vagrant', '.vendor', 'acceptance', 'tests', 'log', '.', '..', '.DS_Store'] | |
RSpec.configure do |c| | |
# Project root | |
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
fixtures_module_root = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules')) | |
# Readable test descriptions | |
c.formatter = :documentation | |
# Configure all nodes in nodeset | |
c.before :suite do | |
# Install module and dependencies | |
#Install all modules from spec/fixtures/modules | |
Dir.entries("#{fixtures_module_root}").select { |m| | |
next if m == '.' or m == '..' or m == 'shaw_firewall' | |
puppet_module_install(:source => "#{fixtures_module_root}/#{m}", :module_name => m, :ignore_list => FIXTURES_MODULE_IGNORE_LIST) | |
} | |
hosts.each do |host| | |
copy_module_to(host, :source => proj_root, :module_name => 'shaw_firewall') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment