Skip to content

Commit

Permalink
ZTS: Cleanup partition tables
Browse files Browse the repository at this point in the history
The cleanup_devices function should remove any partitions created
on the device and force the partition table to be reread.  This
is needed to ensure that blkid has an up to date version of what
devices and partitions are used by zfs.

The cleanup_devices call was removed from inuse_008_pos.ksh since
it operated on partitions instead of devices and was not needed.

Lastly ddidecode may be called by parted and was therefore added
to the constrained path.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9806
  • Loading branch information
behlendorf authored and tonyhutter committed Jan 7, 2020
1 parent e0a87b8 commit 4ad592c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/zfs-tests/include/commands.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export SYSTEM_FILES='arp
diff
dirname
dmesg
dmidecode
du
echo
egrep
Expand Down
7 changes: 4 additions & 3 deletions tests/zfs-tests/include/libtest.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -2202,10 +2202,11 @@ function cleanup_devices #vdevs
{
typeset pool="foopool$$"

if poolexists $pool ; then
destroy_pool $pool
fi
for vdev in $@; do
zero_partitions $vdev
done

poolexists $pool && destroy_pool $pool
create_pool $pool $@
destroy_pool $pool

Expand Down
1 change: 0 additions & 1 deletion tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ while (( i < ${#vdevs[*]} )); do
create_pool $TESTPOOL1 ${vdevs[i]} $vslices spare $sslices
log_must zpool export $TESTPOOL1
verify_assertion "$rawtargets"
cleanup_devices $vslices $sslices

(( i = i + 1 ))
done
Expand Down

0 comments on commit 4ad592c

Please sign in to comment.