summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-05-11 16:28:31 +0000
committerGerrit Code Review <review@openstack.org>2012-05-11 16:28:31 +0000
commit15e774deb83c039bf6d07386fa5ce6b76e12e034 (patch)
tree05381efff4a82b58982818ad8080f9af206115cd /nova/tests
parent8374ba0f03f5038be2868da988f5d06468a68544 (diff)
parent2549018c81ad6fcc67a3dc89dec18d2310ce2235 (diff)
Merge "Provide a transition to new .info files."
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_imagecache.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/nova/tests/test_imagecache.py b/nova/tests/test_imagecache.py
index 79d561001..2f611cb59 100644
--- a/nova/tests/test_imagecache.py
+++ b/nova/tests/test_imagecache.py
@@ -71,6 +71,23 @@ class ImageCacheManagerTestCase(test.TestCase):
self.assertEquals(csum_input.rstrip(),
'{"sha1": "%s"}' % csum_output)
+ def test_read_stored_checksum_legacy_essex(self):
+ with utils.tempdir() as tmpdir:
+ self.flags(instances_path=tmpdir)
+ self.flags(image_info_filename_pattern=('$instances_path/'
+ '%(image)s.info'))
+
+ fname = os.path.join(tmpdir, 'aaa')
+ old_fname = fname + '.sha1'
+ f = open(old_fname, 'w')
+ f.write('fdghkfhkgjjksfdgjksjkghsdf')
+ f.close()
+
+ csum_output = imagecache.read_stored_checksum(fname)
+ self.assertEquals(csum_output, 'fdghkfhkgjjksfdgjksjkghsdf')
+ self.assertFalse(os.path.exists(old_fname))
+ self.assertTrue(os.path.exists(virtutils.get_info_filename(fname)))
+
def test_list_base_images(self):
listing = ['00000001',
'ephemeral_0_20_None',