On 02/02/2016 03:36 PM, Martin Babinsky wrote:
This was causing some of the CA ACL plugin tests to fail/error.

Possible NACK. This is not an officially supported way how to reuse fixtures. [1] I was working on a fix, that would contain all of the needed fixtures in the module that requires them. See patch attached. However, this way kind of breaks DRY principle. The official conftest.py way is not practical for us, though.


[1]: http://pytest.org/latest/fixture.html#using-fixtures-from-classes-modules-or-projects

--
Milan Kubik

From 73dc9e91605c9299e48cdf62ddc0eb4927471a57 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Tue, 2 Feb 2016 11:34:26 +0100
Subject: [PATCH] ipatests: Add missing certificate profile fixture

---
 ipatests/test_xmlrpc/test_caacl_plugin.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py
index 85c7072a0bc483822b9b5c201d61932a423dd3d8..f20b02b295024313008be7b75bdcae2ade70b4ff 100644
--- a/ipatests/test_xmlrpc/test_caacl_plugin.py
+++ b/ipatests/test_xmlrpc/test_caacl_plugin.py
@@ -11,12 +11,21 @@ import pytest
 from ipalib import errors
 from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
 
-# reuse the fixture
+from ipatests.test_xmlrpc.tracker.certprofile_plugin import CertprofileTracker
 from ipatests.test_xmlrpc.tracker.caacl_plugin import CAACLTracker
 from ipatests.test_xmlrpc.tracker.stageuser_plugin import StageUserTracker
 
 
 @pytest.fixture(scope='class')
+def default_profile(request):
+    name = 'caIPAserviceCert'
+    desc = u'Standard profile for network services'
+    tracker = CertprofileTracker(name, store=True, desc=desc)
+    tracker.track_create()
+    return tracker
+
+
+@pytest.fixture(scope='class')
 def default_acl(request):
     name = u'hosts_services_caIPAserviceCert'
     tracker = CAACLTracker(name, service_category=u'all', host_category=u'all')
-- 
2.7.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to