Skip to content

Commit

Permalink
Make tests work with older API versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jul 14, 2022
1 parent 9577160 commit f39e2d0
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3196,6 +3196,7 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
platform: linux/amd64
debug: true
register: platform_1
ignore_errors: yes

- name: platform (idempotency)
docker_container:
Expand All @@ -3206,6 +3207,7 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
platform: linux
debug: true
register: platform_2
ignore_errors: yes

- name: platform (changed)
docker_container:
Expand All @@ -3220,6 +3222,7 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
# Do not restart because of the changed image ID
image: ignore
register: platform_3
ignore_errors: yes

- name: cleanup
docker_container:
Expand All @@ -3231,8 +3234,15 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
- assert:
that:
- platform_1 is changed
- platform_2 is not changed
- platform_2 is not changed and platform_2 is not failed
- platform_3 is changed
when: docker_api_version is version('1.41', '>=')
- assert:
that:
- platform_1 is failed
- |
('API version is ' ~ docker_api_version ~ '.') in platform_1.msg and 'Minimum version required is 1.41 ' in platform_1.msg
when: docker_api_version is version('1.41', '<')

####################################################################
## privileged ######################################################
Expand Down

0 comments on commit f39e2d0

Please sign in to comment.