Revision 663ed0ce
b/configure.ac | ||
---|---|---|
76 | 76 |
lib/Makefile |
77 | 77 |
man/Makefile |
78 | 78 |
qa/Makefile |
79 |
qa/hooks/Makefile |
|
79 | 80 |
scripts/Makefile |
80 | 81 |
test/Makefile |
81 | 82 |
tools/Makefile |
b/qa/Makefile.am | ||
---|---|---|
1 |
SUBDIRS = hooks |
|
1 | 2 |
EXTRA_DIST = ganeti-qa.py qa-sample.yaml \ |
2 | 3 |
qa_cluster.py \ |
3 | 4 |
qa_config.py \ |
b/qa/hooks/Makefile.am | ||
---|---|---|
1 |
EXTRA_DIST = datehook.py |
|
2 |
CLEANFILES = *.py[co] |
b/qa/hooks/datehook.py | ||
---|---|---|
1 |
# Copyright (C) 2007 Google Inc. |
|
2 |
# |
|
3 |
# This program is free software; you can redistribute it and/or modify |
|
4 |
# it under the terms of the GNU General Public License as published by |
|
5 |
# the Free Software Foundation; either version 2 of the License, or |
|
6 |
# (at your option) any later version. |
|
7 |
# |
|
8 |
# This program is distributed in the hope that it will be useful, but |
|
9 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
11 |
# General Public License for more details. |
|
12 |
# |
|
13 |
# You should have received a copy of the GNU General Public License |
|
14 |
# along with this program; if not, write to the Free Software |
|
15 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
16 |
# 02110-1301, USA. |
|
17 |
|
|
18 |
|
|
19 |
"""Example QA hook. |
|
20 |
|
|
21 |
""" |
|
22 |
|
|
23 |
from ganeti import utils |
|
24 |
|
|
25 |
import qa_utils |
|
26 |
import qa_config |
|
27 |
|
|
28 |
from qa_utils import AssertEqual, StartSSH |
|
29 |
|
|
30 |
|
|
31 |
class DateHook: |
|
32 |
def run(self, ctx): |
|
33 |
if ctx.name == 'cluster-init' and ctx.phase == 'pre': |
|
34 |
self._CallDate(ctx) |
|
35 |
|
|
36 |
def _CallDate(self, ctx): |
|
37 |
for node in qa_config.get('nodes'): |
|
38 |
cmd = ['date'] |
|
39 |
AssertEqual(StartSSH(node['primary'], |
|
40 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
41 |
|
|
42 |
hook = DateHook |
Also available in: Unified diff