Project

General

Profile

Actions

Bug #14007

closed

zfstest: find_disks needs to be smarter

Added by Yuri Pankov 4 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Just had my rpool destroyed (overwritten) by zfs-tests using the -a (auto detect) option.

        NAME                     STATE     READ WRITE CKSUM
        rpool                    ONLINE       0     0     0
          c2t7A40F34B5A21C0F1d0  ONLINE       0     0     0

Here disk name contains A-F while find_disks only checks a-f, so this was treated as unused.

Following should help:

--- a/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
+++ b/usr/src/test/zfs-tests/cmd/scripts/zfstest.ksh
@@ -41,7 +41,7 @@ function find_disks
        typeset all_disks=$(echo '' | sudo -k format | awk \
            '/c[0-9]/ {print $2}')
        typeset used_disks=$(zpool status | awk \
-           '/c[0-9]+(t[0-9a-f]+)?d[0-9]+/ {print $1}' | sed -E \
+           '/c[0-9]+(t[0-9a-fA-F]+)?d[0-9]+/ {print $1}' | sed -E \
            's/(s|p)[0-9]+//g')

        typeset disk used avail_disks

To test this, I ran zfs-tests suite on the system with disk names as shown above, and this time my rpool was not destroyed.

Actions #1

Updated by Electric Monk about 2 months ago

  • Gerrit CR set to 1737
Actions #2

Updated by Yuri Pankov about 2 months ago

  • Description updated (diff)
Actions #3

Updated by Yuri Pankov about 2 months ago

  • Status changed from New to Pending RTI
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 90
  • Difficulty changed from Medium to Bite-size
Actions #4

Updated by Electric Monk about 1 month ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit 66597161e2ba69a84fa138bce7ac02a1e6b9746c

commit  66597161e2ba69a84fa138bce7ac02a1e6b9746c
Author: Yuri Pankov <ypankov@tintri.com>
Date:   2021-10-08T14:11:22.000Z

    14007 zfstest: find_disks needs to be smarter
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF