Match on word for excluding pools from tests

Running tests locally were failing on cleanup scripts due to having a
pool named "pool". Match on word so the cleanup logic will cleanup
"testpool.*" while ignoring "pool".

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Tim Crawford <tcrawford@datto.com>
Closes #5703
This commit is contained in:
Tim Crawford 2017-01-31 17:47:32 -05:00 committed by Brian Behlendorf
parent 539d33c791
commit 544b8053db

View File

@ -450,7 +450,7 @@ function default_cleanup_noexit
[[ -z "$KEEP" ]] && KEEP="rpool"
exclude=`eval $ECHO \"'(${KEEP})'\"`
ALL_POOLS=$($ZPOOL list -H -o name \
| $GREP -v "$NO_POOLS" | $EGREP -v "$exclude")
| $GREP -v "$NO_POOLS" | $EGREP -vw "$exclude")
# Here, we loop through the pools we're allowed to
# destroy, only destroying them if it's safe to do
# so.