Revision 8201b996
b/qa/ganeti-qa.py | ||
---|---|---|
105 | 105 |
else: |
106 | 106 |
# consider the nodes are already there |
107 | 107 |
qa_node.MarkNodeAddedAll() |
108 |
|
|
109 |
# enable the watcher (unconditionally) |
|
110 |
RunTest(qa_daemon.TestResumeWatcher) |
|
111 |
|
|
108 | 112 |
if qa_config.TestEnabled('node-info'): |
109 | 113 |
RunTest(qa_node.TestNodeInfo) |
110 | 114 |
|
... | ... | |
274 | 278 |
consecutive_failures = \ |
275 | 279 |
qa_config.TestEnabled('instance-consecutive-failures') |
276 | 280 |
|
281 |
RunTest(qa_daemon.TestPauseWatcher) |
|
277 | 282 |
if automatic_restart or consecutive_failures: |
278 |
qa_daemon.PrintCronWarning() |
|
279 | 283 |
|
280 | 284 |
if automatic_restart: |
281 | 285 |
RunTest(qa_daemon.TestInstanceAutomaticRestart, pnode, instance) |
... | ... | |
283 | 287 |
if consecutive_failures: |
284 | 288 |
RunTest(qa_daemon.TestInstanceConsecutiveFailures, pnode, instance) |
285 | 289 |
|
290 |
RunTest(qa_daemon.TestResumeWatcher) |
|
291 |
|
|
286 | 292 |
|
287 | 293 |
def RunHardwareFailureTests(instance, pnode, snode): |
288 | 294 |
"""Test cluster internal hardware failure recovery. |
... | ... | |
349 | 355 |
SetupCluster(rapi_user, rapi_secret) |
350 | 356 |
|
351 | 357 |
# Load RAPI certificate |
352 |
qa_rapi.Setup(rapi_user, rapi_secret) |
|
358 |
#qa_rapi.Setup(rapi_user, rapi_secret)
|
|
353 | 359 |
|
354 | 360 |
RunClusterTests() |
355 | 361 |
RunOsTests() |
b/qa/qa_daemon.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007 Google Inc. |
|
4 |
# Copyright (C) 2007, 2008, 2009, 2010 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 |
... | ... | |
32 | 32 |
import qa_utils |
33 | 33 |
import qa_error |
34 | 34 |
|
35 |
from qa_utils import AssertEqual, StartSSH
|
|
35 |
from qa_utils import AssertEqual, AssertMatch, StartSSH, GetCommandOutput
|
|
36 | 36 |
|
37 | 37 |
|
38 | 38 |
def _InstanceRunning(node, name): |
... | ... | |
89 | 89 |
""" |
90 | 90 |
master = qa_config.GetMasterNode() |
91 | 91 |
|
92 |
cmd = ['ganeti-watcher', '-d']
|
|
93 |
AssertEqual(StartSSH(master['primary'],
|
|
92 |
cmd = ["ganeti-watcher", "-d", "--ignore-pause"]
|
|
93 |
AssertEqual(StartSSH(master["primary"],
|
|
94 | 94 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
95 | 95 |
|
96 | 96 |
|
97 |
def PrintCronWarning():
|
|
98 |
"""Shows a warning about the cron job.
|
|
97 |
def TestPauseWatcher():
|
|
98 |
"""Tests and pauses the watcher.
|
|
99 | 99 |
|
100 | 100 |
""" |
101 |
msg = ("For the following tests it's recommended to turn off the" |
|
102 |
" ganeti-watcher cronjob.") |
|
103 |
|
|
104 |
print qa_utils.FormatWarning(msg) |
|
101 |
master = qa_config.GetMasterNode() |
|
102 |
|
|
103 |
cmd = ["gnt-cluster", "watcher", "pause", "4h"] |
|
104 |
AssertEqual(StartSSH(master["primary"], |
|
105 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
106 |
|
|
107 |
cmd = ["gnt-cluster", "watcher", "info"] |
|
108 |
output = GetCommandOutput(master["primary"], |
|
109 |
utils.ShellQuoteArgs(cmd)) |
|
110 |
AssertMatch(output, r"^.*\bis paused\b.*") |
|
111 |
|
|
112 |
|
|
113 |
def TestResumeWatcher(): |
|
114 |
"""Tests and unpauses the watcher. |
|
115 |
|
|
116 |
""" |
|
117 |
master = qa_config.GetMasterNode() |
|
118 |
|
|
119 |
cmd = ["gnt-cluster", "watcher", "continue"] |
|
120 |
AssertEqual(StartSSH(master["primary"], |
|
121 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
122 |
|
|
123 |
cmd = ["gnt-cluster", "watcher", "info"] |
|
124 |
output = GetCommandOutput(master["primary"], |
|
125 |
utils.ShellQuoteArgs(cmd)) |
|
126 |
AssertMatch(output, r"^.*\bis not paused\b.*") |
|
105 | 127 |
|
106 | 128 |
|
107 | 129 |
def TestInstanceAutomaticRestart(node, instance): |
Also available in: Unified diff