Closed myoung34 closed 7 years ago
Internal AMI tests using ami-spec:
Without fix:
+ bundle exec ami_spec --role Redis --ami ami-#### --subnet-id subnet-4a91dc03 --key-name test --aws-instance-type t2.micro --key-file test.pem --ssh-user ec2-user --aws-security-groups sg-### -t 120 --specs ./spec
boo!
Running tests for Redis
...............................................FFF........
Failures:
1) Redis Server redis server Command "redis-cli incr something" exit_status should eq 0
On host `10.0.3.4'
Failure/Error: its(:exit_status) { should eq 0 }
expected: 0
got: 1
(compared using ==)
sudo -p 'Password: ' /bin/sh -c redis-cli\ incr\ something
# ./spec/Redis/redis_spec.rb:16:in `block (4 levels) in <top (required)>'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec/server_spec.rb:33:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:59:in `block in run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `each'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:121:in `invoke'
2) Redis Server redis server Command "redis-cli incr something" stderr should be empty
On host `10.0.3.4'
Failure/Error: its(:stderr) { should be_empty }
expected `"Could not connect to Redis at 127.0.0.1:6379: Connection refused\n".empty?` to return true, got false
# ./spec/Redis/redis_spec.rb:17:in `block (4 levels) in <top (required)>'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec/server_spec.rb:33:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:59:in `block in run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `each'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:121:in `invoke'
3) Redis Server redis server Command "redis-cli incr something" stdout should match /^1$/
On host `10.0.3.4'
Failure/Error: its(:stdout) { should match(/^1$/) }
expected "" to match /^1$/
Diff:
@@ -1,2 +1,2 @@
-/^1$/
+""
# ./spec/Redis/redis_spec.rb:18:in `block (4 levels) in <top (required)>'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec/server_spec.rb:33:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:59:in `block in run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `each'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:53:in `run'
# /home/ec2-user/.gem/ruby/2.2/gems/ami_spec-0.3.0/lib/ami_spec.rb:121:in `invoke'
Finished in 1 minute 7.63 seconds (files took 2 minutes 3.9 seconds to load)
58 examples, 3 failures
Failed examples:
rspec ./spec/Redis/redis_spec.rb:16 # Redis Server redis server Command "redis-cli incr something" exit_status should eq 0
rspec ./spec/Redis/redis_spec.rb:17 # Redis Server redis server Command "redis-cli incr something" stderr should be empty
rspec ./spec/Redis/redis_spec.rb:18 # Redis Server redis server Command "redis-cli incr something" stdout should match /^1$/
With fix:
+ bundle exec ami_spec --role Redis --ami ami-#### --subnet-id subnet-4a91dc03 --key-name test --aws-instance-type t2.micro --key-file test.pem --ssh-user ec2-user --aws-security-groups sg-### -t 120 --specs ./spec
boo!
Running tests for Redis
..........................................................
Finished in 1 minute 8.99 seconds (files took 1 minute 55.05 seconds to load)
58 examples, 0 failures
Resolves #5 and #23