From bd5923cf5e997ff95015e25fec993acb2aee170a Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 16 Aug 2023 12:41:33 +0100 Subject: [PATCH] Ensure test exclusion file is removed when there are no exclusions If the role variable overrides are updated to remove a set of existing tempest test exclusions, the previous exclusions file remains on the disk even though it is not use, and not passed to the tempest command. This is confusing and the file should not be present unless there are active exclusions in place. Change-Id: I5d69bf6258a00ade825cd3c746d1443dc1a35120 --- tasks/tempest_post_install.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/tempest_post_install.yml b/tasks/tempest_post_install.yml index c7a5c29d..c50ef15c 100644 --- a/tasks/tempest_post_install.yml +++ b/tasks/tempest_post_install.yml @@ -185,6 +185,13 @@ when: - _tempest_test_excludelist | length > 0 +- name: Remove tempest test exclude list when there are no exclusions + file: + path: "{{ tempest_excludelist_file_path }}" + state: absent + when: + - tempest_test_excludelist | length == 0 + - name: Drop test_accounts_file copy: content: "{{ tempest_test_accounts }}"