From 2549018c81ad6fcc67a3dc89dec18d2310ce2235 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Fri, 11 May 2012 14:54:34 +1000 Subject: Provide a transition to new .info files. Change-Id: I2fb6ef93c0652a797dba72cf75fb78baaa9c9c5a --- nova/tests/test_imagecache.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'nova/tests') 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', -- cgit