Git Product home page Git Product logo

ami-spec's Introduction

AmiSpec

License MIT Gem Version Build Status

Acceptance testing your AMIs.

AmiSpec is a RubyGem used to launch an Amazon Machine Image (AMI) and run ServerSpecs against it. It wraps around the AWS API and ServerSpec to spin up, test and tear down instances.

Project Goals

  1. To decouple the building of AMIs from testing them. Other approaches to this problem involve copying ServerSpec tests to an EC2 instance before it's converted to an AMI and running the tests there. The problem with this approach is:
  • It does not test the instance in the state it will be in when it's actually in production.
  • It does makes it harder to replace the AMI builder software (i.e. Packer).
  • The software required to test the AMI must exist in the AMI.
  1. To run tests as fast as possible; this approach is slightly slower than the alternative listed above (about 1-2 minutes), but should not be onerous.

Installation

System-wide: gem install ami_spec

With bundler:

Add gem 'ami_spec' to your Gemfile. Run bundle install

CLI Usage

$ bundle exec ami_spec --help
Options:
  -r, --role=<s>                            The role to test, this should map to a directory in the spec
                                            folder
  -a, --ami=<s>                             The ami ID to run tests against
  -o, --role-ami-file=<s>                   A file containing comma separated roles and amis. i.e.
                                            web_server,ami-id.
  -s, --specs=<s>                           The directory to find ServerSpecs
  -u, --subnet-id=<s>                       The subnet to start the instance in. If not provided a subnet
                                            will be chosen from the default VPC
  -k, --key-name=<s>                        The SSH key name to assign to instances. If not provided a
                                            temporary key pair will be generated in AWS
  -e, --key-file=<s>                        The SSH private key file associated to the key_name
  -h, --ssh-user=<s>                        The user to ssh to the instance as
  -w, --aws-region=<s>                      The AWS region, defaults to AWS_DEFAULT_REGION environment
                                            variable
  -i, --aws-instance-type=<s>               The ec2 instance type, defaults to t2.micro (default:
                                            t2.micro)
  -c, --aws-security-groups=<s>             Security groups IDs to associate to the launched instances. May be
                                            specified multiple times. If not provided a temporary security
                                            group will be generated in AWS
  -n, --allow-any-temporary-security-group  The temporary security group will allow SSH connections 
                                            from any IP address (0.0.0.0/0), otherwise allow the subnet's block
  -p, --aws-public-ip                       Launch instances with a public IP and use that IP for SSH
  -q, --associate-public-ip                 Launch instances with a public IP and use the Private IP for SSH
  -t, --ssh-retries=<i>                     The number of times we should try sshing to the ec2 instance
                                            before giving up. Defaults to 30 (default: 30)
  -g, --tags=<s>                            Additional tags to add to launched instances in the form of
                                            comma separated key=value pairs. i.e. Name=AmiSpec (default: )
  -d, --debug                               Don't terminate instances on exit
  -b, --buildkite                           Output section separators for buildkite
  -f, --wait-for-rc                         Wait for oldschool SystemV scripts to run before conducting
                                            tests. Currently only supports Ubuntu with upstart
  -l, --user-data-file=<s>                  File path for aws ec2 user data
  -m, --iam-instance-profile-arn=<s>        IAM instance profile to use
  --help                                    Show this message

AmiSpec will launch an EC2 instance from the given AMI (--ami), in a subnet (--subnet-id) with a key-pair (--key-name) and try to SSH to it (--ssh-user and --key-file). When the instances becomes reachable it will run all Specs inside the role spec directory (--role i.e. my_project/spec/web_server).

Alternative to the --ami and --role variables, a file of comma separated roles and AMIs (ROLE,AMI\n) can be supplied to --role-ami-file.

ServerSpec test layout

AmiSpec expects the usual ServerSpec configuration layout as generated by "serverspec-init":

spec/
├── webserver
│   └── webserver_spec.rb
└── spec_helper.rb

The *_spec.rb files under the role (e.g. webserver) contain the ServerSpec tests that you want to run. The spec_helper.rb file can be very simple:

require 'serverspec'

set :backend, :ssh

Note that the backend needs to be :ssh or ami_spec might run the tests on your local machine, not in EC2.

Example usage

To test a custom AMI using a pre-created security group that allows SSH from anywhere:

ami_spec --role webserver\
 --specs spec\
 --aws-region us-east-1\
 --ami ami-0123456789abcdef0\
 --key-name default\
 --key-file ~/.ssh/default.pem\
 --ssh-user ubuntu\
 --aws-public-ip\
 --aws-security-groups sg-0123456789abcdef0

