1 |
1 |
#
|
2 |
2 |
#
|
3 |
3 |
|
4 |
|
# Copyright (C) 2007, 2010 Google Inc.
|
|
4 |
# Copyright (C) 2007, 2010, 2011 Google Inc.
|
5 |
5 |
#
|
6 |
6 |
# This program is free software; you can redistribute it and/or modify
|
7 |
7 |
# it under the terms of the GNU General Public License as published by
|
... | ... | |
118 |
118 |
AssertCommand(data)
|
119 |
119 |
|
120 |
120 |
|
121 |
|
def TestClusterVerify():
|
122 |
|
"""gnt-cluster verify"""
|
|
121 |
def TestClusterOob():
|
|
122 |
"""out-of-band framework"""
|
123 |
123 |
oob_path_exists = "/tmp/ganeti-qa-oob-does-exist-%s" % utils.NewUUID()
|
124 |
124 |
|
125 |
125 |
AssertCommand(["gnt-cluster", "verify"])
|
... | ... | |
129 |
129 |
|
130 |
130 |
AssertCommand(["gnt-cluster", "verify"], fail=True)
|
131 |
131 |
|
132 |
|
for node in qa_config.get("nodes"):
|
133 |
|
node_name = node["primary"]
|
134 |
|
remote_file = qa_utils.UploadData(node_name, "", mode=0400)
|
135 |
|
AssertCommand(["mv", remote_file, oob_path_exists], node=node_name)
|
|
132 |
AssertCommand(["touch", oob_path_exists])
|
|
133 |
AssertCommand(["chmod", "0400", oob_path_exists])
|
|
134 |
AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
|
136 |
135 |
|
137 |
136 |
try:
|
138 |
137 |
AssertCommand(["gnt-cluster", "modify", "--node-parameters",
|
... | ... | |
140 |
139 |
|
141 |
140 |
AssertCommand(["gnt-cluster", "verify"], fail=True)
|
142 |
141 |
|
143 |
|
for node in qa_config.get("nodes"):
|
144 |
|
node_name = node["primary"]
|
145 |
|
AssertCommand(["chmod", "0500", oob_path_exists], node=node_name)
|
|
142 |
AssertCommand(["chmod", "0500", oob_path_exists])
|
|
143 |
AssertCommand(["gnt-cluster", "copyfile", oob_path_exists])
|
146 |
144 |
|
147 |
145 |
AssertCommand(["gnt-cluster", "verify"])
|
148 |
146 |
finally:
|
149 |
|
for node in qa_config.get("nodes"):
|
150 |
|
node_name = node["primary"]
|
151 |
|
AssertCommand(["rm", oob_path_exists], node=node_name)
|
|
147 |
AssertCommand(["gnt-cluster", "command", "rm", oob_path_exists])
|
152 |
148 |
|
153 |
149 |
AssertCommand(["gnt-cluster", "modify", "--node-parameters",
|
154 |
150 |
"oob_program="])
|
|
151 |
|
|
152 |
|
|
153 |
def TestClusterVerify():
|
|
154 |
"""gnt-cluster verify"""
|
155 |
155 |
AssertCommand(["gnt-cluster", "verify"])
|
156 |
156 |
|
157 |
157 |
|