Enable configs tests

This commit is contained in:
Hannes Ljungberg 2019-01-15 22:29:52 +01:00
parent 5a4f818f4a
commit a94054b0bb

View file

@ -115,60 +115,58 @@
## configs #########################################################
####################################################################
# FIXME: Broken until #50606 is merged
- name: configs
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
configs:
- config_id: "{{ config_result_1.config_id }}"
config_name: "{{ config_name_1 }}"
filename: "/tmp/{{ config_name_1 }}.txt"
register: configs_1
#- name: configs
# docker_swarm_service:
# name: "{{ service_name }}"
# image: alpine:3.8
# configs:
# - config_id: "{{ config_result_1.config_id }}"
# config_name: "{{ config_name_1 }}"
# filename: "/tmp/{{ config_name_1 }}.txt"
# register: configs_1
#
#- name: configs (idempotency)
# docker_swarm_service:
# name: "{{ service_name }}"
# image: alpine:3.8
# configs:
# - config_id: "{{ config_result_1.config_id }}"
# config_name: "{{ config_name_1 }}"
# filename: "/tmp/{{ config_name_1 }}.txt"
# register: configs_2
#
#- name: configs (add)
# docker_swarm_service:
# name: "{{ service_name }}"
# image: alpine:3.8
# configs:
# - config_id: "{{ config_result_1.config_id }}"
# config_name: "{{ config_name_1 }}"
# filename: "/tmp/{{ config_name_1 }}.txt"
# - config_id: "{{ config_result_2.config_id }}"
# config_name: "{{ config_name_2 }}"
# filename: "/tmp/{{ config_name_2 }}.txt"
# register: configs_3
#
#- name: configs (empty)
# docker_swarm_service:
# name: "{{ service_name }}"
# image: alpine:3.8
# configs: []
# register: configs_4
#
#- assert:
# that:
# - configs_1 is changed
# - configs_2 is not changed
# - configs_3 is changed
# - configs_4 is changed
# when: docker_api_version is version('1.30', '>=')
#- assert:
# that:
# - configs_1 is failed
# - "('version is ' ~ docker_api_version ~'. Minimum version required is 1.30') in configs_1.msg"
# when: docker_api_version is version('1.30', '<')
- name: configs (idempotency)
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
configs:
- config_id: "{{ config_result_1.config_id }}"
config_name: "{{ config_name_1 }}"
filename: "/tmp/{{ config_name_1 }}.txt"
register: configs_2
- name: configs (add)
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
configs:
- config_id: "{{ config_result_1.config_id }}"
config_name: "{{ config_name_1 }}"
filename: "/tmp/{{ config_name_1 }}.txt"
- config_id: "{{ config_result_2.config_id }}"
config_name: "{{ config_name_2 }}"
filename: "/tmp/{{ config_name_2 }}.txt"
register: configs_3
- name: configs (empty)
docker_swarm_service:
name: "{{ service_name }}"
image: alpine:3.8
configs: []
register: configs_4
- assert:
that:
- configs_1 is changed
- configs_2 is not changed
- configs_3 is changed
- configs_4 is changed
when: docker_api_version is version('1.30', '>=')
- assert:
that:
- configs_1 is failed
- "('version is ' ~ docker_api_version ~'. Minimum version required is 1.30') in configs_1.msg"
when: docker_api_version is version('1.30', '<')
####################################################################
## constraints #####################################################