From bc0fa36bb8d03d14ee6b9e0c0ddd3c708c19e664 Mon Sep 17 00:00:00 2001 From: Jan-Luca Kiok Date: Mon, 31 Jan 2022 14:00:43 +0100 Subject: [PATCH] test(ucr): Fail ucr get tasks directly instead of asserting later --- .../univention_config_registry/tasks/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/integration/targets/univention_config_registry/tasks/main.yml b/tests/integration/targets/univention_config_registry/tasks/main.yml index 5948685..84a6920 100644 --- a/tests/integration/targets/univention_config_registry/tasks/main.yml +++ b/tests/integration/targets/univention_config_registry/tasks/main.yml @@ -9,16 +9,14 @@ - name: "Get ansible/foo" ansible.builtin.command: "univention-config-registry get ansible/foo" register: "ansible_foo" + changed_when: "ansible_foo.stdout = ''" + failed_when: "'bar' not in ansible_foo.stdout" - name: "Get stats cron" ansible.builtin.command: "tail -2 /etc/cron.d/univention-system-stats" register: "sys_cron" - -- name: "Check settings" - ansible.builtin.assert: - that: - - "'bar' in ansible_foo.stdout" - - "'1 2 3 4 5' in sys_cron.stdout" + changed_when: "sys_cron.stdout = ''" + failed_when: "'1 2 3 4 5' not in sys_cron.stdout" - name: "Set /etc/hosts entries" univention_config_registry: @@ -37,6 +35,8 @@ check_mode: true register: "hosts" failed_when: "(hosts is changed) or (hosts is failed)" + tags: + - "skip_ansible_lint" - name: "Clear test key" univention_config_registry: @@ -47,6 +47,8 @@ - name: "Get ansible/foo" ansible.builtin.command: "univention-config-registry get ansible/foo" register: "ansible_foo" + changed_when: "ansible_foo.stdout != ''" + failed_when: "ansible_foo.stdout != ''" - name: "Check cleared key" ansible.builtin.assert: