Revision 1d3dfa29 test/ganeti.impexpd_unittest.py
b/test/ganeti.impexpd_unittest.py | ||
---|---|---|
45 | 45 |
"host", |
46 | 46 |
"port", |
47 | 47 |
"compress", |
48 |
"magic", |
|
48 | 49 |
"connect_timeout", |
49 | 50 |
"connect_retries", |
50 | 51 |
"cmd_prefix", |
... | ... | |
66 | 67 |
comprcmd = "gzip" |
67 | 68 |
|
68 | 69 |
for compress in [constants.IEC_NONE, constants.IEC_GZIP]: |
70 |
for magic in [None, 10 * "-", "HelloWorld", "J9plh4nFo2", |
|
71 |
"24A02A81-2264-4B51-A882-A2AB9D85B420"]: |
|
72 |
opts = CmdBuilderConfig(magic=magic, compress=compress) |
|
73 |
builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3) |
|
74 |
|
|
75 |
magic_cmd = builder._GetMagicCommand() |
|
76 |
dd_cmd = builder._GetDdCommand() |
|
77 |
|
|
78 |
if magic: |
|
79 |
self.assert_(("M=%s" % magic) in magic_cmd) |
|
80 |
self.assert_(("M=%s" % magic) in dd_cmd) |
|
81 |
else: |
|
82 |
self.assertFalse(magic_cmd) |
|
83 |
|
|
69 | 84 |
for host in ["localhost", "1.2.3.4", "192.0.2.99"]: |
70 | 85 |
for port in [0, 1, 1234, 7856, 45452]: |
71 | 86 |
for cmd_prefix in [None, "PrefixCommandGoesHere|", |
Also available in: Unified diff