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

30 lines
656 B
Ruby

require 'serverspec'
set :backend, :exec
puts
puts '================================'
puts %x(ansible --version)
puts '================================'
sleep 60
describe package('docker-ce') do
it { should be_installed }
end
describe command('docker network list') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match 'proxy' }
end
describe command('docker ps') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match 'whoami' }
its(:stdout) { should match 'traefik' }
end
describe command('curl -H "Host: whoami" http://127.0.0.1') do
its(:exit_status) { should eq 0 }
its(:stdout) { should match "I'm " }
end