Revision f7e6f3c8 qa/ganeti-qa.py
b/qa/ganeti-qa.py | ||
---|---|---|
1 | 1 |
#!/usr/bin/python -u |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007, 2008, 2009, 2010 Google Inc. |
|
4 |
# Copyright (C) 2007, 2008, 2009, 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 |
... | ... | |
354 | 354 |
pnode, snode) |
355 | 355 |
|
356 | 356 |
|
357 |
@rapi.client.UsesRapiClient |
|
358 |
def main(): |
|
359 |
"""Main program. |
|
357 |
def RunQa(): |
|
358 |
"""Main QA body. |
|
360 | 359 |
|
361 | 360 |
""" |
362 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>") |
|
363 |
parser.add_option('--yes-do-it', dest='yes_do_it', |
|
364 |
action="store_true", |
|
365 |
help="Really execute the tests") |
|
366 |
(qa_config.options, args) = parser.parse_args() |
|
367 |
|
|
368 |
if len(args) == 1: |
|
369 |
(config_file, ) = args |
|
370 |
else: |
|
371 |
parser.error("Wrong number of arguments.") |
|
372 |
|
|
373 |
if not qa_config.options.yes_do_it: |
|
374 |
print ("Executing this script irreversibly destroys any Ganeti\n" |
|
375 |
"configuration on all nodes involved. If you really want\n" |
|
376 |
"to start testing, supply the --yes-do-it option.") |
|
377 |
sys.exit(1) |
|
378 |
|
|
379 |
qa_config.Load(config_file) |
|
380 |
|
|
381 | 361 |
rapi_user = "ganeti-qa" |
382 | 362 |
rapi_secret = utils.GenerateSecret() |
383 | 363 |
|
... | ... | |
476 | 456 |
RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy) |
477 | 457 |
|
478 | 458 |
|
459 |
@rapi.client.UsesRapiClient |
|
460 |
def main(): |
|
461 |
"""Main program. |
|
462 |
|
|
463 |
""" |
|
464 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>") |
|
465 |
parser.add_option('--yes-do-it', dest='yes_do_it', |
|
466 |
action="store_true", |
|
467 |
help="Really execute the tests") |
|
468 |
(qa_config.options, args) = parser.parse_args() |
|
469 |
|
|
470 |
if len(args) == 1: |
|
471 |
(config_file, ) = args |
|
472 |
else: |
|
473 |
parser.error("Wrong number of arguments.") |
|
474 |
|
|
475 |
if not qa_config.options.yes_do_it: |
|
476 |
print ("Executing this script irreversibly destroys any Ganeti\n" |
|
477 |
"configuration on all nodes involved. If you really want\n" |
|
478 |
"to start testing, supply the --yes-do-it option.") |
|
479 |
sys.exit(1) |
|
480 |
|
|
481 |
qa_config.Load(config_file) |
|
482 |
|
|
483 |
qa_utils.StartMultiplexer(qa_config.GetMasterNode()["primary"]) |
|
484 |
try: |
|
485 |
RunQa() |
|
486 |
finally: |
|
487 |
qa_utils.CloseMultiplexers() |
|
488 |
|
|
479 | 489 |
if __name__ == '__main__': |
480 | 490 |
main() |
Also available in: Unified diff