Project

General

Profile

Actions

Bug #14161

closed

zfs_dbgmsg: test-fail callback should test if sudo is needed

Added by Toomas Soome 8 months ago. Updated 7 months ago.

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

100%

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

Description

Getting errors from sudo and no debug messages are logged:

    10:55:30.24 NOTE: Performing test-fail callback (/opt/zfs-tests/callbacks/zfs_dbgmsg)
    10:55:30.25 =================================================================
    10:55:30.25  Tailing last 200 lines of zfs_dbgmsg log
    10:55:30.25 =================================================================
    10:55:30.26 sudo: PAM account management error: Permission denied
    10:55:30.26 sudo: a password is required
    10:55:30.26 =================================================================
    10:55:30.26  End of zfs_dbgmsg log
    10:55:30.26 =================================================================

So we only should use sudo when run as non-root. Tested by running this script manually as non-root and as root. Also did full zfstest run and inspected the log for failed tests and confirmed we do get zfs debug messages.

With fix:

    00:22:41.16 NOTE: Performing test-fail callback (/opt/zfs-tests/callbacks/zfs_dbgmsg)
    00:22:41.17 =================================================================
    00:22:41.17  Tailing last 200 lines of zfs_dbgmsg log
    00:22:41.17 =================================================================
    00:22:42.30 spa_open_common: opening rpool
    00:22:42.30 spa_load(rpool, config trusted): LOADING
    00:22:42.30 disk vdev '/dev/dsk/c3t0d0s1': best uberblock found for spa rpool. txg 297238
    00:22:42.30 spa_load(rpool, config untrusted): using uberblock with txg=297238
    00:22:42.30 spa_load(rpool, config trusted): read 199 log space maps (199 total blocks - blksz = 131072 bytes) in 67 ms
    00:22:42.30 MMP thread started pool 'rpool' gethrtime 36787723190
    00:22:42.30 spa=rpool async request task=1
    00:22:42.30 spa=rpool async request task=2048
    00:22:42.30 spa_load(rpool, config trusted): LOADED
    00:22:42.30 txg 297240 open pool version 5000; software version 5000/5; uts  5.11 illumos-65ecf39910 i86pc
    00:22:42.30 ioctl get_bootenv
    00:22:42.30 MMP thread started pool 'testpool' gethrtime 238007147730
    00:22:42.30 txg 5 create pool version 5000; software version 5000/5; uts openindiana 5.11 illumos-65ecf39910 i86pc
    00:22:42.30 command: zpool create -f testpool c1t0d0
    00:22:42.30 txg 7 create testpool/testfs (id 146)
    00:22:42.30 ioctl create
    00:22:42.30 command: zfs create testpool/testfs
    00:22:42.30 txg 9 set testpool/testfs (id 146) mountpoint=/var/tmp/testdir
    00:22:42.30 command: zfs set mountpoint=/var/tmp/testdir testpool/testfs
    00:22:42.30 txg 10 set testpool/testfs (id 146) aclmode=3
    00:22:42.30 command: zfs set aclmode=passthrough testpool/testfs
    00:22:42.30 txg 11 set testpool/testfs (id 146) aclinherit=0
    00:22:42.30 command: zfs set aclinherit=discard testpool/testfs
    00:22:42.30 txg 36 set testpool/testfs (id 146) aclinherit=1
    00:22:42.30 command: zfs set aclinherit=noallow testpool/testfs
    00:22:42.30 txg 38 set testpool/testfs (id 146) aclinherit=4
    00:22:42.30 command: zfs set aclinherit=restricted testpool/testfs
    00:22:42.30 txg 40 set testpool/testfs (id 146) aclinherit=3
    00:22:42.30 command: zfs set aclinherit=passthrough testpool/testfs
    00:22:42.32 =================================================================
    00:22:42.32  End of zfs_dbgmsg log
    00:22:42.32 =================================================================

Actions #1

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 1752
Actions #2

Updated by Toomas Soome 7 months ago

  • Subject changed from zfs_dbgmsg: test-fail callback is run as root, no need for sudo to zfs_dbgmsg: test-fail callback should test if sudo is needed
  • Description updated (diff)
Actions #3

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #4

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 6d65d9e63be159eb6eb4f64a2efe53214c3d8963

commit  6d65d9e63be159eb6eb4f64a2efe53214c3d8963
Author: Toomas Soome <tsoome@me.com>
Date:   2021-11-03T23:35:23.000Z

    14161 zfs_dbgmsg: test-fail callback should test if sudo is needed
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF