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
......@@ -164,6 +164,7 @@ def RunClusterTests():
("cluster-command", qa_cluster.TestClusterCommand),
("cluster-burnin", qa_cluster.TestClusterBurnin),
("cluster-master-failover", qa_cluster.TestClusterMasterFailover),
("cluster-oob", qa_cluster.TestClusterOob),
("rapi", qa_rapi.TestVersion),
("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
# it under the terms of the GNU General Public License as published by
......@@ -118,8 +118,8 @@ def TestClusterRename():
AssertCommand(data)
def TestClusterVerify():
"""gnt-cluster verify"""
def TestClusterOob():
"""out-of-band framework"""
oob_path_exists = "/tmp/ganeti-qa-oob-does-exist-%s" % utils.NewUUID()
AssertCommand(["gnt-cluster", "verify"])
......@@ -129,10 +129,9 @@ def TestClusterVerify():
AssertCommand(["gnt-cluster", "verify"], fail=True)
for node in qa_config.get("nodes"):
node_name = node["primary"]
remote_file = qa_utils.UploadData(node_name, "", mode=0400)
AssertCommand(["mv", remote_file, oob_path_exists], node=node_name)
AssertCommand(["touch", oob_path_exists])
AssertCommand(["chmod", "0400", oob_path_exists])
AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
try:
AssertCommand(["gnt-cluster", "modify", "--node-parameters",
......@@ -140,18 +139,19 @@ def TestClusterVerify():
AssertCommand(["gnt-cluster", "verify"], fail=True)
for node in qa_config.get("nodes"):
node_name = node["primary"]
AssertCommand(["chmod", "0500", oob_path_exists], node=node_name)
AssertCommand(["chmod", "0500", oob_path_exists])
AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
AssertCommand(["gnt-cluster", "verify"])
finally:
for node in qa_config.get("nodes"):
node_name = node["primary"]
AssertCommand(["rm", oob_path_exists], node=node_name)
AssertCommand(["gnt-cluster", "command", "rm", oob_path_exists])
AssertCommand(["gnt-cluster", "modify", "--node-parameters",
"oob_program="])
def TestClusterVerify():
"""gnt-cluster verify"""
AssertCommand(["gnt-cluster", "verify"])
......
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