Re: [PATCH] Fix parallel runs of TLS test suites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2013 12:29 AM, Eric Blake wrote:
> On 08/08/2013 04:09 PM, Daniel P. Berrange wrote:
>> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
>>
>> Use a seperate keyfile name for the two TLS test suites so that
> 
> s/seperate/separate/
> 
>> they don't clash when running tests in parallel
>>
>> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
>> ---
>>  tests/virnettlscontexttest.c | 10 ++++++----
>>  tests/virnettlshelpers.c     |  6 ++----
>>  tests/virnettlshelpers.h     |  6 ++----
>>  tests/virnettlssessiontest.c | 10 ++++++----
>>  4 files changed, 16 insertions(+), 16 deletions(-)
> 
> ACK.
> 

I noticed this yesterday and fixed it in a different way, but ended up
with one more problem.  It was probably the way I fixed it combined
with one more filename changed.

Anyway, why I'm saying this is that one more filename should be renamed
in order to avoid a race (which I was unable to reproduce, though).
Consider squashing the following in before pushing.

I checked this is the last file those two tests have in common by going
through the code and the re-checked by this "script":

strace -o session.trace -e open ./virnettlssessiontest
strace -o context.trace -e open ./virnettlscontexttest
sort \
 <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' context.trace | sort -u)\
 <(sed -n '/^open/s/open("\([^"]*\)",.*$/\1/p' session.trace | sort -u)\
 | uniq -d| grep '.pem$'

So it should be enough to make these tests independent of each other.

diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index 53792ee..2c7d400 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -556,12 +556,12 @@ mymain(void)
         cacertlevel2areq.crt,
     };

-    testTLSWriteCertChain("cacertchain.pem",
+    testTLSWriteCertChain("cacertchain-ctx.pem",
                           certchain,
                           ARRAY_CARDINALITY(certchain));

-    DO_CTX_TEST(true, "cacertchain.pem", servercertlevel3areq.filename, false);
-    DO_CTX_TEST(false, "cacertchain.pem", clientcertlevel2breq.filename, false);
+    DO_CTX_TEST(true, "cacertchain-ctx.pem", servercertlevel3areq.filename, false);
+    DO_CTX_TEST(false, "cacertchain-ctx.pem", clientcertlevel2breq.filename, false);

     testTLSDiscardCert(&cacertreq);
     testTLSDiscardCert(&cacert1req);
@@ -617,7 +617,7 @@ mymain(void)
     testTLSDiscardCert(&cacertlevel2areq);
     testTLSDiscardCert(&servercertlevel3areq);
     testTLSDiscardCert(&clientcertlevel2breq);
-    unlink("cacertchain.pem");
+    unlink("cacertchain-ctx.pem");

     testTLSCleanup(KEYFILE);

diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index 9b171ed..f5f7212 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -451,11 +451,11 @@ mymain(void)
         cacertlevel2areq.crt,
     };

-    testTLSWriteCertChain("cacertchain.pem",
+    testTLSWriteCertChain("cacertchain-sess.pem",
                           certchain,
                           ARRAY_CARDINALITY(certchain));

-    DO_SESS_TEST("cacertchain.pem", servercertlevel3areq.filename, clientcertlevel2breq.filename,
+    DO_SESS_TEST("cacertchain-sess.pem", servercertlevel3areq.filename, clientcertlevel2breq.filename,
                  false, false, "libvirt.org", NULL);

     testTLSDiscardCert(&clientcertreq);
@@ -474,7 +474,7 @@ mymain(void)
     testTLSDiscardCert(&cacertlevel2areq);
     testTLSDiscardCert(&servercertlevel3areq);
     testTLSDiscardCert(&clientcertlevel2breq);
-    unlink("cacertchain.pem");
+    unlink("cacertchain-sess.pem");

     testTLSCleanup(KEYFILE);

--

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]