|
21 | 21 | import netaddr
|
22 | 22 | import os_resource_classes as orc
|
23 | 23 | import os_vif
|
| 24 | +from oslo_concurrency import processutils |
24 | 25 | from oslo_log import log as logging
|
25 | 26 | from oslo_serialization import jsonutils
|
26 | 27 | from oslo_utils import importutils
|
@@ -239,8 +240,16 @@ def test_snapshot_not_running(self):
|
239 | 240 | def test_snapshot_running(self):
|
240 | 241 | img_ref = self.image_service.create(self.ctxt, {'name': 'snap-1'})
|
241 | 242 | instance_ref, network_info = self._get_running_instance()
|
242 |
| - self.connection.snapshot(self.ctxt, instance_ref, img_ref['id'], |
243 |
| - lambda *args, **kwargs: None) |
| 243 | + # this test depends on qemu-img |
| 244 | + # being installed and in the path, |
| 245 | + # if it is not installed, skip |
| 246 | + try: |
| 247 | + self.connection.snapshot(self.ctxt, instance_ref, img_ref['id'], |
| 248 | + lambda *args, **kwargs: None) |
| 249 | + except processutils.ProcessExecutionError as e: |
| 250 | + if 'qemu-img' in e.stderr and 'No such file' in e.stderr: |
| 251 | + self.skipTest("qemu-img not installed") |
| 252 | + raise e |
244 | 253 |
|
245 | 254 | @catch_notimplementederror
|
246 | 255 | def test_reboot(self):
|
|
0 commit comments