Skip to content

Commit

Permalink
Fix indentation, improve tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Mar 27, 2021
1 parent d64702c commit 6117a5d
Showing 1 changed file with 37 additions and 29 deletions.
66 changes: 37 additions & 29 deletions tests/integration/targets/generic_ssh_connection/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
- name: Make sure we got information
assert:
that:
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'

- name: Show contents of ~/.ssh
command: ls -lah ~/.ssh
Expand All @@ -40,28 +40,36 @@
- name: Make sure we got information
assert:
that:
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'
when: output is not failed or 'Install paramiko package to enable' in output.msg
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'
when: output is succeeded or 'Install paramiko package to enable' in output.msg

- when: docker_py_version is version('4.4.0', '>=')
block:
- name: Get docker daemon information via ssh (OpenSSH) to localhost
docker_host_info:
docker_host: "ssh://root@localhost"
use_ssh_client: true
register: output
- name: Get docker daemon information via ssh (OpenSSH) to localhost
docker_host_info:
docker_host: "ssh://root@localhost"
use_ssh_client: true
register: output
ignore_errors: true

- name: Make sure we got information
assert:
that:
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'
- name: Make sure we got information
assert:
that:
- output is succeeded
- 'output.host_info.Name is string'
- 'output.containers is not defined'
- 'output.networks is not defined'
- 'output.volumes is not defined'
- 'output.images is not defined'
- 'output.disk_usage is not defined'
when: docker_py_version is version('4.4.0', '>=')

- name: Make sure we got information
assert:
that:
- output is failed
- "'use_ssh_client=True requires Docker SDK for Python 4.4.0 or newer' in output.msg"
when: docker_py_version is version('4.4.0', '<')

0 comments on commit 6117a5d

Please sign in to comment.