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

31 lines
656 B
Ruby
Raw Normal View History

2018-12-22 14:55:51 +01:00
require 'serverspec'
set :backend, :exec
puts
puts '================================'
puts %x(ansible --version)
puts '================================'
2019-08-24 12:55:56 +02:00
sleep 60
describe package('docker-ce') do
it { should be_installed }
2018-12-22 14:55:51 +01:00
end
2019-03-17 22:43:20 +01:00
describe command('docker network list') do
its(:exit_status) { should eq 0 }
2019-08-24 12:55:56 +02:00
its(:stdout) { should match 'proxy' }
2019-03-17 22:43:20 +01:00
end
2018-12-22 14:55:51 +01:00
describe command('docker ps') do
its(:exit_status) { should eq 0 }
2019-08-24 12:55:56 +02:00
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 " }
2018-12-22 14:55:51 +01:00
end