mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
ZTS: Adopt OpenZFS test analysis script
Adopt and extend the OpenZFS ZTS results analysis script for use with ZFS on Linux. This allows for automatic analysis of tests which may be skipped for a variety or reasons or which are not entirely reliable. In addition to the list of 'known' failures, which have been updated for ZFS on Linux, there in a new 'maybe' section. This mapping include tests which might be correctly skipped depending on the test environment. This may be because of a missing dependency or lack of required kernel support. This list also includes tests which normally pass but might on occasion fail for a harmless reason. The script was also extended include a reason for why a given test might be skipped or may fail. The reason will be included after the test in the "results other than PASS that are expected" section. For failures it is preferable to set the reason to the GitHub issue number and for skipped tests several generic reasons are available. You may also specify a custom reason if needed. All tests were added back in to the linux.run file even if they are expected to failed. There is value in running tests which may not pass, the expected results for these tests has been encoded in the new analysis script. All tests which were disabled because they ran more slowly on a 32-bit system have been re-enabled. Developers working on 32-bit systems should assess what it reasonable for their environment. The unnecessary dependency on physical block devices was removed for the checksum, grow_pool, and grow_replicas test groups so they are no longer skipped. Updated the filetest_001_pos test case to run properly now that it is enabled and moved the grow tests in to a single directory. Reviewed-by: Prakash Surya <prakash.surya@delphix.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7638
This commit is contained in:
@@ -35,16 +35,4 @@
|
||||
|
||||
verify_runnable "global"
|
||||
|
||||
df -F zfs -h | grep "$TESTFS " >/dev/null
|
||||
[[ $? == 0 ]] && log_must zfs umount -f $TESTDIR
|
||||
destroy_pool $TESTPOOL
|
||||
|
||||
# recreate and destroy a zpool over the disks to restore the partitions to
|
||||
# normal
|
||||
if [[ -n $SINGLE_DISK ]]; then
|
||||
log_must cleanup_devices $MIRROR_PRIMARY
|
||||
else
|
||||
log_must cleanup_devices $MIRROR_PRIMARY $MIRROR_SECONDARY
|
||||
fi
|
||||
|
||||
log_pass
|
||||
default_cleanup
|
||||
|
||||
@@ -28,39 +28,4 @@
|
||||
# Copyright (c) 2013 by Delphix. All rights reserved.
|
||||
#
|
||||
|
||||
typeset -i NUMBER_OF_DISKS=0
|
||||
for i in $DISKS; do
|
||||
[[ -n $MIRROR_PRIMARY ]] && MIRROR_SECONDARY=$i
|
||||
[[ -z $MIRROR_PRIMARY ]] && MIRROR_PRIMARY=$i
|
||||
done
|
||||
|
||||
if [[ -z $MIRROR_SECONDARY ]]; then
|
||||
# We need to repartition the single disk to two slices
|
||||
SINGLE_DISK=$MIRROR_PRIMARY
|
||||
MIRROR_SECONDARY=$MIRROR_PRIMARY
|
||||
SIDE_PRIMARY_PART=0
|
||||
SIDE_SECONDARY_PART=1
|
||||
if is_linux; then
|
||||
SIDE_PRIMARY=${SINGLE_DISK}p1
|
||||
SIDE_SECONDARY=${SINGLE_DISK}p2
|
||||
else
|
||||
SIDE_PRIMARY=${SINGLE_DISK}s${SIDE_PRIMARY_PART}
|
||||
SIDE_SECONDARY=${SINGLE_DISK}s${SIDE_SECONDARY_PART}
|
||||
fi
|
||||
else
|
||||
SIDE_PRIMARY_PART=0
|
||||
SIDE_SECONDARY_PART=0
|
||||
if is_linux; then
|
||||
SIDE_PRIMARY=${MIRROR_PRIMARY}p1
|
||||
SIDE_SECONDARY=${MIRROR_SECONDARY}p1
|
||||
else
|
||||
SIDE_PRIMARY=${MIRROR_PRIMARY}s${SIDE_PRIMARY_PART}
|
||||
SIDE_SECONDARY=${MIRROR_SECONDARY}s${SIDE_SECONDARY_PART}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
export MIRROR_PRIMARY MIRROR_SECONDARY SINGLE_DISK SIDE_PRIMARY SIDE_SECONDARY
|
||||
|
||||
export MIRROR_MEGS=100
|
||||
export MIRROR_SIZE=${MIRROR_MEGS}m # default mirror size
|
||||
set -A CHECKSUM_TYPES "fletcher2" "fletcher4" "sha256" "sha512" "skein" "edonr"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
. $STF_SUITE/include/properties.shlib
|
||||
. $STF_SUITE/tests/functional/checksum/default.cfg
|
||||
|
||||
# DESCRIPTION:
|
||||
# Sanity test to make sure checksum algorithms work.
|
||||
@@ -60,14 +61,9 @@ log_assert "Create and read back files with using different checksum algorithms"
|
||||
|
||||
log_onexit cleanup
|
||||
|
||||
FSSIZE=$(zpool list -Hp -o size $TESTPOOL)
|
||||
WRITESZ=1048576
|
||||
WRITECNT=$((($FSSIZE) / $WRITESZ ))
|
||||
# Skip the first and last 4MB
|
||||
SKIP=4127518
|
||||
SKIPCNT=$((($SKIP / $WRITESZ )))
|
||||
SKIPCNT=$((($SKIPCNT * 2)))
|
||||
WRITECNT=$((($WRITECNT - $SKIPCNT)))
|
||||
SKIPCNT=$(((4194304 / $WRITESZ) * 2))
|
||||
WRITECNT=$((($MINVDEVSIZE / $WRITESZ) - $SKIPCNT))
|
||||
|
||||
# Get a list of vdevs in our pool
|
||||
set -A array $(get_disklist_fullpath)
|
||||
@@ -75,19 +71,21 @@ set -A array $(get_disklist_fullpath)
|
||||
# Get the first vdev, since we will corrupt it later
|
||||
firstvdev=${array[0]}
|
||||
|
||||
# First test each checksum by writing a file using it, and confirm there's no
|
||||
# errors.
|
||||
for ((count = 0; count < ${#checksum_props[*]} ; count++)); do
|
||||
i=${checksum_props[$count]}
|
||||
zfs set checksum=$i $TESTPOOL
|
||||
file_write -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
|
||||
done
|
||||
zpool export $TESTPOOL
|
||||
zpool import $TESTPOOL
|
||||
zpool scrub $TESTPOOL
|
||||
while is_pool_scrubbing $TESTPOOL; do
|
||||
sleep 1
|
||||
# Test each checksum by writing a file using it, confirm there are no errors.
|
||||
typeset -i i=1
|
||||
while [[ $i -lt ${#CHECKSUM_TYPES[*]} ]]; do
|
||||
type=${CHECKSUM_TYPES[i]}
|
||||
log_must zfs set checksum=$type $TESTPOOL
|
||||
log_must file_write -o overwrite -f $TESTDIR/test_$type \
|
||||
-b $WRITESZ -c 5 -d R
|
||||
(( i = i + 1 ))
|
||||
done
|
||||
|
||||
log_must zpool export $TESTPOOL
|
||||
log_must zpool import $TESTPOOL
|
||||
log_must zpool scrub $TESTPOOL
|
||||
log_must wait_scrubbed $TESTPOOL
|
||||
|
||||
zpool status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
|
||||
log_assert "Normal file write test saw $cksum checksum errors"
|
||||
log_must [ $cksum -eq 0 ]
|
||||
@@ -95,31 +93,32 @@ log_must [ $cksum -eq 0 ]
|
||||
rm -fr $TESTDIR/*
|
||||
|
||||
log_assert "Test scrambling the disk and seeing checksum errors"
|
||||
for ((count = 0; count < ${#checksum_props[*]} ; count++)); do
|
||||
i=${checksum_props[$count]}
|
||||
zfs set checksum=$i $TESTPOOL
|
||||
file_write -o overwrite -f $TESTDIR/test_$i -b $WRITESZ -c 5 -d R
|
||||
typeset -i j=1
|
||||
while [[ $j -lt ${#CHECKSUM_TYPES[*]} ]]; do
|
||||
type=${CHECKSUM_TYPES[$j]}
|
||||
log_must zfs set checksum=$type $TESTPOOL
|
||||
log_must file_write -o overwrite -f $TESTDIR/test_$type \
|
||||
-b $WRITESZ -c 5 -d R
|
||||
|
||||
zpool export $TESTPOOL
|
||||
log_must zpool export $TESTPOOL
|
||||
|
||||
# Scramble the data on the first vdev in our pool.
|
||||
# Skip the first and last 16MB of data, then scramble the rest after that
|
||||
#
|
||||
file_write -o overwrite -f $firstvdev -s $SKIP -c $WRITECNT -b $WRITESZ -d R
|
||||
# Scramble the data on the first vdev in our pool. Skip the first
|
||||
# and last 16MB of data, then scramble the rest after that.
|
||||
log_must dd if=/dev/zero of=$firstvdev bs=$WRITESZ skip=$SKIPCNT \
|
||||
count=$WRITECNT
|
||||
|
||||
zpool import $TESTPOOL
|
||||
log_must zpool import $TESTPOOL
|
||||
log_must zpool scrub $TESTPOOL
|
||||
log_must wait_scrubbed $TESTPOOL
|
||||
|
||||
i=${checksum_props[$count]}
|
||||
zpool scrub $TESTPOOL
|
||||
while is_pool_scrubbing $TESTPOOL; do
|
||||
sleep 1
|
||||
done
|
||||
zpool status -P -v $TESTPOOL | grep $firstvdev | \
|
||||
read -r name state rd wr cksum
|
||||
|
||||
zpool status -P -v $TESTPOOL | grep $firstvdev | read -r name state rd wr cksum
|
||||
|
||||
log_assert "Checksum '$i' caught $cksum checksum errors"
|
||||
log_assert "Checksum '$type' caught $cksum checksum errors"
|
||||
log_must [ $cksum -ne 0 ]
|
||||
|
||||
rm -f $TESTDIR/test_$i
|
||||
zpool clear $TESTPOOL
|
||||
rm -f $TESTDIR/test_$type
|
||||
log_must zpool clear $TESTPOOL
|
||||
|
||||
(( j = j + 1 ))
|
||||
done
|
||||
|
||||
@@ -30,22 +30,7 @@
|
||||
#
|
||||
|
||||
. $STF_SUITE/include/libtest.shlib
|
||||
. $STF_SUITE/tests/functional/checksum/default.cfg
|
||||
|
||||
verify_runnable "global"
|
||||
|
||||
if ! $(is_physical_device $DISKS) ; then
|
||||
log_unsupported "This directory cannot be run on raw files."
|
||||
fi
|
||||
|
||||
if [[ -n $SINGLE_DISK ]]; then
|
||||
log_note "Partitioning a single disk ($SINGLE_DISK)"
|
||||
else
|
||||
log_note "Partitioning disks ($MIRROR_PRIMARY $MIRROR_SECONDARY)"
|
||||
fi
|
||||
log_must set_partition $SIDE_PRIMARY_PART "" $MIRROR_SIZE $MIRROR_PRIMARY
|
||||
log_must set_partition $SIDE_SECONDARY_PART "" $MIRROR_SIZE $MIRROR_SECONDARY
|
||||
|
||||
default_mirror_setup $SIDE_PRIMARY $SIDE_SECONDARY
|
||||
|
||||
log_pass
|
||||
default_mirror_setup $DISKS
|
||||
|
||||
Reference in New Issue
Block a user