diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-30 19:06:12 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-30 19:06:12 +0000 |
| commit | 857328b3744eb5a12ea9c535ecc8a322a9ee11cf (patch) | |
| tree | 3d729ff662d7628822cacbaea3aed73ff807a30a /nova/tests | |
| parent | 9b61fdf34bee6ad9d8e28a32c4c30df243b02443 (diff) | |
| parent | af0651946010e6bcc966005aa9fc2a1f38d3748a (diff) | |
Merge "Avoid error during snapshot of ISO booted instance"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_libvirt.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index bb885e8c1..4e6e1ec48 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -3303,15 +3303,24 @@ disk size: 4.4M''', '')) self.mox.ReplayAll() libvirt_utils.chown('/some/path', 'soren') - def test_extract_snapshot(self): + def _do_test_extract_snapshot(self, dest_format='raw', out_format='raw'): self.mox.StubOutWithMock(utils, 'execute') - utils.execute('qemu-img', 'convert', '-f', 'qcow2', '-O', 'raw', + utils.execute('qemu-img', 'convert', '-f', 'qcow2', '-O', out_format, '-s', 'snap1', '/path/to/disk/image', '/extracted/snap') # Start test self.mox.ReplayAll() libvirt_utils.extract_snapshot('/path/to/disk/image', 'qcow2', - 'snap1', '/extracted/snap', 'raw') + 'snap1', '/extracted/snap', dest_format) + + def test_extract_snapshot_raw(self): + self._do_test_extract_snapshot() + + def test_extract_snapshot_iso(self): + self._do_test_extract_snapshot(dest_format='iso') + + def test_extract_snapshot_qcow2(self): + self._do_test_extract_snapshot(dest_format='qcow2', out_format='qcow2') def test_load_file(self): dst_fd, dst_path = tempfile.mkstemp() |
