metasploitable3/chef/cookbooks/docker/test/integration/volume/inspec/assert_functioning_spec.rb
2019-02-17 00:02:05 -06:00

44 lines
960 B
Ruby

###########
# reference
###########
# https://docs.docker.com/engine/reference/commandline/volume_create/
###########
# remove_me
###########
describe command('docker volume ls -q') do
its(:exit_status) { should eq 0 }
its(:stdout) { should_not match(/^remove_me$/) }
end
#######
# hello
#######
describe command('docker volume ls -q') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match(/^hello$/) }
its(:stdout) { should match(/^hello_again$/) }
end
##################
# hello containers
##################
describe command("docker ps -qaf 'name=file_writer$'") do
its(:exit_status) { should eq 0 }
its(:stdout) { should_not be_empty }
end
describe command("docker ps -qaf 'name=file_reader$'") do
its(:exit_status) { should eq 0 }
its(:stdout) { should_not be_empty }
end
describe command('docker logs file_reader') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match(%r{/hello/sean_was_here}) }
end