Skip to content

Commit

Permalink
add test for pool create during import
Browse files Browse the repository at this point in the history
Signed-off-by: Don Brady <don.brady@klarasystems.com>
  • Loading branch information
don-brady committed Jan 8, 2024
1 parent f6e58a4 commit f131676
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function pool_add_device
echo ${pool}: added $devtype vdev in $SECONDS secs
echo $SECONDS > ${DEVICE_DIR}/${pool}-add
else
echo ${pool}: add $devtype ivdev failed ${errmsg}, in $SECONDS secs
echo ${pool}: add $devtype vdev failed ${errmsg}, in $SECONDS secs
fi
}

Expand All @@ -100,6 +100,21 @@ function pool_stats
fi
}

function pool_create
{
typeset pool=$1
typeset device=$2

SECONDS=0
errmsg=$(zpool create $pool $device 2>&1 > /dev/null)
if [[ $? -eq 0 ]]; then
echo ${pool}: created in $SECONDS secs
echo $SECONDS > ${DEVICE_DIR}/${pool}-create
else
echo ${pool}: create failed ${errmsg}, in $SECONDS secs
fi
}

log_assert "Simple admin commands to different pool not blocked by import"

log_onexit cleanup
Expand Down Expand Up @@ -129,6 +144,7 @@ pool_stats "status" $TESTPOOL1 &
pool_stats "status" $TESTPOOL2 &
pool_stats "list" $TESTPOOL1 &
pool_stats "list" $TESTPOOL2 &
pool_create $TESTPOOL1 $VDEV4 &
wait

log_must zpool sync $TESTPOOL1 $TESTPOOL2
Expand All @@ -144,5 +160,6 @@ log_must test "5" -lt $(<${DEVICE_DIR}/${TESTPOOL1}-import)
log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-status)
log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-list)
log_must test "2" -gt $(<${DEVICE_DIR}/${TESTPOOL2}-add)
[[ -e ${DEVICE_DIR}/${TESTPOOL1}-create ]] && log_fail "unexpected pool create"

log_pass "Simple admin commands to different pool not blocked by import"

0 comments on commit f131676

Please sign in to comment.