Skip to content

Commit

Permalink
iotests: Fix 104 for NBD
Browse files Browse the repository at this point in the history
_make_test_img sets up an NBD server, _cleanup_test_img shuts it down;
thus, _cleanup_test_img has to be called before _make_test_img is
invoked another time.

Furthermore, the pipe through _filter_test_img was unnecessary;
_make_test_img already takes care of that.

And finally, a filter is added to _filter_img_info to replace
"nbd://127.0.0.1:10810" by "TEST_DIR/t.IMGFMT", since the former is the
way to express the full image path (normally the latter) for NBD tests.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed Feb 6, 2015
1 parent 23ab695 commit a231cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/qemu-iotests/104
Expand Up @@ -28,11 +28,7 @@ here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!

_cleanup()
{
_cleanup_test_img
}
trap "_cleanup; exit \$status" 0 1 2 3 15
trap "exit \$status" 0 1 2 3 15

# get standard environment, filters and checks
. ./common.rc
Expand All @@ -47,8 +43,9 @@ echo
image_sizes="1024 1234"

for s in $image_sizes; do
_make_test_img $s | _filter_img_create
_make_test_img $s
_img_info | _filter_img_info
_cleanup_test_img
done

# success, all done
Expand Down
1 change: 1 addition & 0 deletions tests/qemu-iotests/common.filter
Expand Up @@ -200,6 +200,7 @@ _filter_img_info()
sed -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' \
-e "/encrypted: yes/d" \
-e "/cluster_size: [0-9]\\+/d" \
-e "/table_size: [0-9]\\+/d" \
Expand Down

0 comments on commit a231cb2

Please sign in to comment.