Commit 06fcbaf1 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

QA: Make sure RAPI credentials are setup on cluster init



This patch makes sure that the Ganeti RAPI credentials are setup,
if any, on cluster init time.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 1e82a86b
......@@ -6,6 +6,9 @@
"os": "debian-etch",
"mem": "512M",
"rapi-user": "foobar",
"rapi-pass": "barfoo",
"# Lists of disk sizes": null,
"disk": ["1G", "512M"],
"disk-growth": ["2G", "768M"],
......
......@@ -79,6 +79,21 @@ def TestClusterInit():
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
# Create RAPI credentials
rapi_user = qa_config.get("rapi-user", default=None)
rapi_pass = qa_config.get("rapi-pass", default=None)
if rapi_user and rapi_pass:
cmds = []
cred_string = "%s %s write" % (rapi_user, rapi_pass)
cmds.append(("echo %s >> %s" %
(utils.ShellQuote(cred_string),
utils.ShellQuote(constants.RAPI_USERS_FILE))))
cmds.append("%s stop-master" % constants.DAEMON_UTIL)
cmds.append("%s start-master" % constants.DAEMON_UTIL)
AssertEqual(StartSSH(master['primary'], ' && '.join(cmds)).wait(), 0)
def TestClusterRename():
"""gnt-cluster rename"""
......
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