Skip to content
Snippets Groups Projects
Commit 69df9d2b authored by Iustin Pop's avatar Iustin Pop
Browse files

QA: Fix duplicated OOB tests


Patch f55312bd added the OOB tests to TestClusterVerify, which is not
actually a test for cluster verify, but a runner for cluster verify
that is called multiple times, for each instance type, etc. This led
to running the OOB commands multiple times, which is painful
especially as this is a slow test.

The patch moves this to a separate test, that is run only once.

Furthermore, the way that data files are copied around is very
inefficient: touch + mv + chmod + mv + rm for each node (5 times
number of nodes), whereas it could be simply: touch on master, chmod
on master, cluster copyfile, chmod on master, cluster copyfile,
cluster command rm, i.e. only 5 fixed ssh calls to the master. The
code is changed as such, for increased speed.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7b0bf9cd
No related branches found
No related tags found
No related merge requests found
...@@ -164,6 +164,7 @@ def RunClusterTests(): ...@@ -164,6 +164,7 @@ def RunClusterTests():
("cluster-command", qa_cluster.TestClusterCommand), ("cluster-command", qa_cluster.TestClusterCommand),
("cluster-burnin", qa_cluster.TestClusterBurnin), ("cluster-burnin", qa_cluster.TestClusterBurnin),
("cluster-master-failover", qa_cluster.TestClusterMasterFailover), ("cluster-master-failover", qa_cluster.TestClusterMasterFailover),
("cluster-oob", qa_cluster.TestClusterOob),
("rapi", qa_rapi.TestVersion), ("rapi", qa_rapi.TestVersion),
("rapi", qa_rapi.TestEmptyCluster), ("rapi", qa_rapi.TestEmptyCluster),
]: ]:
......
# #
# #
# Copyright (C) 2007, 2010 Google Inc. # Copyright (C) 2007, 2010, 2011 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -118,8 +118,8 @@ def TestClusterRename(): ...@@ -118,8 +118,8 @@ def TestClusterRename():
AssertCommand(data) AssertCommand(data)
def TestClusterVerify(): def TestClusterOob():
"""gnt-cluster verify""" """out-of-band framework"""
oob_path_exists = "/tmp/ganeti-qa-oob-does-exist-%s" % utils.NewUUID() oob_path_exists = "/tmp/ganeti-qa-oob-does-exist-%s" % utils.NewUUID()
AssertCommand(["gnt-cluster", "verify"]) AssertCommand(["gnt-cluster", "verify"])
...@@ -129,10 +129,9 @@ def TestClusterVerify(): ...@@ -129,10 +129,9 @@ def TestClusterVerify():
AssertCommand(["gnt-cluster", "verify"], fail=True) AssertCommand(["gnt-cluster", "verify"], fail=True)
for node in qa_config.get("nodes"): AssertCommand(["touch", oob_path_exists])
node_name = node["primary"] AssertCommand(["chmod", "0400", oob_path_exists])
remote_file = qa_utils.UploadData(node_name, "", mode=0400) AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
AssertCommand(["mv", remote_file, oob_path_exists], node=node_name)
try: try:
AssertCommand(["gnt-cluster", "modify", "--node-parameters", AssertCommand(["gnt-cluster", "modify", "--node-parameters",
...@@ -140,18 +139,19 @@ def TestClusterVerify(): ...@@ -140,18 +139,19 @@ def TestClusterVerify():
AssertCommand(["gnt-cluster", "verify"], fail=True) AssertCommand(["gnt-cluster", "verify"], fail=True)
for node in qa_config.get("nodes"): AssertCommand(["chmod", "0500", oob_path_exists])
node_name = node["primary"] AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
AssertCommand(["chmod", "0500", oob_path_exists], node=node_name)
AssertCommand(["gnt-cluster", "verify"]) AssertCommand(["gnt-cluster", "verify"])
finally: finally:
for node in qa_config.get("nodes"): AssertCommand(["gnt-cluster", "command", "rm", oob_path_exists])
node_name = node["primary"]
AssertCommand(["rm", oob_path_exists], node=node_name)
AssertCommand(["gnt-cluster", "modify", "--node-parameters", AssertCommand(["gnt-cluster", "modify", "--node-parameters",
"oob_program="]) "oob_program="])
def TestClusterVerify():
"""gnt-cluster verify"""
AssertCommand(["gnt-cluster", "verify"]) AssertCommand(["gnt-cluster", "verify"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment