Skip to content

Commit 0bbe8f9

Browse files
kevmwMichael Tokarev
authored andcommitted
iotests/244: Don't store data-file with protocol in image
We want to disable filename parsing for data files because it's too easy to abuse in malicious image files. Make the test ready for the change by passing the data file explicitly in command line options. Cc: [email protected] Signed-off-by: Kevin Wolf <[email protected]> Reviewed-by: Eric Blake <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Hanna Czenczek <[email protected]> (cherry picked from commit 2eb42a7) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 312ca40 commit 0bbe8f9

File tree

1 file changed

+16
-3
lines changed
  • tests/qemu-iotests

1 file changed

+16
-3
lines changed

tests/qemu-iotests/244

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,22 @@ $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$TEST_IMG"
215215
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$TEST_IMG"
216216

217217
# blkdebug doesn't support copy offloading, so this tests the error path
218-
$QEMU_IMG amend -f $IMGFMT -o "data_file=blkdebug::$TEST_IMG.data" "$TEST_IMG"
219-
$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$TEST_IMG"
220-
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$TEST_IMG"
218+
test_img_with_blkdebug="json:{
219+
'driver': 'qcow2',
220+
'file': {
221+
'driver': 'file',
222+
'filename': '$TEST_IMG'
223+
},
224+
'data-file': {
225+
'driver': 'blkdebug',
226+
'image': {
227+
'driver': 'file',
228+
'filename': '$TEST_IMG.data'
229+
}
230+
}
231+
}"
232+
$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n -C "$TEST_IMG.src" "$test_img_with_blkdebug"
233+
$QEMU_IMG compare -f $IMGFMT -F $IMGFMT "$TEST_IMG.src" "$test_img_with_blkdebug"
221234

222235
echo
223236
echo "=== Flushing should flush the data file ==="

0 commit comments

Comments
 (0)