root / qa / qa_monitoring.py @ 0511ce91
History | View | Annotate | Download (1.9 kB)
1 | a5877534 | Michele Tartara | #
|
---|---|---|---|
2 | a5877534 | Michele Tartara | #
|
3 | a5877534 | Michele Tartara | |
4 | a5877534 | Michele Tartara | # Copyright (C) 2007, 2011, 2012, 2013 Google Inc.
|
5 | a5877534 | Michele Tartara | #
|
6 | a5877534 | Michele Tartara | # This program is free software; you can redistribute it and/or modify
|
7 | a5877534 | Michele Tartara | # it under the terms of the GNU General Public License as published by
|
8 | a5877534 | Michele Tartara | # the Free Software Foundation; either version 2 of the License, or
|
9 | a5877534 | Michele Tartara | # (at your option) any later version.
|
10 | a5877534 | Michele Tartara | #
|
11 | a5877534 | Michele Tartara | # This program is distributed in the hope that it will be useful, but
|
12 | a5877534 | Michele Tartara | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | a5877534 | Michele Tartara | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | a5877534 | Michele Tartara | # General Public License for more details.
|
15 | a5877534 | Michele Tartara | #
|
16 | a5877534 | Michele Tartara | # You should have received a copy of the GNU General Public License
|
17 | a5877534 | Michele Tartara | # along with this program; if not, write to the Free Software
|
18 | a5877534 | Michele Tartara | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
19 | a5877534 | Michele Tartara | # 02110-1301, USA.
|
20 | a5877534 | Michele Tartara | |
21 | a5877534 | Michele Tartara | |
22 | a5877534 | Michele Tartara | """Monitoring related QA tests.
|
23 | a5877534 | Michele Tartara |
|
24 | a5877534 | Michele Tartara | """
|
25 | a5877534 | Michele Tartara | |
26 | a5877534 | Michele Tartara | from ganeti import _autoconf |
27 | 0511ce91 | Michele Tartara | from ganeti import constants |
28 | a5877534 | Michele Tartara | |
29 | a5877534 | Michele Tartara | import qa_config |
30 | 0511ce91 | Michele Tartara | import qa_utils |
31 | a5877534 | Michele Tartara | |
32 | a5877534 | Michele Tartara | from qa_utils import AssertCommand |
33 | a5877534 | Michele Tartara | from qa_instance_utils import CreateInstanceByDiskTemplate, \ |
34 | a5877534 | Michele Tartara | RemoveInstance
|
35 | a5877534 | Michele Tartara | |
36 | a5877534 | Michele Tartara | MON_COLLECTOR = _autoconf.PKGLIBDIR + "/mon-collector"
|
37 | a5877534 | Michele Tartara | |
38 | a5877534 | Michele Tartara | |
39 | a5877534 | Michele Tartara | def TestInstStatusCollector(): |
40 | a5877534 | Michele Tartara | """Test the Xen instance status collector.
|
41 | a5877534 | Michele Tartara |
|
42 | a5877534 | Michele Tartara | """
|
43 | 0511ce91 | Michele Tartara | enabled_hypervisors = qa_config.GetEnabledHypervisors() |
44 | 0511ce91 | Michele Tartara | is_xen = (constants.HT_XEN_PVM in enabled_hypervisors or |
45 | 0511ce91 | Michele Tartara | constants.HT_XEN_HVM in enabled_hypervisors)
|
46 | 0511ce91 | Michele Tartara | fail = not is_xen
|
47 | 0511ce91 | Michele Tartara | |
48 | a5877534 | Michele Tartara | # Execute on master on an empty cluster
|
49 | 0511ce91 | Michele Tartara | AssertCommand([MON_COLLECTOR, "inst-status-xen"], fail=fail)
|
50 | a5877534 | Michele Tartara | |
51 | a5877534 | Michele Tartara | #Execute on cluster with instances
|
52 | a5877534 | Michele Tartara | node1 = qa_config.AcquireNode() |
53 | a5877534 | Michele Tartara | node2 = qa_config.AcquireNode() |
54 | a5877534 | Michele Tartara | template = qa_config.GetDefaultDiskTemplate() |
55 | a5877534 | Michele Tartara | |
56 | a5877534 | Michele Tartara | instance = CreateInstanceByDiskTemplate([node1, node2], template) |
57 | 0511ce91 | Michele Tartara | AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node1, fail=fail)
|
58 | 0511ce91 | Michele Tartara | AssertCommand([MON_COLLECTOR, "inst-status-xen"], node=node2, fail=fail)
|
59 | a5877534 | Michele Tartara | RemoveInstance(instance) |
60 | a5877534 | Michele Tartara | |
61 | a5877534 | Michele Tartara | node1.Release() |
62 | a5877534 | Michele Tartara | node2.Release() |