summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-03-17 13:18:42 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-03-19 13:51:43 -0700
commitdc6a1f42afc2bd1d1859c352a70caacf5ae9377e (patch)
tree333d12daf1866f5b79a7aa32c21572af6ed604fd
parentaf908176228031cab8768487a2042d74b3a7b0e5 (diff)
downloadansible-dc6a1f42afc2bd1d1859c352a70caacf5ae9377e.tar.gz
Ugh, looks like very few distros have the proper packages to run the docker module.
break up the tests so that we can maybe run this on at least one platform
-rw-r--r--test/integration/roles/test_docker/tasks/docker-setup-rht.yml4
-rw-r--r--test/integration/roles/test_docker/tasks/main.yml62
2 files changed, 15 insertions, 51 deletions
diff --git a/test/integration/roles/test_docker/tasks/docker-setup-rht.yml b/test/integration/roles/test_docker/tasks/docker-setup-rht.yml
new file mode 100644
index 0000000000..26373e4d3c
--- /dev/null
+++ b/test/integration/roles/test_docker/tasks/docker-setup-rht.yml
@@ -0,0 +1,4 @@
+- name: Install docker packages (yum)
+ yum:
+ state: present
+ name: docker,docker-registry,python-docker-py,nmap-ncat
diff --git a/test/integration/roles/test_docker/tasks/main.yml b/test/integration/roles/test_docker/tasks/main.yml
index 6141fe0534..d1cd7f4e59 100644
--- a/test/integration/roles/test_docker/tasks/main.yml
+++ b/test/integration/roles/test_docker/tasks/main.yml
@@ -1,54 +1,14 @@
-- name: Install docker packages (yum)
- yum:
- state: present
- name: docker,docker-registry,python-docker-py
- when: ansible_distribution in ['RedHat', 'CentOS', 'Fedora']
+- include: docker-setup-rht.yml
+ when: ansible_distribution in ['Fedora']
+ # Packages on RHEL and CentOS are broken, broken, broken. Revisit when
+ # they've got that sorted out
+ #when: ansible_distribution in ['Fedora', 'RedHat', 'CentOS']
-- name: Install docker packages (apt)
- apt:
- state: present
- # Note: add docker-registry when available
- name: docker.io,python-docker
- when: ansible_distribution in ['Ubuntu', 'Debian']
+# python-docker isn't available until 14.10. Revist at the next Ubuntu LTS
+#- include: docker-setup-debian.yml
+# when: ansible_distribution in ['Ubuntu']
-- name: Start docker daemon
- service:
- name: docker
- state: started
+- include: docker-tests.yml
+ # Add other distributions as the proper packages become available
+ when: ansible_distribution in ['Fedora']
-- name: Download busybox image
- docker:
- image: busybox
- state: present
- pull: missing
-
-- name: Run a small script in busybox
- docker:
- image: busybox
- state: reloaded
- pull: always
- command: "nc -l -p 2000 -e xargs -n1 echo hello"
- detach: True
-
-- name: Get the docker container id
- shell: "docker ps | grep busybox | awk '{ print $1 }'"
- register: container_id
-
-- debug: var=container_id
-
-- name: Get the docker container ip
- shell: "docker inspect {{ container_id.stdout_lines[0] }} | grep IPAddress | awk -F '\"' '{ print $4 }'"
- register: container_ip
-
-- debug: var=container_ip
-
-- name: Try to access the server
- shell: "echo 'world' | nc {{ container_ip.stdout_lines[0] }} 2000"
- register: docker_output
-
-- debug: var=docker_output
-
-- name: check that the script ran
- assert:
- that:
- - "'hello world' in docker_output.stdout_lines"