FAQ Database Discussion Community


How to set delay between converge and verify on kitchen test?

integration-testing,chef-solo,test-kitchen,serverspec
I'm running Serverspec integration smoke tests with Test Kitchen on a system built with Vagrant+Chef Solo. When i run kitchen test then the tests are started right after successful converge, and some of my tests fail because it takes time for the system to fully start up for the first...

Stop SSH password prompts in serverspec

ruby,net-ssh,serverspec
I'm in an environment with authentication tokens, so typically a SSH password is not required. My serverspec tests are always asking me for a password. Is there a way to prevent this? No password required: $ ssh atlspf01 [email protected]:~$ Yet, in serverspec $ rake spec Password: Relevant code in spec_helper.rb...

What are some goals or best practices when testing a package install with ServerSpec?

windows-installer,chef,serverspec
So, I've successfully used Vagrant and Chef to install an MSI onto a Windows guest VM. Woot! Then, I wrote a few tests with ServerSpec that check that after the MSI was installed, files got put into their proper places and things like that. My question is: What sort of...

Why does serverspec connect to the localhost instead of the remote host

ruby,serverspec
My serverspec example, setup using serverspec-init, then I generated this simple test file ./spec/altspf01/sample_spec.rb require 'spec_helper' describe command( '/bin/hostname -s' ) do its(:stdout) { should match /atlspf01/ } end I expect it to ssh to a remote host (atlspf01) and check its hostname (atlspf01). Instead it connects to the localhost...

ServerSpec failing on Windows 7 when running tests

ruby,windows,serverspec
I recently tried to create a ServerSpec job, using Ruby 2.1.6 for Windows. However, using the code at the following GitHub repo, I get the following errors. C:\Users\PD028300\Desktop\serverspec_test\windows_spec λ rake spec C:/Ruby/Ruby21-x64/bin/ruby.exe -I'C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rspec-support-3.2.2/lib';'C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.3/lib' 'C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rspec-core-3.2.3/exe/rspec' --pattern 'spec/localhost/*_spec.rb' DL is deprecated, please use Fiddle...

Making Serverspec mutlit-host tests continue even on a test failure

ruby,serverspec
I've built some serverspec code to run a group of tests on multiple hosts. The trouble is that the testing stops at the current host when any test fails. I want it to continue to all hosts even if a test fails. Relevant part of rakefile: namespace :spec do task...

undefined method `before' for main:Object

ruby,rspec,serverspec
I'm getting the above error from section of code below. What is the cause? 1 require 'spec_helper' 2 3 before(:all) do 4 puts "ServerSpec tests on #{ENV['TARGET_HOST']}" 5 end Full error: /home/newatson/src/serverspec/spec/cfengine3/common_spec.rb:3:in `<top (required)>': undefined method `before' for main:Object (NoMethodError) from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load' from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in...