From c4052295531751dd6ea3dd13cf90ba9d23bb0901 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 21 Oct 2025 15:27:31 -0300 Subject: [PATCH] ipacert: Fix tests for inexistent certificate After a PKI update the message returned for 'cert_show' in the case of an inexistent certificate has changed, causing tests to fail. The fix is only required for the tests, as the behavior has not changed. Signed-off-by: Rafael Guterres Jeffman --- tests/cert/test_cert_host.yml | 2 +- tests/cert/test_cert_service.yml | 2 +- tests/cert/test_cert_user.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cert/test_cert_host.yml b/tests/cert/test_cert_host.yml index a40850eb..89b4203e 100644 --- a/tests/cert/test_cert_host.yml +++ b/tests/cert/test_cert_host.yml @@ -124,7 +124,7 @@ reason: 9 state: revoked register: result - failed_when: not (result.failed and ("Request failed with status 404" in result.msg or "Certificate serial number 0x123456789 not found" in result.msg)) + failed_when: not (result.failed and ("Request failed with status 404" in result.msg or result.msg is regex("Certificate [^0]*0x123456789 not found"))) - name: Try to release revoked certificate ipacert: diff --git a/tests/cert/test_cert_service.yml b/tests/cert/test_cert_service.yml index 2089fc3d..ce8365fa 100644 --- a/tests/cert/test_cert_service.yml +++ b/tests/cert/test_cert_service.yml @@ -136,7 +136,7 @@ reason: 9 state: revoked register: result - failed_when: not (result.failed and ("Request failed with status 404" in result.msg or "Certificate serial number 0x123456789 not found" in result.msg)) + failed_when: not (result.failed and ("Request failed with status 404" in result.msg or result.msg is regex("Certificate [^0]*0x123456789 not found"))) - name: Try to release revoked certificate ipacert: diff --git a/tests/cert/test_cert_user.yml b/tests/cert/test_cert_user.yml index 4a85b459..cf6a1686 100644 --- a/tests/cert/test_cert_user.yml +++ b/tests/cert/test_cert_user.yml @@ -123,7 +123,7 @@ reason: 9 state: revoked register: result - failed_when: not (result.failed and ("Request failed with status 404" in result.msg or "Certificate serial number 0x123456789 not found" in result.msg)) + failed_when: not (result.failed and ("Request failed with status 404" in result.msg or result.msg is regex("Certificate [^0]*0x123456789 not found"))) - name: Try to release revoked certificate ipacert: