I have a project with a chef recipe that creates a docker container and included is an InSpec test to make sure that it is running.
The issue I’m having is that InSpec does not seem to recognize the docker_container test
My test is essentially this just with different attribute contents:
describe docker_container('an-echo-server') do
it { should exist }
it { should be_running }
its('id') { should_not eq '' }
its('image') { should eq 'busybox:latest' }
its('repo') { should eq 'busybox' }
its('tag') { should eq 'latest' }
its('ports') { should eq [] }
its('command') { should eq 'nc -ll -p 1234 -e /bin/cat' }
end
And this is my error
Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #verify action: [undefined method `docker_container' for #<#<Class:0x00000003556790>:0x00000003555ea8>] on default-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
I copy-pasted InSpec’s example code and fitted it to my occasion. What am I missing? Is there a dependency to use docker tests or something like that?
I’ve updated to the latest chef dk and have inspec declared as my verify-er in .kitchen.yml file
Thanks in advance