forked from sous-chefs/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi service support for docker_service_manager_upstart
- Loading branch information
Sean OMeara
committed
Dec 4, 2015
1 parent
7042fec
commit 0909ad3
Showing
5 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
test/cookbooks/docker_test/recipes/service_upstart_multi.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# installation | ||
docker_installation_binary 'default' do | ||
action :create | ||
end | ||
|
||
# service named 'default' | ||
docker_service_manager_upstart 'default' do | ||
graph '/var/lib/docker' | ||
host 'unix:///var/run/docker.sock' | ||
action :start | ||
end | ||
|
||
docker_image 'busybox' do | ||
host 'unix:///var/run/docker.sock' | ||
end | ||
|
||
docker_container 'service default echo server' do | ||
container_name 'an_echo_server' | ||
repo 'busybox' | ||
command 'nc -ll -p 7 -e /bin/cat' | ||
port '7:7' | ||
action :run | ||
end | ||
|
||
# service A | ||
docker_service_manager_upstart 'one' do | ||
graph '/var/lib/docker-one' | ||
host 'unix:///var/run/docker-one.sock' | ||
action :start | ||
end | ||
|
||
docker_image 'hello-world' do | ||
host 'unix:///var/run/docker-one.sock' | ||
tag 'latest' | ||
end | ||
|
||
docker_container 'hello-world' do | ||
host 'unix:///var/run/docker-one.sock' | ||
command '/hello' | ||
action :create | ||
end | ||
|
||
# service B | ||
docker_service_manager_upstart 'two' do | ||
graph '/var/lib/docker-two' | ||
host 'unix:///var/run/docker-two.sock' | ||
action :start | ||
end | ||
|
||
docker_image 'alpine' do | ||
host 'unix:///var/run/docker-two.sock' | ||
tag '3.1' | ||
end | ||
|
||
docker_container 'service two echo_server' do | ||
container_name 'an_echo_server' | ||
repo 'alpine' | ||
tag '3.1' | ||
command 'nc -ll -p 7 -e /bin/cat' | ||
port '7:7' | ||
host 'unix:///var/run/docker-two.sock' | ||
action :run | ||
end |
36 changes: 36 additions & 0 deletions
36
test/integration/service-upstart-multi/serverspec/assert_functioning_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# # a service named default | ||
describe command('docker images') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match(/busybox/) } | ||
end | ||
|
||
describe command('docker ps -a') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match(/an_echo_server/) } | ||
end | ||
|
||
# service A | ||
describe command('docker --host=unix:///var/run/docker-one.sock images') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match(/^hello-world/) } | ||
its(:stdout) { should_not match(/^alpine/) } | ||
end | ||
|
||
describe command('docker --host=unix:///var/run/docker-one.sock ps -a') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should match(/hello-world/) } | ||
its(:stdout) { should_not match(/an_echo_server/) } | ||
end | ||
|
||
# service B | ||
describe command('docker --host=unix:///var/run/docker-two.sock images') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should_not match(/^hello-world/) } | ||
its(:stdout) { should match(/^alpine/) } | ||
end | ||
|
||
describe command('docker --host=unix:///var/run/docker-two.sock ps -a') do | ||
its(:exit_status) { should eq 0 } | ||
its(:stdout) { should_not match(/hello-world/) } | ||
its(:stdout) { should match(/an_echo_server/) } | ||
end |