Revision a39ec11a
b/Makefile.am | ||
---|---|---|
155 | 155 |
qa/qa_instance.py \ |
156 | 156 |
qa/qa_node.py \ |
157 | 157 |
qa/qa_os.py \ |
158 |
qa/qa_other.py \ |
|
159 | 158 |
qa/qa_rapi.py \ |
160 | 159 |
qa/qa_tags.py \ |
161 | 160 |
qa/qa_utils.py |
b/qa/ganeti-qa.py | ||
---|---|---|
21 | 21 |
|
22 | 22 |
"""Script for doing QA on Ganeti. |
23 | 23 |
|
24 |
You can create the required known_hosts file using ssh-keyscan. It's mandatory |
|
25 |
to use the full name of a node (FQDN). For security reasons, verify the keys |
|
26 |
before using them. |
|
27 |
Example: ssh-keyscan -t rsa node{1,2,3,4}.example.com > known_hosts |
|
28 | 24 |
""" |
29 | 25 |
|
30 | 26 |
import sys |
... | ... | |
38 | 34 |
import qa_instance |
39 | 35 |
import qa_node |
40 | 36 |
import qa_os |
41 |
import qa_other |
|
42 | 37 |
import qa_rapi |
43 | 38 |
import qa_tags |
44 | 39 |
import qa_utils |
... | ... | |
241 | 236 |
"""Main program. |
242 | 237 |
|
243 | 238 |
""" |
244 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>" |
|
245 |
" <known-hosts-file>") |
|
239 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>") |
|
246 | 240 |
parser.add_option('--dry-run', dest='dry_run', |
247 | 241 |
action="store_true", |
248 | 242 |
help="Show what would be done") |
... | ... | |
251 | 245 |
help="Really execute the tests") |
252 | 246 |
(qa_config.options, args) = parser.parse_args() |
253 | 247 |
|
254 |
if len(args) == 2:
|
|
255 |
(config_file, known_hosts_file) = args
|
|
248 |
if len(args) == 1:
|
|
249 |
(config_file, ) = args |
|
256 | 250 |
else: |
257 |
parser.error("Not enough arguments.")
|
|
251 |
parser.error("Wrong number of arguments.")
|
|
258 | 252 |
|
259 | 253 |
if not qa_config.options.yes_do_it: |
260 | 254 |
print ("Executing this script irreversibly destroys any Ganeti\n" |
... | ... | |
264 | 258 |
|
265 | 259 |
qa_config.Load(config_file) |
266 | 260 |
|
267 |
RunTest(qa_other.UploadKnownHostsFile, known_hosts_file) |
|
268 |
|
|
269 | 261 |
RunEnvTests() |
270 | 262 |
SetupCluster() |
271 | 263 |
RunClusterTests() |
/dev/null | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
4 |
# Copyright (C) 2007 Google Inc. |
|
5 |
# |
|
6 |
# This program is free software; you can redistribute it and/or modify |
|
7 |
# it under the terms of the GNU General Public License as published by |
|
8 |
# the Free Software Foundation; either version 2 of the License, or |
|
9 |
# (at your option) any later version. |
|
10 |
# |
|
11 |
# This program is distributed in the hope that it will be useful, but |
|
12 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 |
# General Public License for more details. |
|
15 |
# |
|
16 |
# You should have received a copy of the GNU General Public License |
|
17 |
# along with this program; if not, write to the Free Software |
|
18 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
19 |
# 02110-1301, USA. |
|
20 |
|
|
21 |
|
|
22 |
from ganeti import utils |
|
23 |
from ganeti import constants |
|
24 |
|
|
25 |
import qa_config |
|
26 |
import qa_utils |
|
27 |
|
|
28 |
from qa_utils import AssertEqual, StartSSH |
|
29 |
|
|
30 |
|
|
31 |
def UploadKnownHostsFile(localpath): |
|
32 |
"""Uploading known_hosts file. |
|
33 |
|
|
34 |
""" |
|
35 |
master = qa_config.GetMasterNode() |
|
36 |
|
|
37 |
tmpfile = qa_utils.UploadFile(master['primary'], localpath) |
|
38 |
try: |
|
39 |
cmd = ['mv', tmpfile, constants.SSH_KNOWN_HOSTS_FILE] |
|
40 |
AssertEqual(StartSSH(master['primary'], |
|
41 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
42 |
except: |
|
43 |
cmd = ['rm', '-f', tmpfile] |
|
44 |
AssertEqual(StartSSH(master['primary'], |
|
45 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
46 |
raise |
Also available in: Unified diff