summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/docker_container_info/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/docker_container_info/tasks/main.yml')
-rw-r--r--test/integration/targets/docker_container_info/tasks/main.yml64
1 files changed, 0 insertions, 64 deletions
diff --git a/test/integration/targets/docker_container_info/tasks/main.yml b/test/integration/targets/docker_container_info/tasks/main.yml
deleted file mode 100644
index 71d07fe0df..0000000000
--- a/test/integration/targets/docker_container_info/tasks/main.yml
+++ /dev/null
@@ -1,64 +0,0 @@
----
-- block:
- - name: Create random container name
- set_fact:
- cname: "{{ 'ansible-test-%0x' % ((2**32) | random) }}"
-
- - name: Make sure container is not there
- docker_container:
- name: "{{ cname }}"
- state: absent
- force_kill: yes
-
- - name: Inspect a non-present container
- docker_container_info:
- name: "{{ cname }}"
- register: result
-
- - assert:
- that:
- - "not result.exists"
- - "'container' in result"
- - "result.container is none"
-
- - name: Make sure container exists
- docker_container:
- name: "{{ cname }}"
- image: alpine:3.8
- command: '/bin/sh -c "sleep 10m"'
- state: started
- force_kill: yes
-
- - name: Inspect a present container
- docker_container_info:
- name: "{{ cname }}"
- register: result
- - name: Dump docker_container_info result
- debug: var=result
-
- - name: "Comparison: use 'docker inspect'"
- command: docker inspect "{{ cname }}"
- register: docker_inspect
- - set_fact:
- docker_inspect_result: "{{ docker_inspect.stdout | from_json }}"
- - name: Dump docker inspect result
- debug: var=docker_inspect_result
-
- - assert:
- that:
- - result.exists
- - "'container' in result"
- - "result.container"
- - "result.container == docker_inspect_result[0]"
-
- always:
- - name: Cleanup
- docker_container:
- name: "{{ cname }}"
- state: absent
- force_kill: yes
-
- when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=')
-
-- fail: msg="Too old docker / docker-py version to run docker_container_info tests!"
- when: not(docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6)