From 35a381b17d18376e1d8b649475e3d8f0fb90861b Mon Sep 17 00:00:00 2001
From: Rafael Guterres Jeffman <rjeffman@redhat.com>
Date: Fri, 18 Jun 2021 15:46:51 -0300
Subject: [PATCH] tests: Remove ignore_errors from pwpolicy tests.

Instead of ignoring errors it is better that we specific evaluate
errors provided by negative tests. This patche removes the an
occurrence of 'ignore_errors: true' in ansible-freeipa tests.
---
 tests/pwpolicy/test_pwpolicy.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/pwpolicy/test_pwpolicy.yml b/tests/pwpolicy/test_pwpolicy.yml
index ef28ef00..03f08e0f 100644
--- a/tests/pwpolicy/test_pwpolicy.yml
+++ b/tests/pwpolicy/test_pwpolicy.yml
@@ -81,8 +81,7 @@
       ipaadmin_password: SomeADMINpassword
       state: absent
     register: result
-    ignore_errors: True
-    failed_when: (result is defined and result) or result.failed
+    failed_when: not result.failed or "'global_policy' can not be made absent." not in result.msg
 
   - name: Ensure absence of pwpolicies for group ops
     ipapwpolicy:
-- 
GitLab