From f39e2d06aff6543f036b8bd17e60d4cf06739c92 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 14 Jul 2022 10:20:44 +0200 Subject: [PATCH] Make tests work with older API versions. --- .../targets/docker_container/tasks/tests/options.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/integration/targets/docker_container/tasks/tests/options.yml b/tests/integration/targets/docker_container/tasks/tests/options.yml index 043d0bec9..60d358bd3 100644 --- a/tests/integration/targets/docker_container/tasks/tests/options.yml +++ b/tests/integration/targets/docker_container/tasks/tests/options.yml @@ -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: @@ -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: @@ -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: @@ -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 ######################################################