Sorry, of course I meant to merge in the following way.
commit 8a7fb7536dbaf23ece958237626a89005c7c6e89 Merge: a00e399 767b759 Author: Klaus Aehlig <[email protected]> Date: Fri Oct 9 11:04:28 2015 +0200 Merge branch 'stable-2.12' into stable-2.13 * stable-2.12 QA: Retrieve only the RAPI certificate QA: Allow usage of specific RAPI certificates and files QA: Reload certificates only when renew-crypto has been run QA: Restart Ganeti after adding the RAPI users file QA: Add reading the RAPI password from a file QA: Allow the RAPI user to be set QA: Do not remove nodes from cluster without destroying it QA: Refactor RAPI handling Increase default disk size of burnin to 1G break line with more than 80 characters Only search for Python-2 interpreters Fix faulty comments / indentation Handle Xen 4.3 states better * stable-2.11 (no changes) * stable-2.10 Add a test for parsing of admin_state in IAlloc backend At IAlloc backend guess state from admin state * stable-2.9 Update harep's man page to notify users of its limitations Conflicts: qa/qa_cluster.py: trivial qa/rapi-workload.py: keep removed (see c0065e0fa1730a477) diff --cc qa/qa_cluster.py index 14db293,e33552e..a4f887e --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@@ -49,10 -48,11 +48,11 @@@ import qa_erro import qa_instance import qa_job_utils import qa_logging + import qa_rapi import qa_utils -from qa_utils import AssertEqual, AssertCommand, GetCommandOutput, \ - CheckFileUnmodified +from qa_utils import AssertEqual, AssertCommand, AssertRedirectedCommand, \ + GetCommandOutput, CheckFileUnmodified # Prefix for LVM volumes created by QA code during tests @@@ -182,44 -182,8 +182,25 @@@ def TestClusterInitDisk() AssertCommand(["gnt-cluster", "init", "-D", param, name], fail=True) - def TestClusterInit(rapi_user, rapi_secret): + def TestClusterInit(): """gnt-cluster init""" - master = qa_config.GetMasterNode() - - rapi_users_path = qa_utils.MakeNodePath(master, pathutils.RAPI_USERS_FILE) - rapi_dir = os.path.dirname(rapi_users_path) - - # First create the RAPI credentials - fh = tempfile.NamedTemporaryFile() - try: - fh.write("%s %s write\n" % (rapi_user, rapi_secret)) - fh.flush() - - tmpru = qa_utils.UploadFile(master.primary, fh.name) - try: - AssertCommand(["mkdir", "-p", rapi_dir]) - AssertCommand(["mv", tmpru, rapi_users_path]) - finally: - AssertCommand(["rm", "-f", tmpru]) - finally: - fh.close() - + # If we don't modify the SSH setup by Ganeti, we have to ensure connectivity + # before ++ master = qa_config.GetMasterNode() + if not qa_config.GetModifySshSetup(): + (key_type, _, priv_key_file, pub_key_file, auth_key_path) = \ + qa_config.GetSshConfig() + AssertCommand("echo -e 'y\n' | ssh-keygen -t %s -f %s -q -N ''" + % (key_type, priv_key_file)) + AssertCommand("cat %s >> %s" % (pub_key_file, auth_key_path)) + for node in qa_config.get("nodes"): + if node != master: + for key_file in [priv_key_file, pub_key_file]: + AssertCommand("scp -oStrictHostKeyChecking=no %s %s:%s" % + (key_file, node.primary, key_file)) + AssertCommand("ssh %s \'cat %s >> %s\'" + % (node.primary, pub_key_file, auth_key_path)) + # Initialize cluster enabled_disk_templates = qa_config.GetEnabledDiskTemplates() cmd = [ diff --cc qa/qa_rapi.py index 68527b9,807383e..d997c24 --- a/qa/qa_rapi.py +++ b/qa/qa_rapi.py @@@ -32,9 -32,9 +32,10 @@@ """ +import copy import functools import itertools + import os.path import random import re import tempfile -- Klaus Aehlig Google Germany GmbH, Dienerstr. 12, 80331 Muenchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle
