Revision 25231ec5
b/test/docs_unittest.py | ||
---|---|---|
149 | 149 |
|
150 | 150 |
|
151 | 151 |
if __name__ == "__main__": |
152 |
unittest.main() |
|
152 |
testutils.GanetiTestProgram() |
b/test/ganeti.bdev_unittest.py | ||
---|---|---|
25 | 25 |
import os |
26 | 26 |
import unittest |
27 | 27 |
|
28 |
import testutils |
|
29 | 28 |
from ganeti import bdev |
30 | 29 |
from ganeti import errors |
31 | 30 |
|
31 |
import testutils |
|
32 |
|
|
32 | 33 |
|
33 | 34 |
class TestDRBD8Runner(testutils.GanetiTestCase): |
34 | 35 |
"""Testing case for DRBD8""" |
... | ... | |
189 | 190 |
stats.is_disk_uptodate) |
190 | 191 |
|
191 | 192 |
if __name__ == '__main__': |
192 |
unittest.main() |
|
193 |
testutils.GanetiTestProgram() |
b/test/ganeti.cli_unittest.py | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import ganeti |
28 | 28 |
import testutils |
29 |
|
|
29 | 30 |
from ganeti import constants |
30 | 31 |
from ganeti import cli |
31 | 32 |
from ganeti.errors import OpPrereqError, ParameterError |
32 | 33 |
|
34 |
|
|
33 | 35 |
class TestParseTimespec(unittest.TestCase): |
34 | 36 |
"""Testing case for ParseTimespec""" |
35 | 37 |
|
... | ... | |
123 | 125 |
self.failUnlessEqual(buf.getvalue(), "foo a b\n") |
124 | 126 |
|
125 | 127 |
if __name__ == '__main__': |
126 |
unittest.main() |
|
128 |
testutils.GanetiTestProgram() |
b/test/ganeti.cmdlib_unittest.py | ||
---|---|---|
30 | 30 |
from ganeti import cmdlib |
31 | 31 |
from ganeti import errors |
32 | 32 |
|
33 |
import testutils |
|
34 |
|
|
33 | 35 |
|
34 | 36 |
if __name__ == '__main__': |
35 |
unittest.main() |
|
37 |
testutils.GanetiTestProgram() |
b/test/ganeti.confd_client_unittest.py | ||
---|---|---|
30 | 30 |
|
31 | 31 |
import ganeti.confd.client |
32 | 32 |
|
33 |
import testutils |
|
34 |
|
|
33 | 35 |
|
34 | 36 |
class ResettableMock(object): |
35 | 37 |
def __init__(self, *args, **kwargs): |
... | ... | |
182 | 184 |
|
183 | 185 |
|
184 | 186 |
if __name__ == '__main__': |
185 |
unittest.main() |
|
187 |
testutils.GanetiTestProgram() |
b/test/ganeti.config_unittest.py | ||
---|---|---|
36 | 36 |
from ganeti import objects |
37 | 37 |
from ganeti import utils |
38 | 38 |
|
39 |
import testutils |
|
40 |
|
|
39 | 41 |
|
40 | 42 |
class TestConfigRunner(unittest.TestCase): |
41 | 43 |
"""Testing case for HooksRunner""" |
... | ... | |
176 | 178 |
|
177 | 179 |
|
178 | 180 |
if __name__ == '__main__': |
179 |
unittest.main() |
|
181 |
testutils.GanetiTestProgram() |
b/test/ganeti.constants_unittest.py | ||
---|---|---|
27 | 27 |
|
28 | 28 |
from ganeti import constants |
29 | 29 |
|
30 |
import testutils |
|
31 |
|
|
30 | 32 |
|
31 | 33 |
class TestConstants(unittest.TestCase): |
32 | 34 |
"""Constants tests""" |
... | ... | |
99 | 101 |
|
100 | 102 |
|
101 | 103 |
if __name__ == '__main__': |
102 |
unittest.main() |
|
104 |
testutils.GanetiTestProgram() |
b/test/ganeti.hooks_unittest.py | ||
---|---|---|
39 | 39 |
|
40 | 40 |
from mocks import FakeConfig, FakeProc, FakeContext |
41 | 41 |
|
42 |
import testutils |
|
43 |
|
|
44 |
|
|
42 | 45 |
class FakeLU(cmdlib.LogicalUnit): |
43 | 46 |
HPATH = "test" |
44 | 47 |
def BuildHooksEnv(self): |
45 | 48 |
return {}, ["localhost"], ["localhost"] |
46 | 49 |
|
50 |
|
|
47 | 51 |
class TestHooksRunner(unittest.TestCase): |
48 | 52 |
"""Testing case for HooksRunner""" |
49 | 53 |
def setUp(self): |
... | ... | |
266 | 270 |
for phase in (constants.HOOKS_PHASE_PRE, constants.HOOKS_PHASE_POST): |
267 | 271 |
hm.RunPhase(phase) |
268 | 272 |
|
273 |
|
|
269 | 274 |
if __name__ == '__main__': |
270 |
unittest.main() |
|
275 |
testutils.GanetiTestProgram() |
b/test/ganeti.http_unittest.py | ||
---|---|---|
32 | 32 |
import ganeti.http.client |
33 | 33 |
import ganeti.http.auth |
34 | 34 |
|
35 |
import testutils |
|
36 |
|
|
35 | 37 |
|
36 | 38 |
class TestStartLines(unittest.TestCase): |
37 | 39 |
"""Test cases for start line classes""" |
... | ... | |
163 | 165 |
|
164 | 166 |
|
165 | 167 |
if __name__ == '__main__': |
166 |
unittest.main() |
|
168 |
testutils.GanetiTestProgram() |
b/test/ganeti.locking_unittest.py | ||
---|---|---|
31 | 31 |
from ganeti import locking |
32 | 32 |
from ganeti import errors |
33 | 33 |
|
34 |
import testutils |
|
35 |
|
|
34 | 36 |
|
35 | 37 |
# This is used to test the ssynchronize decorator. |
36 | 38 |
# Since it's passed as input to a decorator it must be declared as a global. |
... | ... | |
1405 | 1407 |
|
1406 | 1408 |
|
1407 | 1409 |
if __name__ == '__main__': |
1408 |
unittest.main() |
|
1409 |
#suite = unittest.TestLoader().loadTestsFromTestCase(TestSharedLock) |
|
1410 |
#unittest.TextTestRunner(verbosity=2).run(suite) |
|
1410 |
testutils.GanetiTestProgram() |
b/test/ganeti.mcpu_unittest.py | ||
---|---|---|
26 | 26 |
|
27 | 27 |
from ganeti import mcpu |
28 | 28 |
|
29 |
import testutils |
|
30 |
|
|
29 | 31 |
|
30 | 32 |
class TestLockAttemptTimeoutStrategy(unittest.TestCase): |
31 | 33 |
def testConstants(self): |
... | ... | |
58 | 60 |
|
59 | 61 |
|
60 | 62 |
if __name__ == "__main__": |
61 |
unittest.main() |
|
63 |
testutils.GanetiTestProgram() |
b/test/ganeti.objects_unittest.py | ||
---|---|---|
26 | 26 |
|
27 | 27 |
from ganeti import objects |
28 | 28 |
|
29 |
import testutils |
|
30 |
|
|
31 |
|
|
29 | 32 |
class SimpleObject(objects.ConfigObject): |
30 | 33 |
__slots__ = ['a', 'b'] |
31 | 34 |
|
35 |
|
|
32 | 36 |
class TestDictState(unittest.TestCase): |
33 | 37 |
"""Simple dict tansformation tests""" |
34 | 38 |
|
... | ... | |
45 | 49 |
|
46 | 50 |
|
47 | 51 |
if __name__ == '__main__': |
48 |
unittest.main() |
|
52 |
testutils.GanetiTestProgram() |
b/test/ganeti.rapi.resources_unittest.py | ||
---|---|---|
31 | 31 |
from ganeti.rapi import connector |
32 | 32 |
from ganeti.rapi import rlib2 |
33 | 33 |
|
34 |
import testutils |
|
35 |
|
|
34 | 36 |
|
35 | 37 |
class MapperTests(unittest.TestCase): |
36 | 38 |
"""Tests for remote API URI mapper.""" |
... | ... | |
82 | 84 |
|
83 | 85 |
|
84 | 86 |
if __name__ == '__main__': |
85 |
unittest.main() |
|
87 |
testutils.GanetiTestProgram() |
b/test/ganeti.serializer_unittest.py | ||
---|---|---|
80 | 80 |
|
81 | 81 |
|
82 | 82 |
if __name__ == '__main__': |
83 |
unittest.main() |
|
83 |
testutils.GanetiTestProgram() |
b/test/ganeti.ssh_unittest.py | ||
---|---|---|
49 | 49 |
|
50 | 50 |
|
51 | 51 |
if __name__ == '__main__': |
52 |
unittest.main() |
|
52 |
testutils.GanetiTestProgram() |
b/test/ganeti.utils_unittest.py | ||
---|---|---|
1043 | 1043 |
|
1044 | 1044 |
|
1045 | 1045 |
if __name__ == '__main__': |
1046 |
unittest.main() |
|
1046 |
testutils.GanetiTestProgram() |
b/test/ganeti.workerpool_unittest.py | ||
---|---|---|
29 | 29 |
|
30 | 30 |
from ganeti import workerpool |
31 | 31 |
|
32 |
import testutils |
|
33 |
|
|
32 | 34 |
|
33 | 35 |
class DummyBaseWorker(workerpool.BaseWorker): |
34 | 36 |
def RunTask(self, text): |
... | ... | |
136 | 138 |
|
137 | 139 |
|
138 | 140 |
if __name__ == '__main__': |
139 |
unittest.main() |
|
141 |
testutils.GanetiTestProgram() |
b/test/testutils.py | ||
---|---|---|
25 | 25 |
import stat |
26 | 26 |
import tempfile |
27 | 27 |
import unittest |
28 |
import logging |
|
28 | 29 |
|
29 | 30 |
from ganeti import utils |
30 | 31 |
|
... | ... | |
33 | 34 |
return os.environ.get("TOP_SRCDIR", ".") |
34 | 35 |
|
35 | 36 |
|
37 |
class GanetiTestProgram(unittest.TestProgram): |
|
38 |
def runTests(self): |
|
39 |
""" |
|
40 |
|
|
41 |
""" |
|
42 |
logging.basicConfig(filename=os.devnull) |
|
43 |
return unittest.TestProgram.runTests(self) |
|
44 |
|
|
45 |
|
|
36 | 46 |
class GanetiTestCase(unittest.TestCase): |
37 | 47 |
"""Helper class for unittesting. |
38 | 48 |
|
Also available in: Unified diff