qemu-iotests: Fix NFS + raw
cover qemu-iotests: Fix NFS + raw
This series fixes the NFS support in qemu-iotests, at least as far as raw is concerned. More fixes would be needed for NFS with qcow2.
Kevin Wolf (3):
qemu-iotests: Fix paths for NFS
qemu-iotests: Filter NFS paths
qemu-iotests: 086 doesn't work with NFS
tests/qemu-iotests/086 | 2 +- tests/qemu-iotests/common.filter | 6 ++++-- tests/qemu-iotests/common.rc | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.13.6
PATCH 1/3 qemu-iotests: Fix paths for NFS
Test cases were trying to use nfs:// URLs as local filenames, which made every test fail for NFS. With TEST_IMG and TEST_IMG_FILE set like for the other protocols, NFS tests can pass again.
--- tests/qemu-iotests/common.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/common.rc +2 -2
@@ -147,8 +147,8 @@ else TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT TEST_IMG="ssh://127.0.0.1$TEST_IMG_FILE" elif [ "$IMGPROTO" = "nfs" ]; then - TEST_DIR="nfs://127.0.0.1/$TEST_DIR" - TEST_IMG=$TEST_DIR/t.$IMGFMT + TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT + TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE" elif [ "$IMGPROTO" = "vxhs" ]; then TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT"
Signature · 1 line
2.13.6
PATCH 2/3 qemu-iotests: Filter NFS paths
In reply to Kevin WolfNFS paths were only partially filtered in _filter_img_create, _img_info and _filter_img_info, resulting in "nfs://127.0.0.1TEST_DIR/t.IMGFMT". This adds another replacement to the sed calls that matches $TEST_IMG as a whole.
--- tests/qemu-iotests/common.filter | 6 ++++-- tests/qemu-iotests/common.rc | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-)
tests/qemu-iotests/common.filter +4 -2
@@ -119,7 +119,8 @@ _filter_actual_image_size() # replace driver-specific options in the "Formatting..." line _filter_img_create() { - sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + sed -e "s#$TEST_IMG#TEST_DIR/t.IMGFMT#g" \ + -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ -e 's#nbd:127.0.0.1:10810#TEST_DIR/t.IMGFMT#g' \
@@ -154,7 +155,8 @@ _filter_img_info() discard=0 regex_json_spec_start='^ *"format-specific": \{' - sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + sed -e "s#$TEST_IMG#TEST_DIR/t.IMGFMT#g" \ + -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ -e 's#nbd://127.0.0.1:10810$#TEST_DIR/t.IMGFMT#g' \
tests/qemu-iotests/common.rc +2 -1
@@ -333,7 +333,8 @@ _img_info() discard=0 regex_json_spec_start='^ *"format-specific": \{' $QEMU_IMG info $QEMU_IMG_EXTRA_ARGS "$@" "$TEST_IMG" 2>&1 | \ - sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + sed -e "s#$TEST_IMG#TEST_DIR/t.IMGFMT#g" \ + -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ -e "/^disk size:/ D" \
Signature · 1 line
2.13.6
Re: [Qemu-devel] [PATCH 2/3] qemu-iotests: Filter NFS paths
Am 17.05.2018 um 18:52 hat Kevin Wolf geschrieben:
Quoted 6 lines
NFS paths were only partially filtered in
_filter_img_create,_img_infoand_filter_img_info, resulting in "nfs://127.0.0.1TEST_DIR/t.IMGFMT". This adds another replacement to the sed calls that matches $TEST_IMG as a whole.Signed-off-by Kevin Wolf <[email protected]>
Self-NACK, this replaces a bit too much... (Some places in the test scripts override $TEST_IMG, but not $TEST_IMG_FILE).
Maybe we need to introduce some $TEST_DIR_REMOTE (any suggestions for a better name?) that would contain "nfs://127.0.0.1$TEST_DIR" and can be used in the filter function.
Kevin
PATCH 3/3 qemu-iotests: 086 doesn't work with NFS
In reply to Kevin WolfThe reference output file only works for file. 'qemu-img convert -p' makes a lot more progress updates for NFS than for file, so disable the test for NFS.
--- tests/qemu-iotests/086 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests/086 +1 -1
@@ -38,7 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt qcow2 raw -_supported_proto file nfs +_supported_proto file _supported_os Linux function run_qemu_img()
Signature · 1 line
2.13.6