]> git.proxmox.com Git - mirror_zfs.git/commitdiff
ZTS: Cleanup partition tables
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Jan 2020 19:14:19 +0000 (11:14 -0800)
committerGitHub <noreply@github.com>
Mon, 6 Jan 2020 19:14:19 +0000 (11:14 -0800)
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 #9806

tests/zfs-tests/include/commands.cfg
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/inuse/inuse_008_pos.ksh

index d993a8576c767a8650504576b4becf55a93aa116..5ca2575fcf5389bbe2de6325967464ab5db10239 100644 (file)
@@ -132,6 +132,7 @@ export SYSTEM_FILES_LINUX='attr
     blockdev
     chattr
     cksum
+    dmidecode
     exportfs
     fallocate
     fdisk
index 888abdb7560e22b362c139f3f7439ad55807f6c9..7e9dd52f1125107de3d3a167dd01be6d46658c0f 100644 (file)
@@ -2301,10 +2301,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
 
index d549896ca22ac8bb5a2605b53601233a82c27ee3..8e4c8a077bf5676f92ac0255deea4147177250a0 100755 (executable)
@@ -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