ansible-role-swarm/test/integration/default/serverspec/default_spec.rb

31 lines
728 B
Ruby

require 'serverspec'
set :backend, :exec
puts
puts '================================'
puts %x(ansible --version)
puts '================================'
describe package('docker-ce') do
it { should be_installed }
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 network list') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match 'workgroup' }
end
describe command('docker ps') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match 'alpine' }
end