File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -111,18 +111,22 @@ def _create_img(
111
111
if fmt == 'iso' :
112
112
return self ._create_iso (size , subformat )
113
113
114
- # these tests depend on qemu-img
115
- # being installed and in the path,
116
- # if it is not installed, skip
117
- try :
118
- subprocess .check_output ('qemu-img --version' , shell = True )
119
- except Exception :
120
- self .skipTest ('qemu-img not installed' )
121
-
122
114
if fmt == 'vhd' :
123
115
# QEMU calls the vhd format vpc
124
116
fmt = 'vpc'
125
117
118
+ # these tests depend on qemu-img being installed and in the path,
119
+ # if it is not installed, skip. we also need to ensure that the
120
+ # format is supported by qemu-img, this can vary depending on the
121
+ # distribution so we need to check if the format is supported via
122
+ # the help output.
123
+ try :
124
+ subprocess .check_output (
125
+ 'qemu-img --help | grep %s' % fmt , shell = True )
126
+ except Exception :
127
+ self .skipTest (
128
+ 'qemu-img not installed or does not support %s format' % fmt )
129
+
126
130
if options is None :
127
131
options = {}
128
132
opt = ''
You can’t perform that action at this time.
0 commit comments