Will download an install binaries goss and dgoss

curl -fsSL | sudo sh

Write tests

Will write user + group + service + process in ./goss.yaml

goss aa nginx

Add a specific port in a specific file

goss -g conf.d/test.yaml a port 80

Or edit files manually. Be careful about

  • One root element of a kind only (for example, with two or more file: in the same yaml, only the latest will be taken in account)
  • Don't write integers, write string "integers"

Run tests

Run tests from ./goss.yaml

goss v

Run tests from a specific file with json output

goss -g conf.d/test.yaml v -f json

Run all tests from a subdirectory

mkdir ./conf.d/
# Create / put all your tests in conf.d
goss a gossfile ./conf.d/*

Docker tests

dgoss allow you to test a docker by running goss inside the container. To create a test for official nginx:alpine

dgoss edit nginx:alpine 
goss aa nginx

Then run the test

dgoss run nginx:alpine

The output format can't be changed