* [Qemu-devel] [PATCH v2 0/3] qemu-iotests: Fix NFS + raw
@ 2018-05-18 14:26 Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS Kevin Wolf
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Kevin Wolf @ 2018-05-18 14:26 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
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.
v2:
- Introduce $REMOTE_TEST_DIR to avoid breaking non-NFS cases (and to
support additional files in the same directory besides $TEST_IMG)
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 | 12 +++++++++---
3 files changed, 14 insertions(+), 6 deletions(-)
--
2.13.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS
2018-05-18 14:26 [Qemu-devel] [PATCH v2 0/3] qemu-iotests: Fix NFS + raw Kevin Wolf
@ 2018-05-18 14:26 ` Kevin Wolf
2018-05-23 2:52 ` Fam Zheng
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS Kevin Wolf
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2018-05-18 14:26 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/common.rc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 9a65a11026..cb5fa14e7f 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -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"
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths
2018-05-18 14:26 [Qemu-devel] [PATCH v2 0/3] qemu-iotests: Fix NFS + raw Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS Kevin Wolf
@ 2018-05-18 14:26 ` Kevin Wolf
2018-05-23 2:55 ` Fam Zheng
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS Kevin Wolf
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2018-05-18 14:26 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
NFS 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 the test
directory not as a host path, but as an NFS URL (the prefix as used for
$TEST_IMG).
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/common.filter | 6 ++++--
tests/qemu-iotests/common.rc | 8 +++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index c5f4bcf578..f08ee55046 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -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#$REMOTE_TEST_DIR#TEST_DIR#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#$REMOTE_TEST_DIR#TEST_DIR#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' \
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index cb5fa14e7f..d236bb9f15 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -148,6 +148,7 @@ else
TEST_IMG="ssh://127.0.0.1$TEST_IMG_FILE"
elif [ "$IMGPROTO" = "nfs" ]; then
TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
+ REMOTE_TEST_DIR="nfs://127.0.0.1$TEST_DIR"
TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE"
elif [ "$IMGPROTO" = "vxhs" ]; then
TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
@@ -173,6 +174,10 @@ if [ ! -d "$TEST_DIR" ]; then
exit 1
fi
+if [ -z "$REMOTE_TEST_DIR" ]; then
+ REMOTE_TEST_DIR="$TEST_DIR"
+fi
+
if [ ! -d "$SAMPLE_IMG_DIR" ]; then
echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory"
exit 1
@@ -333,7 +338,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#$REMOTE_TEST_DIR#TEST_DIR#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" \
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS
2018-05-18 14:26 [Qemu-devel] [PATCH v2 0/3] qemu-iotests: Fix NFS + raw Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths Kevin Wolf
@ 2018-05-18 14:26 ` Kevin Wolf
2018-05-23 2:53 ` Fam Zheng
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2018-05-18 14:26 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
The 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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/086 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/086 b/tests/qemu-iotests/086
index cd4494a660..84e3835071 100755
--- a/tests/qemu-iotests/086
+++ b/tests/qemu-iotests/086
@@ -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()
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS Kevin Wolf
@ 2018-05-23 2:52 ` Fam Zheng
0 siblings, 0 replies; 7+ messages in thread
From: Fam Zheng @ 2018-05-23 2:52 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, qemu-devel
On Fri, 05/18 16:26, Kevin Wolf wrote:
> 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.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS Kevin Wolf
@ 2018-05-23 2:53 ` Fam Zheng
0 siblings, 0 replies; 7+ messages in thread
From: Fam Zheng @ 2018-05-23 2:53 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, qemu-devel
On Fri, 05/18 16:26, Kevin Wolf wrote:
> The 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.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths Kevin Wolf
@ 2018-05-23 2:55 ` Fam Zheng
0 siblings, 0 replies; 7+ messages in thread
From: Fam Zheng @ 2018-05-23 2:55 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-block, qemu-devel
On Fri, 05/18 16:26, Kevin Wolf wrote:
> NFS 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 the test
> directory not as a host path, but as an NFS URL (the prefix as used for
> $TEST_IMG).
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> tests/qemu-iotests/common.filter | 6 ++++--
> tests/qemu-iotests/common.rc | 8 +++++++-
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index c5f4bcf578..f08ee55046 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -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#$REMOTE_TEST_DIR#TEST_DIR#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#$REMOTE_TEST_DIR#TEST_DIR#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' \
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index cb5fa14e7f..d236bb9f15 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -148,6 +148,7 @@ else
> TEST_IMG="ssh://127.0.0.1$TEST_IMG_FILE"
> elif [ "$IMGPROTO" = "nfs" ]; then
> TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
> + REMOTE_TEST_DIR="nfs://127.0.0.1$TEST_DIR"
> TEST_IMG="nfs://127.0.0.1$TEST_IMG_FILE"
> elif [ "$IMGPROTO" = "vxhs" ]; then
> TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT
> @@ -173,6 +174,10 @@ if [ ! -d "$TEST_DIR" ]; then
> exit 1
> fi
>
> +if [ -z "$REMOTE_TEST_DIR" ]; then
> + REMOTE_TEST_DIR="$TEST_DIR"
This has one extra level of indentation.
Reviewed-by: Fam Zheng <famz@redhat.com>
> +fi
> +
> if [ ! -d "$SAMPLE_IMG_DIR" ]; then
> echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not a directory"
> exit 1
> @@ -333,7 +338,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#$REMOTE_TEST_DIR#TEST_DIR#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" \
> --
> 2.13.6
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-05-23 2:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-18 14:26 [Qemu-devel] [PATCH v2 0/3] qemu-iotests: Fix NFS + raw Kevin Wolf
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 1/3] qemu-iotests: Fix paths for NFS Kevin Wolf
2018-05-23 2:52 ` Fam Zheng
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter NFS paths Kevin Wolf
2018-05-23 2:55 ` Fam Zheng
2018-05-18 14:26 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: 086 doesn't work with NFS Kevin Wolf
2018-05-23 2:53 ` Fam Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).