root / test / py / ganeti.hypervisor.hv_fake_unittest.py @ 07809f7d
History | View | Annotate | Download (1.3 kB)
1 | 55cc0a44 | Michael Hanselmann | #!/usr/bin/python
|
---|---|---|---|
2 | 55cc0a44 | Michael Hanselmann | #
|
3 | 55cc0a44 | Michael Hanselmann | |
4 | 55cc0a44 | Michael Hanselmann | # Copyright (C) 2011 Google Inc.
|
5 | 55cc0a44 | Michael Hanselmann | #
|
6 | 55cc0a44 | Michael Hanselmann | # This program is free software; you can redistribute it and/or modify
|
7 | 55cc0a44 | Michael Hanselmann | # it under the terms of the GNU General Public License as published by
|
8 | 55cc0a44 | Michael Hanselmann | # the Free Software Foundation; either version 2 of the License, or
|
9 | 55cc0a44 | Michael Hanselmann | # (at your option) any later version.
|
10 | 55cc0a44 | Michael Hanselmann | #
|
11 | 55cc0a44 | Michael Hanselmann | # This program is distributed in the hope that it will be useful, but
|
12 | 55cc0a44 | Michael Hanselmann | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 55cc0a44 | Michael Hanselmann | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 55cc0a44 | Michael Hanselmann | # General Public License for more details.
|
15 | 55cc0a44 | Michael Hanselmann | #
|
16 | 55cc0a44 | Michael Hanselmann | # You should have received a copy of the GNU General Public License
|
17 | 55cc0a44 | Michael Hanselmann | # along with this program; if not, write to the Free Software
|
18 | 55cc0a44 | Michael Hanselmann | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
19 | 55cc0a44 | Michael Hanselmann | # 02110-1301, USA.
|
20 | 55cc0a44 | Michael Hanselmann | |
21 | 55cc0a44 | Michael Hanselmann | |
22 | 55cc0a44 | Michael Hanselmann | """Script for testing ganeti.hypervisor.hv_fake"""
|
23 | 55cc0a44 | Michael Hanselmann | |
24 | 55cc0a44 | Michael Hanselmann | import unittest |
25 | 55cc0a44 | Michael Hanselmann | |
26 | 55cc0a44 | Michael Hanselmann | from ganeti import constants |
27 | 55cc0a44 | Michael Hanselmann | from ganeti import objects |
28 | 55cc0a44 | Michael Hanselmann | from ganeti import hypervisor |
29 | 55cc0a44 | Michael Hanselmann | |
30 | 55cc0a44 | Michael Hanselmann | from ganeti.hypervisor import hv_fake |
31 | 55cc0a44 | Michael Hanselmann | |
32 | 55cc0a44 | Michael Hanselmann | import testutils |
33 | 55cc0a44 | Michael Hanselmann | |
34 | 55cc0a44 | Michael Hanselmann | |
35 | 55cc0a44 | Michael Hanselmann | class TestConsole(unittest.TestCase): |
36 | 55cc0a44 | Michael Hanselmann | def test(self): |
37 | 55cc0a44 | Michael Hanselmann | instance = objects.Instance(name="fake.example.com")
|
38 | 55cc0a44 | Michael Hanselmann | cons = hv_fake.FakeHypervisor.GetInstanceConsole(instance, {}, {}) |
39 | 55cc0a44 | Michael Hanselmann | self.assertTrue(cons.Validate())
|
40 | 55cc0a44 | Michael Hanselmann | self.assertEqual(cons.kind, constants.CONS_MESSAGE)
|
41 | 55cc0a44 | Michael Hanselmann | |
42 | 55cc0a44 | Michael Hanselmann | |
43 | 55cc0a44 | Michael Hanselmann | if __name__ == "__main__": |
44 | 55cc0a44 | Michael Hanselmann | testutils.GanetiTestProgram() |