Revision 0ad7f5d8 test/py/ganeti.hypervisor.hv_kvm_unittest.py
b/test/py/ganeti.hypervisor.hv_kvm_unittest.py | ||
---|---|---|
289 | 289 |
self.assertEqual(hv_kvm._SPICE_ADDITIONAL_PARAMS, params) |
290 | 290 |
|
291 | 291 |
|
292 |
class TestHelpRegexps(testutils.GanetiTestCase): |
|
293 |
def testBootRe(self): |
|
294 |
"""Check _BOOT_RE |
|
295 |
|
|
296 |
It has too match -drive.*boot=on|off except if there is another dash-option |
|
297 |
at the beginning of the line. |
|
298 |
|
|
299 |
""" |
|
300 |
boot_re = hv_kvm.KVMHypervisor._BOOT_RE |
|
301 |
help_10 = utils.ReadFile(self._TestDataFilename("kvm_1.0_help.txt")) |
|
302 |
help_01590 = utils.ReadFile(self._TestDataFilename("kvm_0.15.90_help.txt")) |
|
303 |
help_0125 = utils.ReadFile(self._TestDataFilename("kvm_0.12.5_help.txt")) |
|
304 |
help_091 = utils.ReadFile(self._TestDataFilename("kvm_0.9.1_help.txt")) |
|
305 |
|
|
306 |
self.assertTrue(boot_re.search(help_091)) |
|
307 |
self.assertTrue(boot_re.search(help_0125)) |
|
308 |
self.assertFalse(boot_re.search(help_10)) |
|
309 |
self.assertFalse(boot_re.search(help_01590)) |
|
310 |
|
|
311 |
|
|
292 | 312 |
if __name__ == "__main__": |
293 | 313 |
testutils.GanetiTestProgram() |
Also available in: Unified diff