render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
43fe83
From f7bff4830e9dadb1016eaa5bd9dfae7153f1304d Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <f7bff4830e9dadb1016eaa5bd9dfae7153f1304d.1377873638.git.jdenemar@redhat.com>
43fe83
From: Martin Kletzander <mkletzan@redhat.com>
43fe83
Date: Tue, 13 Aug 2013 11:32:50 +0100
43fe83
Subject: [PATCH] tests: Fix parallel runs of TLS test suites
43fe83
43fe83
For https://bugzilla.redhat.com/show_bug.cgi?id=994158
43fe83
43fe83
I noticed this yesterday and fixed it in a different way, but ended up
43fe83
with one more problem.  It was probably the way I fixed it combined
43fe83
with one more filename changed.
43fe83
43fe83
Anyway, why I'm saying this is that one more filename should be renamed
43fe83
in order to avoid a race (which I was unable to reproduce, though).
43fe83
43fe83
I checked this is the last file those two tests have in common by going
43fe83
through the code and the re-checked by this "script":
43fe83
43fe83
strace -o session.trace -e open ./virnettlssessiontest
43fe83
strace -o context.trace -e open ./virnettlscontexttest
43fe83
sort \
43fe83
 <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' context.trace | sort -u)\
43fe83
 <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' session.trace | sort -u)\
43fe83
 | uniq -d| grep '.pem$'
43fe83
43fe83
So it should be enough to make these tests independent of each other.
43fe83
43fe83
Signed-off-by: Eric Blake <eblake@redhat.com>
43fe83
(cherry picked from commit 3be7a30426d215ed50938d3674c50097b33953bf)
43fe83
---
43fe83
 tests/virnettlscontexttest.c | 8 ++++----
43fe83
 tests/virnettlssessiontest.c | 6 +++---
43fe83
 2 files changed, 7 insertions(+), 7 deletions(-)
43fe83
43fe83
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
43fe83
index 53792ee..2c7d400 100644
43fe83
--- a/tests/virnettlscontexttest.c
43fe83
+++ b/tests/virnettlscontexttest.c
43fe83
@@ -556,12 +556,12 @@ mymain(void)
43fe83
         cacertlevel2areq.crt,
43fe83
     };
43fe83
 
43fe83
-    testTLSWriteCertChain("cacertchain.pem",
43fe83
+    testTLSWriteCertChain("cacertchain-ctx.pem",
43fe83
                           certchain,
43fe83
                           ARRAY_CARDINALITY(certchain));
43fe83
 
43fe83
-    DO_CTX_TEST(true, "cacertchain.pem", servercertlevel3areq.filename, false);
43fe83
-    DO_CTX_TEST(false, "cacertchain.pem", clientcertlevel2breq.filename, false);
43fe83
+    DO_CTX_TEST(true, "cacertchain-ctx.pem", servercertlevel3areq.filename, false);
43fe83
+    DO_CTX_TEST(false, "cacertchain-ctx.pem", clientcertlevel2breq.filename, false);
43fe83
 
43fe83
     testTLSDiscardCert(&cacertreq);
43fe83
     testTLSDiscardCert(&cacert1req);
43fe83
@@ -617,7 +617,7 @@ mymain(void)
43fe83
     testTLSDiscardCert(&cacertlevel2areq);
43fe83
     testTLSDiscardCert(&servercertlevel3areq);
43fe83
     testTLSDiscardCert(&clientcertlevel2breq);
43fe83
-    unlink("cacertchain.pem");
43fe83
+    unlink("cacertchain-ctx.pem");
43fe83
 
43fe83
     testTLSCleanup(KEYFILE);
43fe83
 
43fe83
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
43fe83
index 9b171ed..f5f7212 100644
43fe83
--- a/tests/virnettlssessiontest.c
43fe83
+++ b/tests/virnettlssessiontest.c
43fe83
@@ -451,11 +451,11 @@ mymain(void)
43fe83
         cacertlevel2areq.crt,
43fe83
     };
43fe83
 
43fe83
-    testTLSWriteCertChain("cacertchain.pem",
43fe83
+    testTLSWriteCertChain("cacertchain-sess.pem",
43fe83
                           certchain,
43fe83
                           ARRAY_CARDINALITY(certchain));
43fe83
 
43fe83
-    DO_SESS_TEST("cacertchain.pem", servercertlevel3areq.filename, clientcertlevel2breq.filename,
43fe83
+    DO_SESS_TEST("cacertchain-sess.pem", servercertlevel3areq.filename, clientcertlevel2breq.filename,
43fe83
                  false, false, "libvirt.org", NULL);
43fe83
 
43fe83
     testTLSDiscardCert(&clientcertreq);
43fe83
@@ -474,7 +474,7 @@ mymain(void)
43fe83
     testTLSDiscardCert(&cacertlevel2areq);
43fe83
     testTLSDiscardCert(&servercertlevel3areq);
43fe83
     testTLSDiscardCert(&clientcertlevel2breq);
43fe83
-    unlink("cacertchain.pem");
43fe83
+    unlink("cacertchain-sess.pem");
43fe83
 
43fe83
     testTLSCleanup(KEYFILE);
43fe83
 
43fe83
-- 
43fe83
1.8.3.2
43fe83