Commit a62d1901 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

qa: Use qa_utils.UploadFile to upload rapi_users file

Just using “echo” would use whatever umask is set in the shell,
in addition to potentially showing the password in the process
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarRené Nussbaumer <>
parent 747c9ca9
...@@ -61,12 +61,24 @@ def TestClusterInit(rapi_user, rapi_secret): ...@@ -61,12 +61,24 @@ def TestClusterInit(rapi_user, rapi_secret):
master = qa_config.GetMasterNode() master = qa_config.GetMasterNode()
# First create the RAPI credentials # First create the RAPI credentials
cred_string = "%s %s write" % (rapi_user, rapi_secret) fh = tempfile.NamedTemporaryFile()
cmd = ("echo %s > %s" % try:
(utils.ShellQuote(cred_string), fh.write("%s %s write\n" % (rapi_user, rapi_secret))
utils.ShellQuote(constants.RAPI_USERS_FILE))) fh.flush()
AssertEqual(StartSSH(master['primary'], cmd).wait(), 0)
tmpru = qa_utils.UploadFile(master["primary"],
cmd = ["mv", tmpru, constants.RAPI_USERS_FILE]
utils.ShellQuoteArgs(cmd)).wait(), 0)
cmd = ["rm", "-f", tmpru]
utils.ShellQuoteArgs(cmd)).wait(), 0)
# Initialize cluster
cmd = ['gnt-cluster', 'init'] cmd = ['gnt-cluster', 'init']
if master.get('secondary', None): if master.get('secondary', None):
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