Hi,

CA-less test suite always generate failures when installing revoked
certificates. This is a known issue, described in
https://fedorahosted.org/freeipa/ticket/4270 , this fix skips these
tests, outputting a notification message for the ticket.
Now it outputs this:

[amisnyov@host freeipa]$ ./make-test
ipatests/test_integration/test_caless.py:TestServerInstall.test_revoked_http    
                                                                                
                                
/usr/bin/nosetests -v --with-doctest --doctest-tests --exclude=plugins
ipatests/test_integration/test_caless.py:TestServerInstall.test_revoked_http
IPA server install with revoked HTTP certificate ... SKIP: Known
CA-less installation defect, see
https://fedorahosted.org/freeipa/ticket/4270

----------------------------------------------------------------------
Ran 1 test in 1020.253s

OK (SKIP=1)
======================================================================
passed under '/usr/bin/python2.7'

** pass **


https://fedorahosted.org/freeipa/ticket/4271

There could be another possible solution, I could write a nose plugin to
enable raising warnings instead of skipping a test. This could be
achieved by adding a @unittest.expectedFailure for a specific test, so
if it fails, it counts as an error/warning. There is a poc in a nose
ticket located in
http://code.google.com/p/python-nose/issues/detail?id=428 , not sure
how much time it takes to implement it as a plugin, or is it even
worth, because if this is implemented, we could also use this feature
when eg. DNS is not configured, this is why RFC.

Thanks
Adam
>From e3ccd04b19675dfe1ecdcffdcf229d1f54d4d9e2 Mon Sep 17 00:00:00 2001
From: Adam Misnyovszki <amisn...@redhat.com>
Date: Fri, 4 Apr 2014 10:41:51 +0200
Subject: [PATCH] CA-less tests generate failure

CA-less test suite always generate failures when installing
revoked certificates. This is a known issue, described in
https://fedorahosted.org/freeipa/ticket/4270 , this fix skips
these tests, outputting a warning for the later ticket.

https://fedorahosted.org/freeipa/ticket/4271
---
 ipatests/test_integration/test_caless.py | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/ipatests/test_integration/test_caless.py b/ipatests/test_integration/test_caless.py
index 87c523a43ed64dbf0f32fb8e0d594c8af60ce8fc..d20a8511c3741ff730e6fad13fe3d69c391cd31a 100644
--- a/ipatests/test_integration/test_caless.py
+++ b/ipatests/test_integration/test_caless.py
@@ -23,6 +23,7 @@ import shutil
 import base64
 import glob
 import contextlib
+import nose
 
 from ipalib import x509
 from ipapython import ipautil
@@ -557,6 +558,12 @@ class TestServerInstall(CALessBase):
 
         result = self.install_server(http_pkcs12='http.p12',
                                      dirsrv_pkcs12='dirsrv.p12')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_revoked_ds(self):
@@ -569,6 +576,12 @@ class TestServerInstall(CALessBase):
 
         result = self.install_server(http_pkcs12='http.p12',
                                      dirsrv_pkcs12='dirsrv.p12')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_http_intermediate_ca(self):
@@ -917,6 +930,12 @@ class TestReplicaInstall(CALessBase):
 
         result = self.prepare_replica(http_pkcs12='http.p12',
                                       dirsrv_pkcs12='dirsrv.p12')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_revoked_ds(self):
@@ -927,6 +946,12 @@ class TestReplicaInstall(CALessBase):
 
         result = self.prepare_replica(http_pkcs12='http.p12',
                                       dirsrv_pkcs12='dirsrv.p12')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_http_intermediate_ca(self):
@@ -1336,12 +1361,24 @@ class TestCertinstall(CALessBase):
         "Install new revoked HTTP certificate"
 
         result = self.certinstall('w', 'ca1/server-revoked')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_revoked_ds(self):
         "Install new revoked DS certificate"
 
         result = self.certinstall('d', 'ca1/server-revoked')
+
+        if result.returncode == 0:
+            raise nose.SkipTest(
+                "Known CA-less installation defect, see "
+                + "https://fedorahosted.org/freeipa/ticket/4270";)
+
         assert result.returncode > 0
 
     def test_http_intermediate_ca(self):
-- 
1.9.0

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to