URL: https://github.com/freeipa/freeipa/pull/5951
Author: rcritten
 Title: #5951: Test semi-generic way to pull in external repo
Action: opened

PR body:
"""
Testing in the context of https://github.com/freeipa/freeipa/pull/5932

I'm not yet sure that setup_class() is the best way to do this and IIRC DNS 
resolution can be tricky but let's see what happens.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5951/head:pr5951
git checkout pr5951
From 6d087eaeea61ae8a90b2ca6b1f9b3becef4d44ff Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Wed, 4 Aug 2021 13:23:45 -0400
Subject: [PATCH 1/3] TEMP: configure VMs with pki copr repo

---
 ipatests/test_integration/base.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py
index dc91598c0b4..84addeefa3d 100644
--- a/ipatests/test_integration/base.py
+++ b/ipatests/test_integration/base.py
@@ -40,6 +40,19 @@ class IntegrationTest:
     domain_level = None
     fips_mode = None
 
+    @classmethod
+    def setup_class(cls):
+        cls.master.run_command(
+            ['dnf', '-y', 'copr', 'enable', 'ckelley/pki']
+        )
+        cls.master.run_command(['dnf', '-y', 'update', 'pki-core'])
+
+        for replica in cls.replicas:
+            replica.run_command(
+                ['dnf', '-y', 'copr', 'enable', 'ckelley/pki']
+            )
+            replica.run_command(['dnf', '-y', 'update', 'pki-core'])
+
     @classmethod
     def host_by_role(cls, role):
         for domain in cls.get_domains():

From 7d637c5673a68964a3da10b698063e1260b99c96 Mon Sep 17 00:00:00 2001
From: Chris Kelley <ckel...@redhat.com>
Date: Tue, 27 Jul 2021 21:57:26 +0100
Subject: [PATCH 2/3] Parse getStatus as JSON not XML

On dogtagpki/pki master XML is being replaced by JSON, getStatus will
return JSON in PKI 11.0+

The PR for dogtagpki/pki that makes this change necessary is:
https://github.com/dogtagpki/pki/pull/3674
---
 install/tools/ipa-pki-wait-running.in | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/install/tools/ipa-pki-wait-running.in b/install/tools/ipa-pki-wait-running.in
index 4f0f2f34a7b..9ca6e974e55 100644
--- a/install/tools/ipa-pki-wait-running.in
+++ b/install/tools/ipa-pki-wait-running.in
@@ -13,6 +13,7 @@ import logging
 import sys
 import time
 from xml.etree import ElementTree
+import json
 
 from ipalib import api
 from ipaplatform.paths import paths
@@ -74,10 +75,19 @@ def get_status(conn, timeout):
     """
     client = SystemStatusClient(conn)
     response = client.get_status(timeout=timeout)
-    root = ElementTree.fromstring(response)
-    status = root.findtext("Status")
-    error = root.findtext("Error")
-    logging.debug("Got status '%s', error '%s'", status, error)
+    status = None
+    error = None
+    try:
+        json_response = json.loads(response)
+        status = json_response['Response']['Status']
+    except KeyError as e:
+        error = repr(e)
+    except json.JSONDecodeError:
+        logger.debug("Response is not valid JSON, try XML")
+        root = ElementTree.fromstring(response)
+        status = root.findtext("Status")
+        error = root.findtext("Error")
+    logger.debug("Got status '%s', error '%s'", status, error)
     return status, error
 
 

From fc8497f9e9779953b8d0d3acc3889c471cfe3698 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Wed, 4 Aug 2021 13:27:34 -0400
Subject: [PATCH 3/3] Temp commit

---
 .freeipa-pr-ci.yaml                        | 2 +-
 ipatests/prci_definitions/temp_commit.yaml | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index abcf8c5b634..80656690080 120000
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -1 +1 @@
-ipatests/prci_definitions/gating.yaml
\ No newline at end of file
+ipatests/prci_definitions/temp_commit.yaml
\ No newline at end of file
diff --git a/ipatests/prci_definitions/temp_commit.yaml b/ipatests/prci_definitions/temp_commit.yaml
index 4b0398b9218..78b6f68d9a4 100644
--- a/ipatests/prci_definitions/temp_commit.yaml
+++ b/ipatests/prci_definitions/temp_commit.yaml
@@ -68,7 +68,7 @@ jobs:
       class: RunPytest
       args:
         build_url: '{fedora-latest/build_url}'
-        test_suite: test_integration/test_REPLACEME.py
+        test_suite: test_integration/test_installation.py::TestInstallWithCA1
         template: *ci-master-latest
-        timeout: 3600
-        topology: *master_1repl_1client
+        timeout: 10800
+        topology: *master_3repl_1client
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to