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
0
votes
1 answer

Testing Dockerfile which runs on non root user using Serverspec

I have a Dockerfile which spins up Jenkins slave nodes using the Jenkins Swarm plugin. I have a non-root user "jenkins" setup in this image. There is nvm setup for the jenkins user. I am trying to test this Docker image using serverspec and I can't…
Ali Bhagat
  • 475
  • 1
  • 6
  • 15
0
votes
0 answers

Modify yard-serverspec gem handler to allow hierarchical documenting of serverspec files

I'm currently trying to document my serverspec tests using yardoc. For this i've installed the yard-serverspec-plugin rubygem which does its job not that bad. But i have one problem. The rubygem handles the "describe" and the "context" the same way…
linux guy
  • 27
  • 1
  • 6
0
votes
0 answers

be_directory failing in serverspec test

I've got a very simple serverspec test below: describe file('C:\\blah') do it { should exist } it { should be_directory } end However, the test is failing. I know that the directory exists. What's the deal? File "C:\blah" should…
devlife
  • 15,275
  • 27
  • 77
  • 131
0
votes
1 answer

How to set a node attribute with serverspec

I'm pretty new to serverspec. I have a recipe which uses something along the lines of the following: c = node['a']['b'] My question is, in the actual test, how could i set that value?
devlife
  • 15,275
  • 27
  • 77
  • 131
0
votes
0 answers

chef integrations tests are not identified by kitchen

I'm trying to write integration tests for chef cookbook using serverspec verifier-name in kitchen using kitchen-ssh driver. below is the directory structure how the files are arranged in my cookbook. |-- recipes | …
0
votes
1 answer

Error while using vagrant serverspec plugin

I am trying to use vagrant-serverspec plugin to run acceptance tests for my puppet code..but I am getting below error whenever I run it. Could you guys let me know what I am…
goutham
  • 1
  • 1
0
votes
1 answer

How to install Serverspec in windows machine where internet is not there?

I was using serverspec in a VM where internet is available and it was so nice. But when we need to give the script to testers they have to install it in a machine where internet is not available. I was trying to install in a local folder in a VM…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
0
votes
0 answers

Is there any way to run PowerShell scripts in Serverspec?

There are lots of build-in resources in Serverspec, but I want to extend it to my own needs. In InSpec it support script resource which will run the PowerShell script and get the result it seems. But InSpec is too slow. Is there any equivalent to…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
0
votes
1 answer

InSpec commands are too slow in Windows. Am I missing any steps?

I am checking both Serverspec and InSpec for validating my infrastructure. While I was executing Serverspec in my Windows 2012 R2 server, it was working without any visible performance problem. But when I was executing InSpec, I saw no result for…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
0
votes
0 answers

How to omit the powershell line from output in Serverspec?

I am running serverspec in windows machine and i am creating output in html format. rspec 'C:\Ruby Scripts\Test.rb' --format html --out 'C:\Ruby Scripts\Test.html' But the output html contains huge list of powershell functions in it if there are…
Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230
0
votes
1 answer

Chef Kitchen (kitchen-ec2) serverspec spec failing and causing error

I am learning Chef and the testing process using Kitchen with the ec2 driver and have the following serverspec file: require "serverspec" set :backend, :exec describe "rbenv" do describe file("/home/ec2-user/.rbenv") do it { should…
sixty4bit
  • 7,422
  • 7
  • 33
  • 57
0
votes
1 answer

Installing busser-serverspec plugin in test-kitchen errors out on windows

kitchen verify command will throw the following on windows platform. I don't know which gem to start debugging to fix this issue. Installed gems on my windows host: kitchen-pester (0.4.0) kitchen-salt (0.0.22) kitchen-vagrant (0.19.0) test-kitchen…
Pat O'Shea
  • 50
  • 1
  • 8
0
votes
1 answer

serverspec if condition error

I have below code in puppet if $::operatingsystemmajrelease < 7 { file { '/etc/sudoers' : ensure => present, owner => 'root', group => 'root', mode => '0440', content => template('sudo/sudoers.erb'), …
Puppeteer
  • 63
  • 1
  • 7
0
votes
1 answer

How to do numeric comparison on strings

I have written a serverspec test which is intended to check if the amount of ram on a server is greater or equal than the mount listed in a properties file describe command('perl -n -e "if (/MemTotal:\s+(\d+)/) { print \$1; last; }"…
Vorsprung
  • 32,923
  • 5
  • 39
  • 63
0
votes
1 answer

How to use serverspec docker resource on amazon ec2 instance

I have following structure - Bastion(EC2 instance with public DNS) -> Private EC2 instance on which docker container is running. Now, I can see docker container running by ssh to Bastion using ssh -i key.pem ec2-user@ec2.us-west-amazon.com followed…
rohitkadam19
  • 1,734
  • 5
  • 21
  • 39