Re: [Freeipa-devel] [PATCH] 965 ca-less tests: fix getting cert in pem format from nssdb

2016-08-06 Thread Petr Vobornik
On 08/06/2016 12:32 PM, Petr Vobornik wrote:
> usage of ipautil.run in  get_pem methond of ca-less tests was not
> refactored when the ipautil.run was refactored in
> 099cf98307d4b2f0ace5d5e28754f264808bf59d
> 
> This results in failure of all CA-less test (probably).
> 
> Patch is untested though.
> 
> https://fedorahosted.org/freeipa/ticket/6177
> 

Original patch doesn't fix the issue. Main culprit is that output is
captured only if capture_output=True is passed to ipautil.run

Previous patch therefore just replaced old usage to new usage.

Attaching fixed path.
-- 
Petr Vobornik
From 3d66938af86c7108e0a20daf0437e0c3577bad3d Mon Sep 17 00:00:00 2001
From: Petr Vobornik 
Date: Sat, 6 Aug 2016 12:25:57 +0200
Subject: [PATCH] ca-less tests: fix getting cert in pem format from nssdb

usage of ipautil.run in  get_pem methond of ca-less tests was not
refactored when the ipautil.run was refactored in
099cf98307d4b2f0ace5d5e28754f264808bf59d

This results in failure of all CA-less test.

https://fedorahosted.org/freeipa/ticket/6177
---
 ipatests/test_integration/test_caless.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py
index 667e2b3b1d91f967b32fabdb7e472886bbdf79d7..c9d90331bd2658b7164e6a9e70f07bbc8960ff07 100644
--- a/ipatests/test_integration/test_caless.py
+++ b/ipatests/test_integration/test_caless.py
@@ -279,10 +279,10 @@ class CALessBase(IntegrationTest):
 
 @classmethod
 def get_pem(cls, nickname):
-pem_cert, _stderr, _returncode = ipautil.run(
+result = ipautil.run(
 ['certutil', '-L', '-d', 'nssdb', '-n', nickname, '-a'],
-cwd=cls.cert_dir)
-return pem_cert
+cwd=cls.cert_dir, capture_output=True)
+return result.output
 
 def verify_installation(self):
 """Verify CA cert PEM file and LDAP entry created by install
-- 
2.5.5

-- 
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] 965 ca-less tests: fix getting cert in pem format from nssdb

2016-08-06 Thread Petr Vobornik
usage of ipautil.run in  get_pem methond of ca-less tests was not
refactored when the ipautil.run was refactored in
099cf98307d4b2f0ace5d5e28754f264808bf59d

This results in failure of all CA-less test (probably).

Patch is untested though.

https://fedorahosted.org/freeipa/ticket/6177
-- 
Petr Vobornik
From 390731b873b3e47fe26b5ccd59dca39b8afeecd3 Mon Sep 17 00:00:00 2001
From: Petr Vobornik 
Date: Sat, 6 Aug 2016 12:25:57 +0200
Subject: [PATCH] ca-less tests: fix getting cert in pem format from nssdb

usage of ipautil.run in  get_pem methond of ca-less tests was not
refactored when the ipautil.run was refactored in
099cf98307d4b2f0ace5d5e28754f264808bf59d

This results in failure of all CA-less test.

https://fedorahosted.org/freeipa/ticket/6177
---
 ipatests/test_integration/test_caless.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py
index 667e2b3b1d91f967b32fabdb7e472886bbdf79d7..d443df0fe0d761c4b82145d5550aaf24df4acdb5 100644
--- a/ipatests/test_integration/test_caless.py
+++ b/ipatests/test_integration/test_caless.py
@@ -279,10 +279,10 @@ class CALessBase(IntegrationTest):
 
 @classmethod
 def get_pem(cls, nickname):
-pem_cert, _stderr, _returncode = ipautil.run(
+result = ipautil.run(
 ['certutil', '-L', '-d', 'nssdb', '-n', nickname, '-a'],
 cwd=cls.cert_dir)
-return pem_cert
+return result.output
 
 def verify_installation(self):
 """Verify CA cert PEM file and LDAP entry created by install
-- 
2.5.5

-- 
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