Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | function setup_test_env | ||||
destroy_pool $pool | destroy_pool $pool | ||||
log_must create_vdevs $vdevs | log_must create_vdevs $vdevs | ||||
$ECHO $vdevs | tr ' ' '\n' > $BASEDIR/vdevs | $ECHO $vdevs | tr ' ' '\n' > $BASEDIR/vdevs | ||||
log_must $ZPOOL create -m $TESTDIR $pool $keyword $vdevs | log_must $ZPOOL create -m $TESTDIR $pool $keyword $vdevs | ||||
typeset file=$TESTDIR/file | typeset file=$TESTDIR/file | ||||
log_must $FILE_WRITE -o create -f $file -b $BLOCKSZ -c $NUM_WRITES | log_must $FILE_WRITE -o create -f $file -b $BLOCKSZ -c $NUM_WRITES | ||||
log_must force_sync_path $TESTDIR | force_sync_path $BASEDIR | ||||
record_data $TESTPOOL $PRE_RECORD_FILE | record_data $TESTPOOL $PRE_RECORD_FILE | ||||
} | } | ||||
# | # | ||||
# Check pool data is valid | # Check pool data is valid | ||||
# | # | ||||
# $1 pool | # $1 pool | ||||
# | # | ||||
Show All 27 Lines | |||||
# Synchronize all the data in pool | # Synchronize all the data in pool | ||||
# | # | ||||
# $1 pool name | # $1 pool name | ||||
# | # | ||||
function sync_pool #pool | function sync_pool #pool | ||||
{ | { | ||||
typeset pool=$1 | typeset pool=$1 | ||||
log_must force_sync_path $pool | force_sync_path $BASEDIR | ||||
# If the OS has detected corruption on the pool, it will have | # If the OS has detected corruption on the pool, it will have | ||||
# automatically initiated a scrub. In that case, our "zpool scrub" | # automatically initiated a scrub. In that case, our "zpool scrub" | ||||
# command will fail. So we ignore its exit status and just check that | # command will fail. So we ignore its exit status and just check that | ||||
# the pool is scrubbing or has been scrubbed. | # the pool is scrubbing or has been scrubbed. | ||||
$ZPOOL scrub $pool >/dev/null 2>&1 | $ZPOOL scrub $pool >/dev/null 2>&1 | ||||
is_pool_scrubbing $pool || is_pool_scrubbed $pool || \ | is_pool_scrubbing $pool || is_pool_scrubbed $pool || \ | ||||
log_fail "$ZPOOL scrub $pool failed." | log_fail "$ZPOOL scrub $pool failed." | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |