diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-07-18 23:42:02 +0000 |
---|---|---|
committer | Tarmac <> | 2011-07-18 23:42:02 +0000 |
commit | 77db06c908f9c08c80beb11241c0e23247129ad6 (patch) | |
tree | e59beff78136a5ffe9b7b9db3baf4c89112a2771 /nova/test.py | |
parent | d101bb53cf310e1f093c46cdbdbe2c5b0207e49e (diff) | |
parent | d5307a2e1575778fcbfcf3d8ad65733be7544a54 (diff) | |
download | nova-77db06c908f9c08c80beb11241c0e23247129ad6.tar.gz nova-77db06c908f9c08c80beb11241c0e23247129ad6.tar.xz nova-77db06c908f9c08c80beb11241c0e23247129ad6.zip |
This change adds the basic boot-from-volume support to the image service.
Specifically following API will supports --block-device-mapping with volume/snapshot and root device name
- register image
- describe image
- create image(newly support)
At the moment swap and ephemeral aren't supported yet. They will be supported with the next step
Next step
- describe instance attribute with euca command
- get metadata for bundle volume
- swap/ephemeral device support
Diffstat (limited to 'nova/test.py')
-rw-r--r-- | nova/test.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nova/test.py b/nova/test.py index 6fb6b5a82..9790b0aa1 100644 --- a/nova/test.py +++ b/nova/test.py @@ -31,6 +31,7 @@ import unittest import mox import nose.plugins.skip +import nova.image.fake import shutil import stubout from eventlet import greenthread @@ -119,6 +120,9 @@ class TestCase(unittest.TestCase): if hasattr(fake.FakeConnection, '_instance'): del fake.FakeConnection._instance + if FLAGS.image_service == 'nova.image.fake.FakeImageService': + nova.image.fake.FakeImageService_reset() + # Reset any overriden flags self.reset_flags() @@ -248,3 +252,15 @@ class TestCase(unittest.TestCase): for d1, d2 in zip(L1, L2): self.assertDictMatch(d1, d2, approx_equal=approx_equal, tolerance=tolerance) + + def assertSubDictMatch(self, sub_dict, super_dict): + """Assert a sub_dict is subset of super_dict.""" + self.assertTrue(set(sub_dict.keys()).issubset(set(super_dict.keys()))) + for k, sub_value in sub_dict.items(): + super_value = super_dict[k] + if isinstance(sub_value, dict): + self.assertSubDictMatch(sub_value, super_value) + elif 'DONTCARE' in (sub_value, super_value): + continue + else: + self.assertEqual(sub_value, super_value) |