2018-12-22 13:55:51 +00:00
|
|
|
require 'serverspec'
|
|
|
|
|
|
|
|
set :backend, :exec
|
|
|
|
|
|
|
|
puts
|
|
|
|
puts '================================'
|
|
|
|
puts %x(ansible --version)
|
|
|
|
puts '================================'
|
|
|
|
|
2018-12-23 10:28:27 +00:00
|
|
|
describe package('docker-ce') do
|
|
|
|
it { should be_installed }
|
2018-12-22 13:55:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe file('/etc/docker/compose/test/docker-compose.yml') do
|
|
|
|
it { should exist }
|
|
|
|
it { should be_file }
|
|
|
|
it { should be_owned_by 'root' }
|
|
|
|
it { should be_grouped_into 'root' }
|
|
|
|
it { should be_mode 640 }
|
|
|
|
it { should contain '/bin/sleep infinity' }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe command('docker ps') do
|
|
|
|
its(:exit_status) { should eq 0 }
|
|
|
|
its(:stdout) { should match 'alpine' }
|
|
|
|
end
|