Known caveats

RSpec conditions in examples

ServerSpecs advanced tips provides a mechanism to conditionally apply tests based on server information.

describe file('/usr/lib64'), :if => os[:arch] == 'x86_64' do
  it { should be_directory }
end

If these are used in shared examples, say loaded via a rspec helper, this doesn't work with AmiSpec, because the evaluation of os[:arch] == 'x86_64' is done when the spec is loaded not at run time.

Working around this is tricky. We need to move the evaluation of os[:arch] to runtime not load time. Since RSpec example metadata can only be a bool, string or symbol we set a metadata key of :os_arch to the value we expect:

describe file('/usr/lib64'), :os_arch => 'x86_64' do
  it { should be_directory }
end

We then have to set an RSpec exclusion of examples where the architecture does not match the host under test's architecture. This can be done in the spec_helper with a lambda function that tests this:

RSpec.configure do |c|
  c.filter_run_excluding :os_arch => lambda { |arch| arch if os[:arch] != arch }
end

We are exluding any example with the metadata key :os_arch where the value does not match our architecture. Similar examples can be included for os family etc.

Development Status

Active and ready for Production

Contributing

For bug fixes, documentation changes, and small features:

  1. Fork it ( https://github.com/envato/ami-spec/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Running tests

Use the following command to run non-integration tests:

bundle exec rake spec

If you're working on the WaitForRC feature you can run it's integration tests by first bringing up the containers, then executing the integration tests:

docker-compose -f spec/containers/docker-compose.yml up -d
bundle exec rspec . --tag integration
docker-compose -f spec/containers/docker-compose.yml down

Maintainers

Patrick Robinson (@patrobinson)

License

AmiSpec uses the MIT license. See LICENSE.txt

ami-spec's People

Contributors

akuma12 avatar jeffb4 avatar lupeman avatar mipearson avatar mjio avatar orien avatar sherzberg avatar viraptor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ami-spec's Issues

New rake cannot be installed with expected ruby version

Running bundle install in the fresh checkout results in:

Installing rake 12.3.1
Gem::InstallError: rake requires Ruby version >= 2.0.0.
...
An error occurred while installing rake (12.3.1), and Bundler cannot continue.
Make sure that `gem install rake -v '12.3.1'` succeeds before bundling.

.ruby-version requires 1.9.3p551, which is quite dated now. There's a commit about the downgrade from 2.2 (a3180c0) but without an explanation about why it's done.

Is there something preventing a bump to the latest ruby 2.5? After manual upgrade, tests pass.

Question about adding helper gems to serverspec runtime

I would like to use rspec-wait for testing things that take a while to complete in our ami. We have some long running boot processes that we need to ensure complete successfully and the serverspec tests are run too soon after the instance is booted and the ssh connection is successful.

I have tried adding a Gemfile in the root of the --specs but that doesn't seem to work as well as our projects main Gemfile but neither seem to get the rspec-wait gem loaded at serverspec run time.

Any ideas?

Assume Role is not supported

As I understand your docu, the only way to test specs is to provide amazons key & key secret.
This means, amazons assume role feature is not supported yet?

BR, jerger

Net::SSH::Disconnect when EC2 instance takes longer to initialize

I just wanted to reach out to see if anyone else is seeing similar behavior. I may be doing something wrong but I'm not sure. I keep randomly getting failures during EC2 instance creation with:

connection closed by remote host (Net::SSH::Disconnect)

It appears to only happen when an EC2 instance takes longer to initialize than usual (i.e. status checks don't pass for a long time). Should Net::SSH::Disconnect be added to https://github.com/envato/ami-spec/blob/master/lib/ami_spec/wait_for_ssh.rb#L12?

Full stacktrace:

/var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/packet_stream.rb:110:in `block in next_packet': connection closed by remote host (Net::SSH::Disconnect)
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/packet_stream.rb:104:in `loop'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/packet_stream.rb:104:in `next_packet'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/session.rb:193:in `block in poll_message'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/session.rb:190:in `loop'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/session.rb:190:in `poll_message'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/transport/session.rb:175:in `next_message'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:101:in `block in next_message'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:100:in `loop'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:100:in `next_message'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/methods/publickey.rb:65:in `authenticate_with'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/methods/publickey.rb:20:in `block in authenticate'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:122:in `block in each_identity'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:119:in `each'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/key_manager.rb:119:in `each_identity'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:85:in `block in authenticate'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `each'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh/authentication/session.rb:71:in `authenticate'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/net-ssh-5.1.0/lib/net/ssh.rb:246:in `start'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/lib/ami_spec/wait_for_ssh.rb:11:in `wait'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/lib/ami_spec.rb:57:in `block in run'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/lib/ami_spec.rb:55:in `each'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/lib/ami_spec.rb:55:in `run'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/lib/ami_spec.rb:134:in `invoke'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/gems/ami_spec-1.2.0/bin/ami_spec:5:in `<top (required)>'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/bin/ami_spec:23:in `load'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/bin/ami_spec:23:in `<main>'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/bin/ruby_executable_hooks:15:in `eval'
    from /var/lib/jenkins/.rvm/gems/ruby-2.5.1@#REDACTED#/bin/ruby_executable_hooks:15:in `<main>'

Thanks!

Net::SSH::ConnectionTimeout

Recently I was getting Net::SSH::ConnectionTimeout error, and then I found out that this exception is not rescued here. So the script will end in first try irrespective of ssh_retries value. I was hoping it for to be rescued by Timeout::Error. Any idea why this exception is not included, as it is a common timeout error for Net::SSH? I can submit a PR if required. thanks

Some example spec files

This looks like a great tool. I think a few same spec files would help people (i.e. me) get started with it.

Do you have any simple tests you can reasonably share?

net-ssh broken with AWS codebuild?

I know technically this may not be an issue with ami-spec. Essentially, I can run ami-spec fine locally with the exact same command I am running via AWS codebuild with Ruby 2.7 (and tried 2.6). I thought it was an IAM permissions issue, but using the --debug flag proves that is not the case (the EC2 instance stays running with --debug).

I'm getting this stack trace:

/root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:92:in `rescue in initialize': Net::SSH::ConnectionTimeout (Net::SSH::ConnectionTimeout)
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:59:in `initialize'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `new'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `start'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec/wait_for_ssh.rb:11:in `wait'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:91:in `block in run'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:89:in `each'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:89:in `run'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:191:in `invoke'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/bin/ami_spec:5:in `<top (required)>'
    from /root/.rbenv/versions/2.7.1/bin/ami_spec:23:in `load'
    from /root/.rbenv/versions/2.7.1/bin/ami_spec:23:in `<main>'
/root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:61:in `connect_internal': Connection timed out - user specified timeout (Errno::ETIMEDOUT)
    from /root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:137:in `connect'
    from /root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:642:in `block in tcp'
    from /root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:227:in `each'
    from /root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:227:in `foreach'
    from /root/.rbenv/versions/2.7.1/lib/ruby/2.7.0/socket.rb:632:in `tcp'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:73:in `initialize'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `new'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `start'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec/wait_for_ssh.rb:11:in `wait'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:91:in `block in run'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:89:in `each'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:89:in `run'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/lib/ami_spec.rb:191:in `invoke'
    from /root/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ami_spec-1.6.0/bin/ami_spec:5:in `<top (required)>'
    from /root/.rbenv/versions/2.7.1/bin/ami_spec:23:in `load'
    from /root/.rbenv/versions/2.7.1/bin/ami_spec:23:in `<main>'

I wanted to try with a newer version of net-ssh gem but the spec is locked to version 5 and I see version 6 now available over at net-ssh.

It's definitely not security group related, and like I said, I can run the ami_spec command all day local from my Mac with great success.

I'm wondering if you, or anyone may have any idea what's going on here?

Thanks,

Chris

Specs running against local machine instead of remote?

Hi,

I'm not sure if this is a bug or i haven't configured something correctly, but it seems like my spec files are asserting against my local machine instead of the EC2 instance.

I'm trying to run the following command:

ami_spec
--role mesos
--ami
--subnet-id
--key-name
--key-file
--ssh-user ubuntu
--specs ./spec
--aws-region eu-west-1

It brings up an EC2 instances fine and attempts to run the specs.

However, it seems like it's running the specs against my local (OSX 10.12.3) machine as it is using brew to try and determine if a package is installed. To get around that i tried to run apt list, however i get a mac pop up saying i need to install a jdk if i want to use apt.

It's strange, because in the output it gives me the IP of the EC2 instance.

Excuse me if i am missing something obvious - anyone have any ideas?

spec/mesos/default_spec.rb:

require 'serverspec'
require 'spec_helper'

set :backend, :exec

describe package('mesos') do
  it { should be_installed.with_version('1.2.0') }
end

describe command("apt list mesos") do
  its(:stdout) { should contain('mesos/now 1.2.0') }
  its(:stdout) { should contain('installed') }
end

Output:

ami_spec \
--role mesos \
--ami <amiid>\
--subnet-id <subnetid> \
--key-name <keyname> \
--key-file <keyfile> \
--ssh-user ubuntu \
--specs ./spec \
--aws-region eu-west-1

/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/session.rb:84:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/cipher_factory.rb:98: warning: constant OpenSSL::Cipher::Cipher is deprecated
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/cipher_factory.rb:72: warning: constant OpenSSL::Cipher::Cipher is deprecated
boo!
Running tests for mesos
FFF

Failures:

  1) Package "mesos" should be installed with version "1.2.0"
     On host `10.185.38.238'
     Failure/Error: it { should be_installed.with_version('1.2.0') }
       expected Package "mesos" to be installed with version "1.2.0"
       /bin/sh -c brew\ info\ mesos\ \|\ grep\ -E\ \"\^\$\(brew\ --prefix\)/Cellar/mesos/1.2.0\"

     # ./spec/mesos/default_spec.rb:7:in `block (2 levels) in <top (required)>'

  2) Command "apt list mesos" stdout should contain "mesos/now 1.2.0"
     On host `10.185.38.238'
     Failure/Error: its(:stdout) { should contain('mesos/now 1.2.0') }
       expected "" to contain "mesos/now 1.2.0"
       /bin/sh -c apt\ list\ mesos

     # ./spec/mesos/default_spec.rb:11:in `block (2 levels) in <top (required)>'

Environment details:

ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
OS: OSX 10.12.3
gem list

*** LOCAL GEMS ***

addressable (2.5.2)
ami_spec (0.3.0)
aws-sdk (2.10.54, 2.10.53)
aws-sdk-core (2.10.54, 2.10.53)
aws-sdk-resources (2.10.54, 2.10.53)
aws-sigv4 (1.0.2)
bigdecimal (default: 1.3.0)
bundler (1.15.4)
crack (0.4.3)
did_you_mean (1.1.0)
diff-lcs (1.3)
hashdiff (0.3.6)
hashie (3.5.6)
io-console (default: 0.4.6)
jmespath (1.3.1)
json (default: 2.0.4)
minitest (5.10.1)
multi_json (1.12.2)
net-scp (1.2.1)
net-ssh (2.9.4)
net-telnet (0.1.1)
openssl (default: 2.0.5)
power_assert (0.4.1)
psych (default: 2.2.2)
public_suffix (3.0.0)
rake (12.1.0, 12.0.0)
rdoc (default: 5.0.0)
rspec (3.6.0)
rspec-core (3.6.0)
rspec-expectations (3.6.0)
rspec-its (1.2.0)
rspec-mocks (3.6.0)
rspec-support (3.6.0)
safe_yaml (1.0.4)
serverspec (2.41.0)
sfl (2.3)
specinfra (2.72.0)
test-unit (3.2.3)
timecop (0.9.1)
trollop (2.1.2)
webmock (3.0.1)
xmlrpc (0.2.1)

error if keyfile isnt available

Just refactored my wrapper, and i spent way too long getting authentication errors because I was putting the keyfile in the wrong place.

If I had seen that it wasnt found at the path I specified I wouldve known right away.

Using `:if` in context/describe declaration causes an exception to be thrown by SpecInfra

If you don't set :ssh_options for ServerSpec, it throws an exception

 `sudo?': undefined method `[]' for nil:NilClass (NoMethodError)

We set the :ssh_options when calling AmiSpec::ServerSpec.run, because the values of this are unknown until runtime.

SpecInfra wants to evaluate the conditional at load time, not at run time.

Stack trace:

./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/backend/ssh.rb:179:in `sudo?': undefined method `[]' for nil:NilClass (NoMethodError)
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/backend/ssh.rb:42:in `build_command'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/backend/ssh.rb:10:in `run_command'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/detect_os.rb:13:in `run_command'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/detect_os/freebsd.rb:3:in `detect'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/detect_os.rb:5:in `detect'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/os.rb:24:in `block in detect_os'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/os.rb:23:in `each'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/os.rb:23:in `detect_os'
    from ./vendor/bundle/ruby/1.9.1/gems/specinfra-2.45.0/lib/specinfra/helper/os.rb:9:in `os'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.