Questions tagged [serverspec]

Serverspec provides ruby RSpec tests for checking your servers are configured correctly. It tests the servers actual state by executing commands locally, via SSH, WinRM or Docker API

Serverspec provides ruby RSpec tests for checking your servers are configured correctly. It tests the servers actual state by executing commands locally, via SSH, WinRM or Docker API

106 questions
2
votes
0 answers

serverspec test fails to check if Docker service is running on AWS

I'm using Packer to create an AMI in AWS based on the Amazon Linux AMI, provisioned with Ansible. Some of my serverspec tests fail and I don't understand why. First one that always fails is trying to make sure that Docker is installed and running.…
Jose Armesto
  • 12,794
  • 8
  • 51
  • 56
2
votes
2 answers

Chef/Vagrant/Serverspec: specs ensuring that packages are installed fail, but they are installed

From the docs it seems like using Serverspec to verify that packages are installed should be pretty straight-forward, but I'm having some interesting problems with vim and ag (the_silver_searcher). I am using Test Kitchen with the kitchen-vagrant…
sixty4bit
  • 7,422
  • 7
  • 33
  • 57
2
votes
1 answer

Integrating Terraform and Serverspec

I'm using Terraform to automate build out of an AWS EC2 based docker host and then using its remote exec option to download a docker file, build and run it. I'd hoped to integrate this with Serverspec but am struggling to work out two things: The…
2
votes
1 answer

Serverspec fails to verify any package installed by pip on OS X target

Using serverspec-2.36.0 I cannot verify any package installed by pip on OS X El Capitan virtual machine. Testing the command executed by Serverspec gives correct results. The following example is for ansible installed with pip install ansible --user…
techraf
  • 64,883
  • 27
  • 193
  • 198
2
votes
1 answer

How to use or condition in serverspec?

I have a website to be tested for status code, Using curl command to get the status code of the website. Sometimes it is giving 200 and 302 status codes. I am using serverspec to test the website status code. As I am getting 2 status code, I want to…
Venu
  • 378
  • 3
  • 10
2
votes
1 answer

Chef - ServerSpec - Accessing Node attributes

I am in the process of writing ServerSpec tests for a cookbook I wrote. The tests need node attributes to assert various things through kitchen. Fortunately, there is a guide here explaining how to achieve…
dvlpr
  • 139
  • 8
2
votes
1 answer

How can I test with serverspec that Jenkins is running in a jenkins docker container?

I am trying to prove that Jenkins is running in a container built from the official docker hub jenkins image. require "serverspec" require "docker" describe "Dockerfile" do before(:all) do image =…
2
votes
2 answers

How to run Serverspec tests as shared behaviors on multiple servers

I tried to run Serverspec tests as shared behaviors on multiple servers by referencing from http://serverspec.org/advanced_tips.htmlWhen running test, I got the "No examples Found" message every times. How to solve this problem?
2
votes
1 answer

NoMethodError: undefined method `md5sum'

When as the md5sum property added to the file resource type? The version of Serverspec reports md5sum as not found. describe file ('/etc/sysctl.conf' ) do it { should be_file } its(:md5sum) { should eq '07a47f3db13458ebc93b334973cc8720' } …
Neil H Watson
  • 1,002
  • 1
  • 14
  • 31
1
vote
1 answer

serverspec using wrong container

I have 2 spec files that use different docker images and therefore are suppose to start separate and different docker containers to run the examples. In the snippets below I'm using the serverspec gem to test my…
tomasbasham
  • 1,695
  • 2
  • 18
  • 37
1
vote
1 answer

Checking on empty gems cache fails using Serverspec for Docker image build testing

I'm currently having an issue with testing Docker image builds by means of Serverspec. In a nutshell, what I want to do is ensuring that during the image build the Ruby gems build cache gets cleared explicitly, e.g. by issuing rm -rf…
pklndnst
  • 726
  • 2
  • 10
  • 27
1
vote
1 answer

serverspec keeps failing on one and only one file

I have a cookbook setting up a Splunk Forwarder. I've created a number of integration - serverspec tests for the configuration files. One in particular, /opt/splunkforwarder/etc/apps/search/local/inputs.conf keeps failing all the tests the other…
user3481957
  • 151
  • 1
  • 1
  • 10
1
vote
0 answers

Delete a Docker image from inside an RSpec script

TL;DR: I can't delete my Docker image from inside my RSpec script, because RSpec still has a dependent container I'm using RSpec to test my Dockerfiles. That is, to test whether the Dockerfile results in a correct image. My test script does this by…
tjalling
  • 453
  • 5
  • 16
1
vote
1 answer

Rspec test failing against Docker container

DISCLAIMER: I am new to ruby,rspec etc. I am trying to find a test framework for my docker containers I have a docker container that runs the aws cli. I have tested this manually and it work, as part of my tests I want to get the AWS version and…
JaChNo
  • 1,493
  • 9
  • 28
  • 56
1
vote
0 answers

IIS: drive in Serverspec

The PSDrive IIS: is not recognised as a valid path in my serverspec test. This is an example of a failing test: describe command("Get-ItemProperty -Path IIS:\\AppPools\\#{webenv}#{net2_classic_32bit_apppoolpostfix} -Name enable32BitAppOnWin64 |…