Skip to content

Commit

Permalink
Specs for 44ed75a
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Macreery committed May 20, 2014
1 parent 44ed75a commit 4d1c28c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Expand Up @@ -38,4 +38,9 @@
assert container_running?('bflad/testcontainerd')
service('testcontainerd').must_be_running
end

it "has a named busybox-container running sleep 8888" do
cmd = container_info("busybox-container").first['Config']['Cmd']
assert cmd.grep(/8888/).count > 0
end
end
@@ -1,3 +1,5 @@
require 'json'

module Helpers
module DockerTest
require 'chef/mixin/shell_out'
Expand Down Expand Up @@ -29,5 +31,9 @@ def image_exists?(image)
di.stdout.include?(image)
end

def container_info(name)
JSON.parse(shell_out("docker inspect #{name}").stdout)
end

end
end
16 changes: 16 additions & 0 deletions test/cookbooks/docker_test/recipes/container_lwrp.rb
Expand Up @@ -76,3 +76,19 @@
detach true
port '9999:9999'
end

docker_container "busybox-container" do
image "busybox"
container_name "busybox-container"
command "sleep 7777"
detach true
init_type false
end

docker_container "busybox-container" do
image "busybox"
container_name "busybox-container"
command "sleep 8888"
init_type false
action :redeploy
end

0 comments on commit 4d1c28c

Please sign in to comment.