Commit 2e795f2c authored by Helga Velroyen's avatar Helga Velroyen

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: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent d40f0bc6
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment