QA: Reload certificates only when renew-crypto has been run
authorHrvoje Ribicic <riba@google.com>
Thu, 24 Sep 2015 10:36:31 +0000 (12:36 +0200)
committerHrvoje Ribicic <riba@google.com>
Thu, 8 Oct 2015 14:03:12 +0000 (16:03 +0200)
When the cluster refreshes the RAPI certificate as it does in the
renew-crypto test, the stored certificate in the curl config of the
RAPI client has to be renewed. But it should only be renewed when the
test is enabled, so this patch moves that code into the test.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Lisa Velden <velden@google.com>

qa/ganeti-qa.py
qa/qa_cluster.py

index 9c8a058..fa54bd7 100755 (executable)
@@ -238,10 +238,6 @@ def RunClusterTests():
     ]:
     RunTestIf(test, fn)
 
-  # Since renew-crypto replaces the RAPI cert, reload it.
-  if qa_rapi.Enabled():
-    qa_rapi.ReloadCertificates()
-
   for test, fn in [
     ("cluster-verify", qa_cluster.TestClusterVerify),
     ("cluster-reserved-lvs", qa_cluster.TestClusterReservedLvs),
index cf4a08e..e33552e 100644 (file)
@@ -48,6 +48,7 @@ import qa_error
 import qa_instance
 import qa_job_utils
 import qa_logging
+import qa_rapi
 import qa_utils
 
 from qa_utils import AssertEqual, AssertCommand, GetCommandOutput, \
@@ -1240,6 +1241,10 @@ def TestClusterRenewCrypto():
   finally:
     AssertCommand(["rm", "-f", rapi_cert_backup])
 
+  # Since renew-crypto replaced the RAPI cert, reload it.
+  if qa_rapi.Enabled():
+    qa_rapi.ReloadCertificates()
+
 
 def TestClusterBurnin():
   """Burnin"""