From 163904fe37808a29b0e9af42e9efef8b7cb3c71f Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Mon, 18 Nov 2019 15:06:38 -0500 Subject: [PATCH] Fix timezone integration test for Fedora 31 (#65013) --- .../targets/timezone/tasks/main.yml | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/test/integration/targets/timezone/tasks/main.yml b/test/integration/targets/timezone/tasks/main.yml index 92f0b8c59bf..91858918a27 100644 --- a/test/integration/targets/timezone/tasks/main.yml +++ b/test/integration/targets/timezone/tasks/main.yml @@ -42,16 +42,27 @@ systemd: name: dbus state: started - when: ansible_service_mgr == 'systemd' and ansible_distribution == 'Fedora' + when: + - ansible_service_mgr == 'systemd' + - ansible_distribution == 'Fedora' + - ansible_facts.distribution_major_version is version('31', '<') -- name: set timezone to Etc/UTC - timezone: - name: Etc/UTC - register: original_timezone -- block: - - include: test.yml - always: - - name: Restore original system timezone - {{ original_timezone.diff.before.name }} +- name: Run tests + # Skip tests on Fedora 31 because dbus fails to start unless the container is run in priveleged mode. + # Even then, it starts unreliably. This may be due to the move to cgroup v2 in Fedora 31. + # https://www.redhat.com/sysadmin/fedora-31-control-group-v2 + when: ansible_facts.distribution ~ ansible_facts.distribution_major_version != 'Fedora31' + block: + - name: set timezone to Etc/UTC timezone: - name: "{{ original_timezone.diff.before.name }}" + name: Etc/UTC + register: original_timezone + + - block: + - include_tasks: test.yml + always: + - name: Restore original system timezone - {{ original_timezone.diff.before.name }} + timezone: + name: "{{ original_timezone.diff.before.name }}" + when: original_timezone is changed