summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-08 19:53:19 -0800
committerTim Smith <tsmith@chef.io>2018-04-27 16:51:09 -0700
commit5d7c4fac054d007e4aff6808550db5417670be17 (patch)
tree1fef5884d9cb9fb5c53d30a4708af0cb745891c3
parent2651a43b251f209a63ebc814330271ec5f1735b2 (diff)
downloadchef-docker_testing.tar.gz
Add docker testing in Travisdocker_testing
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--kitchen-tests/cookbooks/base/metadata.rb1
-rw-r--r--kitchen-tests/cookbooks/base/recipes/default.rb4
-rw-r--r--kitchen-tests/cookbooks/base/recipes/docker.rb32
3 files changed, 36 insertions, 1 deletions
diff --git a/kitchen-tests/cookbooks/base/metadata.rb b/kitchen-tests/cookbooks/base/metadata.rb
index f526318bb7..beb3dc8f02 100644
--- a/kitchen-tests/cookbooks/base/metadata.rb
+++ b/kitchen-tests/cookbooks/base/metadata.rb
@@ -20,6 +20,7 @@ depends "ubuntu"
depends "users"
depends "cron"
depends "git"
+depends "docker"
supports "ubuntu"
supports "debian"
diff --git a/kitchen-tests/cookbooks/base/recipes/default.rb b/kitchen-tests/cookbooks/base/recipes/default.rb
index dac989cc81..8d9055034a 100644
--- a/kitchen-tests/cookbooks/base/recipes/default.rb
+++ b/kitchen-tests/cookbooks/base/recipes/default.rb
@@ -2,7 +2,7 @@
# Cookbook:: base
# Recipe:: default
#
-# Copyright:: 2014-2017, Chef Software, Inc.
+# Copyright:: 2014-2018, Chef Software, Inc.
#
hostname "chef-travis-ci.chef.io"
@@ -85,3 +85,5 @@ openssl_rsa_public_key "/etc/ssl/rsakey_aes128cbc.pub" do
end
include_recipe "::tests"
+
+include_recipe "::docker"
diff --git a/kitchen-tests/cookbooks/base/recipes/docker.rb b/kitchen-tests/cookbooks/base/recipes/docker.rb
new file mode 100644
index 0000000000..3bf21b8b33
--- /dev/null
+++ b/kitchen-tests/cookbooks/base/recipes/docker.rb
@@ -0,0 +1,32 @@
+#
+# Cookbook:: base
+# Recipe:: docker
+#
+# Copyright:: 2018, Chef Software, Inc.
+#
+
+docker_service "default" do
+ action [:create, :start]
+end
+
+docker_image "busybox" do
+ host "unix:///var/run/docker.sock"
+end
+
+docker_volume "hello" do
+ action :create
+end
+
+docker_network "network_a" do
+ action :create
+end
+
+docker_container "service default echo server" do
+ container_name "an_echo_server"
+ repo "busybox"
+ volumes ["hello:/hello"]
+ network_mode "network_a"
+ command "nc -ll -p 7 -e /bin/cat"
+ port "7"
+ action :run
+end