diff options
Diffstat (limited to 'tests/qemu-iotests/112')
-rwxr-xr-x | tests/qemu-iotests/112 | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index 28eb9aae93..a2ffc96e60 100755 --- a/tests/qemu-iotests/112 +++ b/tests/qemu-iotests/112 @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash +# group: rw # # Test cases for different refcount_bits values # @@ -19,12 +20,11 @@ # # creator -owner=mreitz@redhat.com +owner=hreitz@redhat.com seq="$(basename $0)" echo "QA output created by $seq" -here="$PWD" status=1 # failure is the default! _cleanup() @@ -39,13 +39,14 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 -_supported_proto file -_supported_os Linux +_supported_proto file fuse # This test will set refcount_bits on its own which would conflict with the -# manual setting; compat will be overridden as well -_unsupported_imgopts refcount_bits 'compat=0.10' +# manual setting; compat will be overridden as well; +# and external data files do not work well with our refcount testing +# also, compression type is not supported with compat=0.10 used in test +_unsupported_imgopts refcount_bits 'compat=0.10' data_file compression_type -function print_refcount_bits() +print_refcount_bits() { $QEMU_IMG info "$TEST_IMG" | sed -n '/refcount bits:/ s/^ *//p' } @@ -55,20 +56,20 @@ echo '=== refcount_bits limits ===' echo # Must be positive (non-zero) -IMGOPTS="$IMGOPTS,refcount_bits=0" _make_test_img 64M +_make_test_img -o "refcount_bits=0" 64M # Must be positive (non-negative) -IMGOPTS="$IMGOPTS,refcount_bits=-1" _make_test_img 64M +_make_test_img -o "refcount_bits=-1" 64M # May not exceed 64 -IMGOPTS="$IMGOPTS,refcount_bits=128" _make_test_img 64M +_make_test_img -o "refcount_bits=128" 64M # Must be a power of two -IMGOPTS="$IMGOPTS,refcount_bits=42" _make_test_img 64M +_make_test_img -o "refcount_bits=42" 64M # 1 is the minimum -IMGOPTS="$IMGOPTS,refcount_bits=1" _make_test_img 64M +_make_test_img -o "refcount_bits=1" 64M print_refcount_bits # 64 is the maximum -IMGOPTS="$IMGOPTS,refcount_bits=64" _make_test_img 64M +_make_test_img -o "refcount_bits=64" 64M print_refcount_bits # 16 is the default @@ -80,19 +81,19 @@ echo '=== refcount_bits and compat=0.10 ===' echo # Should work -IMGOPTS="$IMGOPTS,compat=0.10,refcount_bits=16" _make_test_img 64M +_make_test_img -o "compat=0.10,refcount_bits=16" 64M print_refcount_bits # Should not work -IMGOPTS="$IMGOPTS,compat=0.10,refcount_bits=1" _make_test_img 64M -IMGOPTS="$IMGOPTS,compat=0.10,refcount_bits=64" _make_test_img 64M +_make_test_img -o "compat=0.10,refcount_bits=1" 64M +_make_test_img -o "compat=0.10,refcount_bits=64" 64M echo echo '=== Snapshot limit on refcount_bits=1 ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=1" _make_test_img 64M +_make_test_img -o "refcount_bits=1" 64M print_refcount_bits $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -108,7 +109,7 @@ echo echo '=== Snapshot limit on refcount_bits=2 ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=2" _make_test_img 64M +_make_test_img -o "refcount_bits=2" 64M print_refcount_bits $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -126,7 +127,7 @@ echo echo '=== Compressed clusters with refcount_bits=1 ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=1" _make_test_img 64M +_make_test_img -o "refcount_bits=1" 64M print_refcount_bits # Both should fit into a single host cluster; instead of failing to increase the @@ -142,7 +143,7 @@ echo echo '=== MSb set in 64 bit refcount ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=64" _make_test_img 64M +_make_test_img -o "refcount_bits=64" 64M print_refcount_bits $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -160,7 +161,7 @@ echo echo '=== Snapshot on maximum 64 bit refcount value ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=64" _make_test_img 64M +_make_test_img -o "refcount_bits=64" 64M print_refcount_bits $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -241,7 +242,7 @@ echo echo '=== Testing too many references for check ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=1" _make_test_img 64M +_make_test_img -o "refcount_bits=1" 64M print_refcount_bits # This cluster should be created at 0x50000 @@ -264,7 +265,7 @@ echo echo '=== Multiple walks necessary during amend ===' echo -IMGOPTS="$IMGOPTS,refcount_bits=1,cluster_size=512" _make_test_img 64k +_make_test_img -o "refcount_bits=1,cluster_size=512" 64k # Cluster 0 is the image header, clusters 1 to 4 are used by the L1 table, a # single L2 table, the reftable and a single refblock. This creates 58 data |