From 9cdfa1b34e22bc09e80042b1ef3e4a5096f260d5 Mon Sep 17 00:00:00 2001 From: MORITA Kazutaka Date: Tue, 18 Jan 2011 02:01:17 +0900 Subject: qemu-iotests: add support for rbd and sheepdog protocols This patch introduces tests for protocols other than file, and initially supports rbd and sheepdog. Signed-off-by: MORITA Kazutaka Signed-off-by: Christoph Hellwig --- tests/qemu-iotests/001 | 1 + tests/qemu-iotests/002 | 1 + tests/qemu-iotests/003 | 1 + tests/qemu-iotests/004 | 1 + tests/qemu-iotests/005 | 6 ++++++ tests/qemu-iotests/006 | 1 + tests/qemu-iotests/007 | 1 + tests/qemu-iotests/008 | 1 + tests/qemu-iotests/009 | 1 + tests/qemu-iotests/010 | 1 + tests/qemu-iotests/011 | 1 + tests/qemu-iotests/012 | 1 + tests/qemu-iotests/013 | 1 + tests/qemu-iotests/014 | 1 + tests/qemu-iotests/015 | 1 + tests/qemu-iotests/016 | 1 + tests/qemu-iotests/017 | 1 + tests/qemu-iotests/018 | 1 + tests/qemu-iotests/019 | 1 + tests/qemu-iotests/020 | 1 + tests/qemu-iotests/021 | 1 + tests/qemu-iotests/022 | 1 + tests/qemu-iotests/023 | 1 + tests/qemu-iotests/024 | 1 + tests/qemu-iotests/025 | 1 + tests/qemu-iotests/026 | 1 + tests/qemu-iotests/027 | 1 + tests/qemu-iotests/028 | 1 + tests/qemu-iotests/check | 2 ++ tests/qemu-iotests/common | 13 +++++++++++++ tests/qemu-iotests/common.rc | 45 ++++++++++++++++++++++++++++++++++++++++---- 31 files changed, 89 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/001 b/tests/qemu-iotests/001 index fe66a8e5d3..bd88dde879 100755 --- a/tests/qemu-iotests/001 +++ b/tests/qemu-iotests/001 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002 index 57af974168..bebed84fd9 100755 --- a/tests/qemu-iotests/002 +++ b/tests/qemu-iotests/002 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003 index 656da99e69..ee25fb8078 100755 --- a/tests/qemu-iotests/003 +++ b/tests/qemu-iotests/003 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux size=128M diff --git a/tests/qemu-iotests/004 b/tests/qemu-iotests/004 index 3de7ed859a..c76451c5a7 100755 --- a/tests/qemu-iotests/004 +++ b/tests/qemu-iotests/004 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005 index 480276bce5..74537dbabb 100755 --- a/tests/qemu-iotests/005 +++ b/tests/qemu-iotests/005 @@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux # vpc is limited to 127GB, so we can't test it here @@ -49,6 +50,11 @@ if [ "$IMGFMT" = "vpc" ]; then _notrun "image format $IMGFMT does not support large image sizes" fi +# sheepdog image is limited to 4TB, so we can't test it here +if [ "$IMGPROTO" = "sheepdog" ]; then + _notrun "image protocol $IMGPROTO does not support large image sizes" +fi + echo echo "creating large image" _make_test_img 5000G diff --git a/tests/qemu-iotests/006 b/tests/qemu-iotests/006 index 98ef4ea91d..0c0cf5d32f 100755 --- a/tests/qemu-iotests/006 +++ b/tests/qemu-iotests/006 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt vpc +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007 index 2de1aa4977..0139264c4f 100755 --- a/tests/qemu-iotests/007 +++ b/tests/qemu-iotests/007 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # currently only qcow2 allows for consistency checks using qemu-img _supported_fmt qcow2 +_supported_proto generic _supported_os Linux echo diff --git a/tests/qemu-iotests/008 b/tests/qemu-iotests/008 index b697deb2e3..2c53bac925 100755 --- a/tests/qemu-iotests/008 +++ b/tests/qemu-iotests/008 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009 index 1499b77e91..f7262b57bf 100755 --- a/tests/qemu-iotests/009 +++ b/tests/qemu-iotests/009 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010 index 440e9f68fa..e3205aa206 100755 --- a/tests/qemu-iotests/010 +++ b/tests/qemu-iotests/010 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011 index 87b4082481..59df1ae48e 100755 --- a/tests/qemu-iotests/011 +++ b/tests/qemu-iotests/011 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/012 b/tests/qemu-iotests/012 index 32a264750e..4052956cd9 100755 --- a/tests/qemu-iotests/012 +++ b/tests/qemu-iotests/012 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto file _supported_os Linux diff --git a/tests/qemu-iotests/013 b/tests/qemu-iotests/013 index 0671bf6ddc..ce40d5c5b6 100755 --- a/tests/qemu-iotests/013 +++ b/tests/qemu-iotests/013 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # much of this could be generic for any format supporting compression. _supported_fmt qcow qcow2 +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014 index f38af43945..a6d0aea7c0 100755 --- a/tests/qemu-iotests/014 +++ b/tests/qemu-iotests/014 @@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # much of this could be generic for any format supporting snapshots _supported_fmt qcow2 +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015 index f3b0acc688..bdafd26293 100755 --- a/tests/qemu-iotests/015 +++ b/tests/qemu-iotests/015 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # actually any format that supports snapshots _supported_fmt qcow2 +_supported_proto generic _supported_os Linux echo diff --git a/tests/qemu-iotests/016 b/tests/qemu-iotests/016 index e09ab86425..16f151f29d 100755 --- a/tests/qemu-iotests/016 +++ b/tests/qemu-iotests/016 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # currently raw is the only protocol we support _supported_fmt raw +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017 index 29dd53fb29..66951eb1a8 100755 --- a/tests/qemu-iotests/017 +++ b/tests/qemu-iotests/017 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files _supported_fmt qcow qcow2 vmdk qed +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018 index f155b4961e..bd2db78715 100755 --- a/tests/qemu-iotests/018 +++ b/tests/qemu-iotests/018 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files _supported_fmt qcow qcow2 vmdk qed +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019 index a2d67c3269..8872b30350 100755 --- a/tests/qemu-iotests/019 +++ b/tests/qemu-iotests/019 @@ -45,6 +45,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files _supported_fmt qcow qcow2 vmdk qed +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index b065a53640..2fb0ff87f2 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files _supported_fmt qcow qcow2 vmdk qed +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/021 b/tests/qemu-iotests/021 index eb61230944..6da79ebbbe 100755 --- a/tests/qemu-iotests/021 +++ b/tests/qemu-iotests/021 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt generic +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/022 b/tests/qemu-iotests/022 index 635ad146a4..d35b8162be 100755 --- a/tests/qemu-iotests/022 +++ b/tests/qemu-iotests/022 @@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format that supports snapshots _supported_fmt qcow2 +_supported_proto generic _supported_os Linux TEST_OFFSETS="10485760 4294967296" diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023 index 55c5be7693..4f31b56589 100755 --- a/tests/qemu-iotests/023 +++ b/tests/qemu-iotests/023 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # much of this could be generic for any format supporting compression. _supported_fmt qcow qcow2 +_supported_proto generic _supported_os Linux TEST_OFFSETS="0 4294967296" diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024 index ff6e9842c9..3d6f103b65 100755 --- a/tests/qemu-iotests/024 +++ b/tests/qemu-iotests/024 @@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Currently only qcow2 and qed support rebasing _supported_fmt qcow2 qed +_supported_proto generic _supported_os Linux CLUSTER_SIZE=65536 diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025 index 6af1e46a1d..fba44a47fb 100755 --- a/tests/qemu-iotests/025 +++ b/tests/qemu-iotests/025 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.pattern _supported_fmt raw qcow2 +_supported_proto file sheepdog _supported_os Linux echo "=== Creating image" diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index ad109f743e..33e7da6abe 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Currently only qcow2 supports rebasing _supported_fmt qcow2 +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027 index 543c48ffaf..7d90481832 100755 --- a/tests/qemu-iotests/027 +++ b/tests/qemu-iotests/027 @@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter _supported_fmt vmdk qcow qcow2 qed +_supported_proto generic _supported_os Linux diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index cb8b25517a..8321c93d46 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -45,6 +45,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files except vmdk and qcow which do not support # smaller backing files. _supported_fmt qcow2 qed +_supported_proto generic _supported_os Linux # Choose a size that is not necessarily a cluster size multiple for image diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index e0eaa7a061..84ef3e5480 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -152,12 +152,14 @@ rm -f check.full [ -f check.time ] || touch check.time FULL_IMGFMT_DETAILS=`_full_imgfmt_details` +FULL_IMGPROTO_DETAILS=`_full_imgproto_details` FULL_HOST_DETAILS=`_full_platform_details` #FULL_MKFS_OPTIONS=`_scratch_mkfs_options` #FULL_MOUNT_OPTIONS=`_scratch_mount_options` cat < /dev/null + ;; + + sheepdog) + collie vdi delete $TEST_DIR/t.$IMGFMT + ;; + + esac } _check_test_img() @@ -207,6 +226,19 @@ _supported_fmt() _notrun "not suitable for this image format: $IMGFMT" } +# tests whether $IMGPROTO is one of the supported image protocols for a test +# +_supported_proto() +{ + for f; do + if [ "$f" = "$IMGPROTO" -o "$f" = "generic" ]; then + return + fi + done + + _notrun "not suitable for this image protocol: $IMGPROTO" +} + # tests whether the host OS is one of the supported OSes for a test # _supported_os() @@ -234,6 +266,11 @@ _full_imgfmt_details() echo "$IMGFMT" } +_full_imgproto_details() +{ + echo "$IMGPROTO" +} + _full_platform_details() { os=`uname -s` -- cgit v1.2.3-55-g7522