From e5d7a6258d48990639c5e3a533b5ca571292b0c5 Mon Sep 17 00:00:00 2001 From: Pugazhendhi Ramakrishnan Date: Mon, 16 Dec 2024 16:23:14 +0530 Subject: [PATCH 1/5] updated the test_rhui_certificate_date --- test_suite/cloud/test_azure.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test_suite/cloud/test_azure.py b/test_suite/cloud/test_azure.py index d9598a54..533d9513 100644 --- a/test_suite/cloud/test_azure.py +++ b/test_suite/cloud/test_azure.py @@ -313,8 +313,17 @@ def test_rhui_certificate_date(self, host): cert_found = False if test_lib.is_rhel_sap(host): - cert_file = '/etc/pki/rhui/product/content-sap-ha.crt' - cert_found = host.file(cert_file).exists + possible_sap_cert_files = [ + '/etc/pki/rhui/product/content-sap-ha.crt', + '/etc/pki/rhui/product/content-base-sap-ha.crt' + ] + for cert in possible_sap_cert_files: + if host.file(cert).exists: + cert_file = cert + cert_found = True + break +# cert_found = host.file(cert_file).exists + else: possible_cert_files = [ '/etc/pki/rhui/product/content.crt', From c4e0e39804813e07d5ebeea3051a89584b6bb641 Mon Sep 17 00:00:00 2001 From: Nicolas Munoz Date: Thu, 16 Jan 2025 14:26:23 +0900 Subject: [PATCH 2/5] Revert "updated the test_rhui_certificate_date" This reverts commit b99628d039063fab8d31a1a5ed16219428fa16d6. --- test_suite/cloud/test_azure.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test_suite/cloud/test_azure.py b/test_suite/cloud/test_azure.py index 533d9513..d9598a54 100644 --- a/test_suite/cloud/test_azure.py +++ b/test_suite/cloud/test_azure.py @@ -313,17 +313,8 @@ def test_rhui_certificate_date(self, host): cert_found = False if test_lib.is_rhel_sap(host): - possible_sap_cert_files = [ - '/etc/pki/rhui/product/content-sap-ha.crt', - '/etc/pki/rhui/product/content-base-sap-ha.crt' - ] - for cert in possible_sap_cert_files: - if host.file(cert).exists: - cert_file = cert - cert_found = True - break -# cert_found = host.file(cert_file).exists - + cert_file = '/etc/pki/rhui/product/content-sap-ha.crt' + cert_found = host.file(cert_file).exists else: possible_cert_files = [ '/etc/pki/rhui/product/content.crt', From a1cd2b990877a98521368ea2d8b7c7ccaf413ed4 Mon Sep 17 00:00:00 2001 From: Pugazhendhi Ramakrishnan Date: Mon, 16 Dec 2024 16:23:14 +0530 Subject: [PATCH 3/5] updated the test_rhui_certificate_date --- test_suite/cloud/test_azure.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test_suite/cloud/test_azure.py b/test_suite/cloud/test_azure.py index d9598a54..533d9513 100644 --- a/test_suite/cloud/test_azure.py +++ b/test_suite/cloud/test_azure.py @@ -313,8 +313,17 @@ def test_rhui_certificate_date(self, host): cert_found = False if test_lib.is_rhel_sap(host): - cert_file = '/etc/pki/rhui/product/content-sap-ha.crt' - cert_found = host.file(cert_file).exists + possible_sap_cert_files = [ + '/etc/pki/rhui/product/content-sap-ha.crt', + '/etc/pki/rhui/product/content-base-sap-ha.crt' + ] + for cert in possible_sap_cert_files: + if host.file(cert).exists: + cert_file = cert + cert_found = True + break +# cert_found = host.file(cert_file).exists + else: possible_cert_files = [ '/etc/pki/rhui/product/content.crt', From 7de106bc6b5540213365c3b1bd9b77e94a622dee Mon Sep 17 00:00:00 2001 From: Nicolas Munoz Date: Thu, 16 Jan 2025 15:07:22 +0900 Subject: [PATCH 4/5] Fixes from live code review with Pugal. --- test_suite/cloud/test_azure.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/test_suite/cloud/test_azure.py b/test_suite/cloud/test_azure.py index 533d9513..ece4aabf 100644 --- a/test_suite/cloud/test_azure.py +++ b/test_suite/cloud/test_azure.py @@ -313,28 +313,21 @@ def test_rhui_certificate_date(self, host): cert_found = False if test_lib.is_rhel_sap(host): - possible_sap_cert_files = [ + possible_cert_files = [ '/etc/pki/rhui/product/content-sap-ha.crt', '/etc/pki/rhui/product/content-base-sap-ha.crt' - ] - for cert in possible_sap_cert_files: - if host.file(cert).exists: - cert_file = cert - cert_found = True - break -# cert_found = host.file(cert_file).exists - + ] else: possible_cert_files = [ '/etc/pki/rhui/product/content.crt', '/etc/pki/rhui/product/content-base.crt' ] - for cert in possible_cert_files: - if host.file(cert).exists: - cert_file = cert - cert_found = True - break + for cert in possible_cert_files: + if host.file(cert).exists: + cert_file = cert + cert_found = True + break assert cert_found, 'The RHUI certificate was not found.' From e354bc6070a0a6fd9e45911191b68161be882dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20M=2E?= Date: Tue, 21 Jan 2025 11:11:53 +0900 Subject: [PATCH 5/5] Fix indentation in test_azure.py --- test_suite/cloud/test_azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_suite/cloud/test_azure.py b/test_suite/cloud/test_azure.py index ece4aabf..98c933c0 100644 --- a/test_suite/cloud/test_azure.py +++ b/test_suite/cloud/test_azure.py @@ -314,8 +314,8 @@ def test_rhui_certificate_date(self, host): if test_lib.is_rhel_sap(host): possible_cert_files = [ - '/etc/pki/rhui/product/content-sap-ha.crt', - '/etc/pki/rhui/product/content-base-sap-ha.crt' + '/etc/pki/rhui/product/content-sap-ha.crt', + '/etc/pki/rhui/product/content-base-sap-ha.crt' ] else: possible_cert_files = [