Skip to content

Commit 47428f6

Browse files
committed
Stabilize iso format unit tests
Some version of mkisofs does not properly handle if both the input and the output file of the command are the same. So this commit changes the unit tests depending on that binary to use a different files. Related-Bug: #2059809 Change-Id: I6924eb23ff5804c22a48ec6fabcec25f061906bb (cherry picked from commit c6d8c69) (cherry picked from commit a8783a7) (cherry picked from commit 02147b3)
1 parent 673103f commit 47428f6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nova/tests/unit/image/test_format_inspector.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,15 @@ def _create_iso(self, image_size, subformat='9660'):
9191
subprocess.check_output(
9292
'dd if=/dev/zero of=%s bs=1M count=%i' % (fn, size),
9393
shell=True)
94+
# We need to use different file as input and output as the behavior
95+
# of mkisofs is version dependent if both the input and the output
96+
# are the same and can cause test failures
97+
out_fn = "%s.iso" % fn
9498
subprocess.check_output(
95-
'%s -V "TEST" -o %s %s' % (base_cmd, fn, fn),
99+
'%s -V "TEST" -o %s %s' % (base_cmd, out_fn, fn),
96100
shell=True)
97-
return fn
101+
self._created_files.append(out_fn)
102+
return out_fn
98103

99104
def _create_img(
100105
self, fmt, size, subformat=None, options=None,

0 commit comments

Comments
 (0)