Skip to content

Instantly share code, notes, and snippets.

@kbarber
Last active August 29, 2015 14:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbarber/850a7d88fce409592bab to your computer and use it in GitHub Desktop.
Save kbarber/850a7d88fce409592bab to your computer and use it in GitHub Desktop.
[ken@kb Development]# cd sample-beaker
ruby-2.0.0-p481 - #gemset created /Users/ken/.rvm/gems/ruby-2.0.0-p481@sample-beaker
ruby-2.0.0-p481 - #generating sample-beaker wrappers - please wait
ruby-2.0.0-p481@sample-beaker
[ken@kb sample-beaker]# bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing rake 10.3.2
Installing CFPropertyList 2.2.8
Installing addressable 2.3.6
Installing archive-tar-minitar 0.5.2
Installing extlib 0.9.16
Installing multi_json 1.10.1
Installing autoparse 0.3.3
Installing json 1.8.1
Installing nokogiri 1.5.11
Installing aws-sdk 1.42.0
Installing builder 3.2.2
Installing excon 0.40.0
Installing formatador 0.2.5
Installing mime-types 1.25.1
Installing net-ssh 2.9.1
Installing net-scp 1.2.1
Installing fog-core 1.24.0
Installing fog-json 1.0.0
Installing inflecto 0.0.2
Installing fog-brightbox 0.5.1
Installing ipaddress 0.8.0
Installing fog 1.22.1
Installing minitar 0.5.4
Installing thor 0.19.1
Installing blimpy 0.6.7
Installing docker-api 1.13.6
Installing fission 0.5.0
Installing multipart-post 2.0.0
Installing faraday 0.9.0
Installing jwt 1.0.0
Installing launchy 2.4.2
Installing retriable 1.4.1
Installing signet 0.5.1
Installing uuidtools 2.1.5
Installing google-api-client 0.7.1
Installing hocon 0.0.5
Installing inifile 2.0.2
Installing trollop 2.0
Installing rbvmomi 1.8.1
Installing unf_ext 0.0.6
Installing unf 0.1.4
Installing beaker 1.19.1
Installing rspec-core 2.99.2
Installing diff-lcs 1.2.5
Installing rspec-expectations 2.99.2
Installing rspec-mocks 2.99.2
Installing rspec 2.99.0
Installing highline 1.6.21
Installing rspec-its 1.0.1
Installing specinfra 1.27.5
Installing serverspec 1.16.0
Installing beaker-rspec 3.0.0
Using bundler 1.6.2
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
[ken@kb sample-beaker]# bundle exec rspec spec/acceptance
Hypervisor for puppetdb1.vm is ec2
Beaker::Hypervisor, found some ec2 boxes to create
aws-sdk: Iterate across all hosts in configuration and launch them
aws-sdk: Checking image ami-aa8b039a exists and getting its root device
[AWS EC2 200 0.991858 0 retries] describe_images(:image_ids=>["ami-aa8b039a"])
aws-sdk: Image block_device_mappings: {"/dev/sda"=>{:snapshot_id=>"snap-df3950f9", :volume_size=>8, :delete_on_termination=>false, :volume_type=>"standard", :encrypted=>false}}
aws-sdk: Launch instance
aws-sdk: Ensure key pair exists, create if not
[AWS EC2 200 0.436754 0 retries] describe_key_pairs(:filters=>[{:name=>"key-name",:values=>["Beaker-ken-kb-local"]}])
aws-sdk: Ensure security group exists for ports [22, 61613, 8139, 8080, 8081, 8140, 443], create if not
[AWS EC2 200 0.568425 0 retries] describe_security_groups(:filters=>[{:name=>"group-name",:values=>["Beaker-1855672422"]}])
[AWS EC2 200 0.976588 0 retries] run_instances(:block_device_mappings=>[{:device_name=>"/dev/sda",:ebs=>{:delete_on_termination=>true}}],:client_token=>"760d2895-4bea-451e-9e47-109235575883",:disable_api_termination=>false,:image_id=>"ami-aa8b039a",:instance_initiated_shutdown_behavior=>"terminate",:instance_type=>"c3.large",:key_name=>"Beaker-ken-kb-local",:max_count=>1,:min_count=>1,:monitoring=>{:enabled=>true},:security_group_ids=>["sg-9002c3a3"])
aws-sdk: Launched puppetdb1.vm (el-6-x86_64-west:c3.large) using snapshot/image_type foss
aws-sdk: Now wait for all hosts to reach state running
aws-sdk: Wait for status running for node puppetdb1.vm
[AWS EC2 200 0.449193 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
aws-sdk: Sleeping 2 seconds for attempt 1.
[AWS EC2 200 0.829883 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
aws-sdk: Sleeping 4 seconds for attempt 2.
[AWS EC2 200 0.849954 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
aws-sdk: Sleeping 8 seconds for attempt 3.
[AWS EC2 200 1.078739 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
aws-sdk: Sleeping 16 seconds for attempt 4.
aws-sdk: Add tags for puppetdb1.vm
[AWS EC2 200 2.05994 1 retries] create_tags(:resources=>["i-9f77e090"],:tags=>[{:key=>"jenkins_build_url",:value=>""}])
[AWS EC2 200 0.514362 0 retries] create_tags(:resources=>["i-9f77e090"],:tags=>[{:key=>"Name",:value=>"puppetdb1.vm"}])
[AWS EC2 200 6.152393 3 retries] create_tags(:resources=>["i-9f77e090"],:tags=>[{:key=>"department",:value=>"ken"}])
[AWS EC2 200 0.634436 0 retries] create_tags(:resources=>["i-9f77e090"],:tags=>[{:key=>"project",:value=>"Beaker"}])
aws-sdk: Populate DNS for puppetdb1.vm
[AWS EC2 200 0.460509 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
[AWS EC2 200 0.437453 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
[AWS EC2 200 0.480868 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
[AWS EC2 200 0.435192 0 retries] describe_instances(:instance_ids=>["i-9f77e090"])
aws-sdk: name: puppetdb1.vm ip: 54.184.195.127 private_ip: 10.218.140.240 dns_name: ec2-54-184-195-127.us-west-2.compute.amazonaws.com
puppetdb1.vm 11:23:43$ hostname puppetdb1.vm
Created ssh connection to 54.184.195.127, user: root, opts: {:config=>false, :paranoid=>false, :timeout=>300, :auth_methods=>["publickey"], :port=>22, :forward_agent=>true, :keys=>["/Users/ken/.ssh/id_rsa"], :user_known_hosts_file=>"/Users/ken/.ssh/known_hosts", :user=>"root"}
puppetdb1.vm executed in 2.76 seconds
puppetdb1.vm 11:23:46$ cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search us-west-2.compute.internal
nameserver 172.16.0.23
puppetdb1.vm executed in 0.34 seconds
puppetdb1.vm 11:23:46$ echo '127.0.0.1 localhost localhost.localdomain
10.218.140.240 puppetdb1.vm puppetdb1.vm.us-west-2.compute.internal ec2-54-184-195-127.us-west-2.compute.amazonaws.com
' > /etc/hosts
puppetdb1.vm executed in 0.34 seconds
aws-sdk: Provisioning complete in 50.889546 seconds
puppetdb1.vm 11:23:46$ rpm -q curl
curl-7.19.7-26.el6_2.4.x86_64
puppetdb1.vm executed in 1.11 seconds
puppetdb1.vm 11:23:47$ rpm -q ntpdate
package ntpdate is not installed
puppetdb1.vm executed in 0.36 seconds
Exited: 1
puppetdb1.vm 11:23:48$ yum -y install ntpdate
Loaded plugins: fastestmirror, presto
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-1.el6.centos will be installed
--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: ntpdate-4.2.6p5-1.el6.centos.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1)(64bit) for package: ntpdate-4.2.6p5-1.el6.centos.x86_64
--> Running transaction check
---> Package openssl.x86_64 0:1.0.0-25.el6_3.1 will be updated
---> Package openssl.x86_64 0:1.0.1e-16.el6_5.15 will be an update
--> Processing Dependency: make for package: openssl-1.0.1e-16.el6_5.15.x86_64
--> Running transaction check
---> Package make.x86_64 1:3.81-20.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ntpdate x86_64 4.2.6p5-1.el6.centos base 75 k
Installing for dependencies:
make x86_64 1:3.81-20.el6 base 389 k
Updating for dependencies:
openssl x86_64 1.0.1e-16.el6_5.15 updates 1.5 M
Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 1 Package(s)
Total download size: 2.0 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 2.0 M
--------------------------------------------------------------------------------
Total 967 kB/s | 2.0 MB 00:02
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-3.el6.centos.9.x86_64 (@CentOS6-Base/$releasever)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:make-3.81-20.el6.x86_64 1/4
Updating : openssl-1.0.1e-16.el6_5.15.x86_64 2/4
Installing : ntpdate-4.2.6p5-1.el6.centos.x86_64 3/4
Cleanup : openssl-1.0.0-25.el6_3.1.x86_64 4/4
Verifying : ntpdate-4.2.6p5-1.el6.centos.x86_64 1/4
Verifying : openssl-1.0.1e-16.el6_5.15.x86_64 2/4
Verifying : 1:make-3.81-20.el6.x86_64 3/4
Verifying : openssl-1.0.0-25.el6_3.1.x86_64 4/4
Installed:
ntpdate.x86_64 0:4.2.6p5-1.el6.centos
Dependency Installed:
make.x86_64 1:3.81-20.el6
Dependency Updated:
openssl.x86_64 0:1.0.1e-16.el6_5.15
Complete!
puppetdb1.vm executed in 16.65 seconds
puppetdb1.vm 11:24:04$ yum -y install rubygems
Loaded plugins: fastestmirror, presto
Determining fastest mirrors
* base: mirrors.usc.edu
* extras: centos.tcpdiag.net
* updates: centos.mirrors.hoobly.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rubygems.noarch 0:1.3.7-5.el6 will be installed
--> Processing Dependency: ruby(abi) = 1.8 for package: rubygems-1.3.7-5.el6.noarch
--> Processing Dependency: ruby-rdoc for package: rubygems-1.3.7-5.el6.noarch
--> Processing Dependency: /usr/bin/ruby for package: rubygems-1.3.7-5.el6.noarch
--> Running transaction check
---> Package ruby.x86_64 0:1.8.7.352-13.el6 will be installed
---> Package ruby-libs.x86_64 0:1.8.7.352-13.el6 will be installed
--> Processing Dependency: libreadline.so.5()(64bit) for package: ruby-libs-1.8.7.352-13.el6.x86_64
---> Package ruby-rdoc.x86_64 0:1.8.7.352-13.el6 will be installed
--> Processing Dependency: ruby-irb = 1.8.7.352-13.el6 for package: ruby-rdoc-1.8.7.352-13.el6.x86_64
--> Running transaction check
---> Package compat-readline5.x86_64 0:5.2-17.1.el6 will be installed
---> Package ruby-irb.x86_64 0:1.8.7.352-13.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
rubygems noarch 1.3.7-5.el6 base 207 k
Installing for dependencies:
compat-readline5 x86_64 5.2-17.1.el6 base 130 k
ruby x86_64 1.8.7.352-13.el6 updates 534 k
ruby-irb x86_64 1.8.7.352-13.el6 updates 314 k
ruby-libs x86_64 1.8.7.352-13.el6 updates 1.6 M
ruby-rdoc x86_64 1.8.7.352-13.el6 updates 377 k
Transaction Summary
================================================================================
Install 6 Package(s)
Total download size: 3.2 M
Installed size: 11 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 3.2 M
--------------------------------------------------------------------------------
Total 1.4 MB/s | 3.2 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : compat-readline5-5.2-17.1.el6.x86_64 1/6
Installing : ruby-libs-1.8.7.352-13.el6.x86_64 2/6
Installing : ruby-1.8.7.352-13.el6.x86_64 3/6
Installing : ruby-irb-1.8.7.352-13.el6.x86_64 4/6
Installing : ruby-rdoc-1.8.7.352-13.el6.x86_64 5/6
Installing : rubygems-1.3.7-5.el6.noarch 6/6
Verifying : ruby-irb-1.8.7.352-13.el6.x86_64 1/6
Verifying : ruby-libs-1.8.7.352-13.el6.x86_64 2/6
Verifying : compat-readline5-5.2-17.1.el6.x86_64 3/6
Verifying : ruby-rdoc-1.8.7.352-13.el6.x86_64 4/6
Verifying : rubygems-1.3.7-5.el6.noarch 5/6
Verifying : ruby-1.8.7.352-13.el6.x86_64 6/6
Installed:
rubygems.noarch 0:1.3.7-5.el6
Dependency Installed:
compat-readline5.x86_64 0:5.2-17.1.el6 ruby.x86_64 0:1.8.7.352-13.el6
ruby-irb.x86_64 0:1.8.7.352-13.el6 ruby-libs.x86_64 0:1.8.7.352-13.el6
ruby-rdoc.x86_64 0:1.8.7.352-13.el6
Complete!
puppetdb1.vm executed in 6.05 seconds
puppetdb1.vm 11:24:10$ gem install puppet --no-ri --no-rdoc
Successfully installed facter-2.2.0
Successfully installed json_pure-1.8.1
Successfully installed hiera-1.3.4
Successfully installed puppet-3.7.1
4 gems installed
puppetdb1.vm executed in 27.71 seconds
puppetdb1.vm 11:24:38$ mkdir -p /etc/puppetlabs/puppet/modules
puppetdb1.vm executed in 0.41 seconds
puppetdb1.vm 11:24:39$ echo /etc/puppetlabs/puppet/modules
/etc/puppetlabs/puppet/modules
puppetdb1.vm executed in 0.62 seconds
localhost $ scp /Users/ken/Development/sample-beaker puppetdb1.vm:/etc/puppetlabs/puppet/modules/mysql
After rejecting ignored files/dirs, going to scp [/Users/ken/Development/sample-beaker/config, /Users/ken/Development/sample-beaker/config/image_templates, /Users/ken/Development/sample-beaker/config/image_templates/ec2.yaml, /Users/ken/Development/sample-beaker/Gemfile, /Users/ken/Development/sample-beaker/Gemfile.lock]
puppetdb1.vm 11:24:39$ mkdir -p /etc/puppetlabs/puppet/modules/mysql/.
puppetdb1.vm executed in 0.34 seconds
puppetdb1.vm 11:24:40$ mkdir -p /etc/puppetlabs/puppet/modules/mysql/config
puppetdb1.vm executed in 0.36 seconds
puppetdb1.vm 11:24:40$ mkdir -p /etc/puppetlabs/puppet/modules/mysql/config/image_templates
puppetdb1.vm executed in 0.35 seconds
copying /Users/ken/Development/sample-beaker/Gemfile.lock: 0/3085
copying /Users/ken/Development/sample-beaker/Gemfile.lock: 3085/3085
SCP'ed file /Users/ken/Development/sample-beaker/Gemfile.lock to 54.184.195.127:/etc/puppetlabs/puppet/modules/mysql/Gemfile.lock
puppetdb1.vm 11:24:47$ env PATH="/opt/puppet/bin:${PATH}" RUBYLIB="${RUBYLIB}" puppet module install puppetlabs-stdlib
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Created target directory /etc/puppet/modules
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└── puppetlabs-stdlib (v4.3.2)
puppetdb1.vm executed in 3.79 seconds
mysql::server::account_security class
running puppet code
puppetdb1.vm 11:24:51$ uname -m
x86_64
puppetdb1.vm executed in 0.35 seconds
puppetdb1.vm 11:24:51$ ls /etc/fedora-release
ls: cannot access /etc/fedora-release: No such file or directory
puppetdb1.vm executed in 0.35 seconds
Exited: 2
puppetdb1.vm 11:24:51$ ls /etc/redhat-release
/etc/redhat-release
puppetdb1.vm executed in 0.35 seconds
puppetdb1.vm 11:24:52$ cat /etc/redhat-release
CentOS release 6.3 (Final)
puppetdb1.vm executed in 0.35 seconds
puppetdb1.vm 11:24:52$ mktemp -t apply_manifest.pp.XXXXXX
/tmp/apply_manifest.pp.A7nsT0
puppetdb1.vm executed in 0.34 seconds
localhost $ scp /var/folders/21/g1xxs_ws1rx3vc4w4lbdwbxh0000gp/T/beaker20141007-10478-t5h9sn puppetdb1.vm:/tmp/apply_manifest.pp.A7nsT0
copying /var/folders/21/g1xxs_ws1rx3vc4w4lbdwbxh0000gp/T/beaker20141007-10478-t5h9sn: 0/68
copying /var/folders/21/g1xxs_ws1rx3vc4w4lbdwbxh0000gp/T/beaker20141007-10478-t5h9sn: 68/68
SCP'ed file /var/folders/21/g1xxs_ws1rx3vc4w4lbdwbxh0000gp/T/beaker20141007-10478-t5h9sn to 54.184.195.127:/tmp/apply_manifest.pp.A7nsT0
puppetdb1.vm 11:24:54$ env PATH="/opt/puppet/bin:${PATH}" RUBYLIB="${RUBYLIB}" puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.A7nsT0
Info: Loading facts
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /tmp/apply_manifest.pp.A7nsT0:1 on node puppetdb1.vm
Wrapped exception:
Could not find declared class mysql::server
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /tmp/apply_manifest.pp.A7nsT0:1 on node puppetdb1.vm
puppetdb1.vm executed in 2.15 seconds
Exited: 1
should work with no errors (FAILED - 1)
accounts
puppetdb1.vm 11:24:56$ mysql -e 'show grants for root@127.0.0.1;'
bash: mysql: command not found
puppetdb1.vm executed in 0.37 seconds
Exited: 127
should delete accounts (FAILED - 2)
puppetdb1.vm 11:24:56$ mysql -e 'show databases;' |grep test
bash: mysql: command not found
puppetdb1.vm executed in 0.39 seconds
Exited: 1
should delete databases
aws-sdk: Cleanup, iterating across all hosts and terminating them
[AWS EC2 200 1.384471 0 retries] describe_instances(:filters=>[{:name=>"instance-id",:values=>["i-9f77e090"]}])
[AWS EC2 200 0.917418 0 retries] terminate_instances(:instance_ids=>["i-9f77e090"])
Failures:
1) mysql::server::account_security class running puppet code should work with no errors
Failure/Error: apply_manifest(pp, :catch_failures => true)
Beaker::Host::CommandFailure:
Host 'puppetdb1.vm' exited with 1 running:
env PATH="/opt/puppet/bin:${PATH}" RUBYLIB="${RUBYLIB}" puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.A7nsT0
Last 10 lines of output were:
Info: Loading facts
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /tmp/apply_manifest.pp.A7nsT0:1 on node puppetdb1.vm
Wrapped exception:
Could not find declared class mysql::server
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class mysql::server at /tmp/apply_manifest.pp.A7nsT0:1 on node puppetdb1.vm
# ./spec/acceptance/example_spec.rb:11:in `block (3 levels) in <top (required)>'
2) mysql::server::account_security class running puppet code accounts should delete accounts
Failure/Error: shell("mysql -e 'show grants for root@127.0.0.1;'", :acceptable_exit_codes => 1)
Beaker::Host::CommandFailure:
Host 'puppetdb1.vm' exited with 127 running:
mysql -e 'show grants for root@127.0.0.1;'
Last 10 lines of output were:
bash: mysql: command not found
# ./spec/acceptance/example_spec.rb:17:in `block (4 levels) in <top (required)>'
Finished in 20.42 seconds
3 examples, 2 failures
Failed examples:
rspec ./spec/acceptance/example_spec.rb:5 # mysql::server::account_security class running puppet code should work with no errors
rspec ./spec/acceptance/example_spec.rb:16 # mysql::server::account_security class running puppet code accounts should delete accounts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment