Re: [Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
On 02/09/2016 04:06 PM, Milan Kubík wrote: On 02/09/2016 02:37 PM, Milan Kubík wrote: Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. Patch updated with trac link -- Milan Kubik ACK I guess, although copypasta makes me very sad. Why do you think the conftest.py approach is not practical for us? -- Martin^3 Babinsky -- 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
Re: [Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
On 02/11/2016 10:00 AM, Martin Babinsky wrote: On 02/09/2016 04:06 PM, Milan Kubík wrote: On 02/09/2016 02:37 PM, Milan Kubík wrote: Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. Patch updated with trac link -- Milan Kubik ACK I guess, although copypasta makes me very sad. Why do you think the conftest.py approach is not practical for us? I think introducing new file to hold shared fixtures is not worth managing it and it also hides (by the virtue of pytest's working) from where the fixture comes. I think it is better in our case to have all fixtures the test uses in its module, even though it looks like copy-pasting. If I had renamed the entry for the test only, would it still been considered copy-paste? Anyway, patch for ipa-4-3 attached. -- Milan Kubik From 7615c5ca6bed0392d1483840c828119eff4306f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Kub=C3=ADk?=Date: Tue, 2 Feb 2016 11:34:26 +0100 Subject: [PATCH] ipatests: Add missing certificate profile fixture https://fedorahosted.org/freeipa/ticket/5630 --- ipatests/test_xmlrpc/test_caacl_plugin.py | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py index d5ded19516ec917bcb2e90034b4fac8a6324b2e9..f20b02b295024313008be7b75bdcae2ade70b4ff 100644 --- a/ipatests/test_xmlrpc/test_caacl_plugin.py +++ b/ipatests/test_xmlrpc/test_caacl_plugin.py @@ -11,13 +11,21 @@ import pytest from ipalib import errors from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test -# reuse the fixture -from ipatests.test_xmlrpc.test_certprofile_plugin import default_profile +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.1 -- 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
Re: [Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
On 02/11/2016 02:08 PM, Milan Kubík wrote: On 02/11/2016 10:00 AM, Martin Babinsky wrote: On 02/09/2016 04:06 PM, Milan Kubík wrote: On 02/09/2016 02:37 PM, Milan Kubík wrote: Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. Patch updated with trac link -- Milan Kubik ACK I guess, although copypasta makes me very sad. Why do you think the conftest.py approach is not practical for us? I think introducing new file to hold shared fixtures is not worth managing it and it also hides (by the virtue of pytest's working) from where the fixture comes. I think it is better in our case to have all fixtures the test uses in its module, even though it looks like copy-pasting. If I had renamed the entry for the test only, would it still been considered copy-paste? Anyway, patch for ipa-4-3 attached. ACK to both. -- Martin^3 Babinsky -- 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
Re: [Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
On 11.02.2016 14:12, Martin Babinsky wrote: On 02/11/2016 02:08 PM, Milan Kubík wrote: On 02/11/2016 10:00 AM, Martin Babinsky wrote: On 02/09/2016 04:06 PM, Milan Kubík wrote: On 02/09/2016 02:37 PM, Milan Kubík wrote: Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. Patch updated with trac link -- Milan Kubik ACK I guess, although copypasta makes me very sad. Why do you think the conftest.py approach is not practical for us? I think introducing new file to hold shared fixtures is not worth managing it and it also hides (by the virtue of pytest's working) from where the fixture comes. I think it is better in our case to have all fixtures the test uses in its module, even though it looks like copy-pasting. If I had renamed the entry for the test only, would it still been considered copy-paste? Anyway, patch for ipa-4-3 attached. ACK to both. Pushed to master: 87ee451c7d9b311192893b2a2c82d8d757281fa6 Pushed to ipa-4-3: 8aec20124d415daeea3764294224fea47f8e7b0a -- 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
Re: [Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
On 02/09/2016 02:37 PM, Milan Kubík wrote: Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. Patch updated with trac link -- Milan Kubik From 0779fb587d10cb8fd8f7b7293527be623b078077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Kub=C3=ADk?=Date: Tue, 2 Feb 2016 11:34:26 +0100 Subject: [PATCH] ipatests: Add missing certificate profile fixture https://fedorahosted.org/freeipa/ticket/5630 --- 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.1 -- 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
[Freeipa-devel] [patch 0032] ipatests: add missing certprofile fixture
Fixes the CA ACL tests broken by removed import. This patch doesn't rely on undocumented behavior of pytest. The patch invalidates patch 133 by Martin Babinsky. -- Milan Kubik From 73dc9e91605c9299e48cdf62ddc0eb4927471a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Kub=C3=ADk?=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