From f245c54b9e6e3f105a1d29a243d9845d21642c09 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 1 Feb 2022 14:42:04 +0100 Subject: [PATCH] Test "cockpit_packages: full" scenario This has bug reports such as [1], ensure that this generally works everywhere. [1] https://github.com/linux-system-roles/cockpit/issues/51 --- tests/tasks/cleanup.yml | 1 + tests/tests_packages_full.yml | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/tests_packages_full.yml diff --git a/tests/tasks/cleanup.yml b/tests/tasks/cleanup.yml index 0b5a2a7..541a976 100644 --- a/tests/tasks/cleanup.yml +++ b/tests/tasks/cleanup.yml @@ -4,6 +4,7 @@ # everything else depends on one of these two, so will be removed along - cockpit-bridge - cockpit-ws + - cockpit-doc state: absent tags: - always diff --git a/tests/tests_packages_full.yml b/tests/tests_packages_full.yml new file mode 100644 index 0000000..9353fae --- /dev/null +++ b/tests/tests_packages_full.yml @@ -0,0 +1,41 @@ +--- +- name: "Test cockpit_packages: full" + hosts: all + tasks: + - name: tests + block: + - include_role: + name: linux-system-roles.cockpit + vars: + cockpit_packages: full + + - meta: flush_handlers + + - package_facts: + + # basic package (part of minimal) + - name: test - cockpit-system is installed + fail: + msg: cockpit-system is not installed + when: "'cockpit-system' not in ansible_facts.packages" + + # metapackage (part of default) + - name: test - cockpit metapackage is installed + fail: + msg: cockpit is not installed + when: "'cockpit' not in ansible_facts.packages" + + # extra package (part of full) + - name: test - cockpit-pcp is installed + fail: + msg: cockpit-pcp is not installed + when: "'cockpit-pcp' not in ansible_facts.packages" + + # another extra package (part of full) + - name: test - cockpit-doc is installed + fail: + msg: cockpit-doc is not installed + when: "'cockpit-doc' not in ansible_facts.packages" + + always: + - include_tasks: tasks/cleanup.yml