Revision 59072e7e test/ganeti.utils_unittest.py
b/test/ganeti.utils_unittest.py | ||
---|---|---|
29 | 29 |
import md5 |
30 | 30 |
import socket |
31 | 31 |
import shutil |
32 |
import re |
|
32 | 33 |
|
33 | 34 |
import ganeti |
34 | 35 |
from ganeti import constants |
36 |
from ganeti import utils |
|
35 | 37 |
from ganeti.utils import IsProcessAlive, Lock, Unlock, RunCmd, \ |
36 | 38 |
RemoveFile, CheckDict, MatchNameComponent, FormatUnit, \ |
37 | 39 |
ParseUnit, AddAuthorizedKey, RemoveAuthorizedKey, \ |
... | ... | |
539 | 541 |
self._test(files, expected) |
540 | 542 |
|
541 | 543 |
|
544 |
class TestGetUUID(unittest.TestCase): |
|
545 |
"""Test case for GetUUID""" |
|
546 |
|
|
547 |
_re_uuid = re.compile('^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-' |
|
548 |
'[a-f0-9]{4}-[a-f0-9]{12}$') |
|
549 |
|
|
550 |
def runTest(self): |
|
551 |
self.failUnless(self._re_uuid.match(utils.GetUUID())) |
|
552 |
|
|
553 |
|
|
542 | 554 |
if __name__ == '__main__': |
543 | 555 |
unittest.main() |
Also available in: Unified diff