Revision c777c5fc test/py/cfgupgrade_unittest.py
b/test/py/cfgupgrade_unittest.py | ||
---|---|---|
27 | 27 |
import shutil |
28 | 28 |
import tempfile |
29 | 29 |
import operator |
30 |
import json |
|
30 | 31 |
|
31 | 32 |
from ganeti import constants |
32 | 33 |
from ganeti import utils |
... | ... | |
377 | 378 |
def testUpgradeFullConfigFrom_2_9(self): |
378 | 379 |
self._TestUpgradeFromFile("cluster_config_2.9.json", False) |
379 | 380 |
|
381 |
def testUpgradeFullConfigFrom_2_10(self): |
|
382 |
self._TestUpgradeFromFile("cluster_config_2.10.json", False) |
|
383 |
|
|
380 | 384 |
def testUpgradeCurrent(self): |
381 | 385 |
self._TestSimpleUpgrade(constants.CONFIG_VERSION, False) |
382 | 386 |
|
... | ... | |
394 | 398 |
def testDowngradeFullConfig(self): |
395 | 399 |
"""Test for upgrade + downgrade combination.""" |
396 | 400 |
# This test can work only with the previous version of a configuration! |
397 |
oldconfname = "cluster_config_2.10.json"
|
|
401 |
oldconfname = "cluster_config_2.11.json"
|
|
398 | 402 |
self._TestUpgradeFromFile(oldconfname, False) |
399 | 403 |
_RunUpgrade(self.tmpdir, False, True, downgrade=True) |
400 | 404 |
oldconf = self._LoadTestDataConfig(oldconfname) |
401 | 405 |
newconf = self._LoadConfig() |
402 |
|
|
406 |
old = open('/tmp/old', 'w') |
|
407 |
old.write(json.dumps(oldconf)) |
|
408 |
old.close() |
|
409 |
new = open('/tmp/new', 'w') |
|
410 |
new.write(json.dumps(newconf)) |
|
411 |
new.close() |
|
403 | 412 |
self.assertEqual(oldconf, newconf) |
404 | 413 |
|
405 | 414 |
def testDowngradeFullConfigBackwardFrom_2_7(self): |
Also available in: Unified diff