mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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 <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
62284d1776
commit
9cdfa1b34e
31 changed files with 89 additions and 4 deletions
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
size=128M
|
size=128M
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
# vpc is limited to 127GB, so we can't test it here
|
# 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"
|
_notrun "image format $IMGFMT does not support large image sizes"
|
||||||
fi
|
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
|
||||||
echo "creating large image"
|
echo "creating large image"
|
||||||
_make_test_img 5000G
|
_make_test_img 5000G
|
||||||
|
|
|
@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt vpc
|
_supported_fmt vpc
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# currently only qcow2 allows for consistency checks using qemu-img
|
# currently only qcow2 allows for consistency checks using qemu-img
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto file
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# much of this could be generic for any format supporting compression.
|
# much of this could be generic for any format supporting compression.
|
||||||
_supported_fmt qcow qcow2
|
_supported_fmt qcow qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# much of this could be generic for any format supporting snapshots
|
# much of this could be generic for any format supporting snapshots
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# actually any format that supports snapshots
|
# actually any format that supports snapshots
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# currently raw is the only protocol we support
|
# currently raw is the only protocol we support
|
||||||
_supported_fmt raw
|
_supported_fmt raw
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Any format supporting backing files
|
# Any format supporting backing files
|
||||||
_supported_fmt qcow qcow2 vmdk qed
|
_supported_fmt qcow qcow2 vmdk qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Any format supporting backing files
|
# Any format supporting backing files
|
||||||
_supported_fmt qcow qcow2 vmdk qed
|
_supported_fmt qcow qcow2 vmdk qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -45,6 +45,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Any format supporting backing files
|
# Any format supporting backing files
|
||||||
_supported_fmt qcow qcow2 vmdk qed
|
_supported_fmt qcow qcow2 vmdk qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Any format supporting backing files
|
# Any format supporting backing files
|
||||||
_supported_fmt qcow qcow2 vmdk qed
|
_supported_fmt qcow qcow2 vmdk qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt generic
|
_supported_fmt generic
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Any format that supports snapshots
|
# Any format that supports snapshots
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="10485760 4294967296"
|
TEST_OFFSETS="10485760 4294967296"
|
||||||
|
|
|
@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# much of this could be generic for any format supporting compression.
|
# much of this could be generic for any format supporting compression.
|
||||||
_supported_fmt qcow qcow2
|
_supported_fmt qcow qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
TEST_OFFSETS="0 4294967296"
|
TEST_OFFSETS="0 4294967296"
|
||||||
|
|
|
@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Currently only qcow2 and qed support rebasing
|
# Currently only qcow2 and qed support rebasing
|
||||||
_supported_fmt qcow2 qed
|
_supported_fmt qcow2 qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
CLUSTER_SIZE=65536
|
CLUSTER_SIZE=65536
|
||||||
|
|
|
@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.pattern
|
. ./common.pattern
|
||||||
|
|
||||||
_supported_fmt raw qcow2
|
_supported_fmt raw qcow2
|
||||||
|
_supported_proto file sheepdog
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
echo "=== Creating image"
|
echo "=== Creating image"
|
||||||
|
|
|
@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
|
|
||||||
# Currently only qcow2 supports rebasing
|
# Currently only qcow2 supports rebasing
|
||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
_supported_fmt vmdk qcow qcow2 qed
|
_supported_fmt vmdk qcow qcow2 qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
# Any format supporting backing files except vmdk and qcow which do not support
|
||||||
# smaller backing files.
|
# smaller backing files.
|
||||||
_supported_fmt qcow2 qed
|
_supported_fmt qcow2 qed
|
||||||
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
# Choose a size that is not necessarily a cluster size multiple for image
|
# Choose a size that is not necessarily a cluster size multiple for image
|
||||||
|
|
|
@ -152,12 +152,14 @@ rm -f check.full
|
||||||
[ -f check.time ] || touch check.time
|
[ -f check.time ] || touch check.time
|
||||||
|
|
||||||
FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
|
FULL_IMGFMT_DETAILS=`_full_imgfmt_details`
|
||||||
|
FULL_IMGPROTO_DETAILS=`_full_imgproto_details`
|
||||||
FULL_HOST_DETAILS=`_full_platform_details`
|
FULL_HOST_DETAILS=`_full_platform_details`
|
||||||
#FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
|
#FULL_MKFS_OPTIONS=`_scratch_mkfs_options`
|
||||||
#FULL_MOUNT_OPTIONS=`_scratch_mount_options`
|
#FULL_MOUNT_OPTIONS=`_scratch_mount_options`
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
IMGFMT -- $FULL_IMGFMT_DETAILS
|
IMGFMT -- $FULL_IMGFMT_DETAILS
|
||||||
|
IMGPROTO -- $FULL_IMGPROTO_DETAILS
|
||||||
PLATFORM -- $FULL_HOST_DETAILS
|
PLATFORM -- $FULL_HOST_DETAILS
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -43,6 +43,7 @@ randomize=false
|
||||||
rm -f $tmp.list $tmp.tmp $tmp.sed
|
rm -f $tmp.list $tmp.tmp $tmp.sed
|
||||||
|
|
||||||
export IMGFMT=raw
|
export IMGFMT=raw
|
||||||
|
export IMGPROTO=file
|
||||||
export QEMU_IO_OPTIONS=""
|
export QEMU_IO_OPTIONS=""
|
||||||
|
|
||||||
for r
|
for r
|
||||||
|
@ -123,6 +124,8 @@ check options
|
||||||
-vdi test vdi
|
-vdi test vdi
|
||||||
-vpc test vpc
|
-vpc test vpc
|
||||||
-vmdk test vmdk
|
-vmdk test vmdk
|
||||||
|
-rbd test rbd
|
||||||
|
-sheepdog test sheepdog
|
||||||
-xdiff graphical mode diff
|
-xdiff graphical mode diff
|
||||||
-nocache use O_DIRECT on backing file
|
-nocache use O_DIRECT on backing file
|
||||||
-misalign misalign memory allocations
|
-misalign misalign memory allocations
|
||||||
|
@ -179,6 +182,16 @@ testlist options
|
||||||
xpand=false
|
xpand=false
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-rbd)
|
||||||
|
IMGPROTO=rbd
|
||||||
|
xpand=false
|
||||||
|
;;
|
||||||
|
|
||||||
|
-sheepdog)
|
||||||
|
IMGPROTO=sheepdog
|
||||||
|
xpand=false
|
||||||
|
;;
|
||||||
|
|
||||||
-nocache)
|
-nocache)
|
||||||
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
|
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
|
||||||
xpand=false
|
xpand=false
|
||||||
|
|
|
@ -47,7 +47,11 @@ fi
|
||||||
# make sure we have a standard umask
|
# make sure we have a standard umask
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
TEST_IMG=$TEST_DIR/t.$IMGFMT
|
if [ "$IMGPROTO" = "file" ]; then
|
||||||
|
TEST_IMG=$TEST_DIR/t.$IMGFMT
|
||||||
|
else
|
||||||
|
TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
|
||||||
|
fi
|
||||||
|
|
||||||
_make_test_img()
|
_make_test_img()
|
||||||
{
|
{
|
||||||
|
@ -61,6 +65,7 @@ _make_test_img()
|
||||||
|
|
||||||
# XXX(hch): have global image options?
|
# XXX(hch): have global image options?
|
||||||
$QEMU_IMG create -f $IMGFMT $TEST_IMG $extra_img_options | \
|
$QEMU_IMG create -f $IMGFMT $TEST_IMG $extra_img_options | \
|
||||||
|
sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" | \
|
||||||
sed -e "s#$TEST_DIR#TEST_DIR#g" | \
|
sed -e "s#$TEST_DIR#TEST_DIR#g" | \
|
||||||
sed -e "s#$IMGFMT#IMGFMT#g" | \
|
sed -e "s#$IMGFMT#IMGFMT#g" | \
|
||||||
sed -e "s# encryption=off##g" | \
|
sed -e "s# encryption=off##g" | \
|
||||||
|
@ -72,9 +77,23 @@ _make_test_img()
|
||||||
|
|
||||||
_cleanup_test_img()
|
_cleanup_test_img()
|
||||||
{
|
{
|
||||||
rm -f $TEST_DIR/t.$IMGFMT
|
case "$IMGPROTO" in
|
||||||
rm -f $TEST_DIR/t.$IMGFMT.orig
|
|
||||||
rm -f $TEST_DIR/t.$IMGFMT.base
|
file)
|
||||||
|
rm -f $TEST_DIR/t.$IMGFMT
|
||||||
|
rm -f $TEST_DIR/t.$IMGFMT.orig
|
||||||
|
rm -f $TEST_DIR/t.$IMGFMT.base
|
||||||
|
;;
|
||||||
|
|
||||||
|
rbd)
|
||||||
|
rbd rm $TEST_DIR/t.$IMGFMT > /dev/null
|
||||||
|
;;
|
||||||
|
|
||||||
|
sheepdog)
|
||||||
|
collie vdi delete $TEST_DIR/t.$IMGFMT
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
_check_test_img()
|
_check_test_img()
|
||||||
|
@ -207,6 +226,19 @@ _supported_fmt()
|
||||||
_notrun "not suitable for this image format: $IMGFMT"
|
_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
|
# tests whether the host OS is one of the supported OSes for a test
|
||||||
#
|
#
|
||||||
_supported_os()
|
_supported_os()
|
||||||
|
@ -234,6 +266,11 @@ _full_imgfmt_details()
|
||||||
echo "$IMGFMT"
|
echo "$IMGFMT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_full_imgproto_details()
|
||||||
|
{
|
||||||
|
echo "$IMGPROTO"
|
||||||
|
}
|
||||||
|
|
||||||
_full_platform_details()
|
_full_platform_details()
|
||||||
{
|
{
|
||||||
os=`uname -s`
|
os=`uname -s`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue