From: Helga Velroyen Date: Thu, 18 Jun 2015 13:52:30 +0000 (+0200) Subject: QA: reload rapi cert after renew crypto X-Git-Tag: v2.12.5~24 X-Git-Url: http://git.ganeti.org/?p=ganeti-github.git;a=commitdiff_plain;h=2e795f2c81fb37400fa227f87a4079cac4afaed5;ds=sidebyside QA: reload rapi cert after renew crypto When running the QA, we copy the rapi certficate to the machine which steers the QA to use it later in the QA for testing RAPI calls. However, before we get to that part of the QA, the rapi certificate is replaced when 'gnt-renew crypto' is called. This patch makes sure that the new rapi certificate is copied to the steering machine so that later RAPI calls do not fail. It remains mysterious how this worked before. Signed-off-by: Helga Velroyen Reviewed-by: Klaus Aehlig --- diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index f5da39e..1d168cf 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -235,13 +235,30 @@ def SetupCluster(rapi_user): return rapi_secret -def RunClusterTests(): +def RunClusterTests(rapi_user=None, rapi_secret=None): """Runs tests related to gnt-cluster. + @type rapi_user: string + @param rapi_user: name of the rapi user + @type rapi_secret: string + @param rapi_secret: the rapi secret + """ for test, fn in [ ("create-cluster", qa_cluster.TestClusterInitDisk), - ("cluster-renew-crypto", qa_cluster.TestClusterRenewCrypto), + ("cluster-renew-crypto", qa_cluster.TestClusterRenewCrypto) + ]: + RunTestIf(test, fn) + + # Since renew-crypto replaces the RAPI cert, reload it. + if qa_rapi.Enabled(): + if not rapi_user: + raise qa_error.Error("No RAPI user given.") + if not rapi_secret: + raise qa_error.Error("No RAPI secret given.") + qa_rapi.Setup(rapi_user, rapi_secret) + + for test, fn in [ ("cluster-verify", qa_cluster.TestClusterVerify), ("cluster-reserved-lvs", qa_cluster.TestClusterReservedLvs), # TODO: add more cluster modify tests @@ -926,7 +943,7 @@ def RunQa(): # Load RAPI certificate qa_rapi.Setup(rapi_user, rapi_secret) - RunTestBlock(RunClusterTests) + RunTestBlock(RunClusterTests, rapi_user=rapi_user, rapi_secret=rapi_secret) RunTestBlock(RunOsTests) RunTestIf("tags", qa_tags.TestClusterTags)