Date: Fri, 9 Feb 2018 22:33:23 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r329089 - in projects/zfsd/head/tests/sys/cddl/zfs: include tests/cli_root/zpool_clear tests/redundancy Message-ID: <201802092233.w19MXNqP027070@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Fri Feb 9 22:33:22 2018 New Revision: 329089 URL: https://svnweb.freebsd.org/changeset/base/329089 Log: Fix ZFS tests that use corrupt_file There was some broken crap that snuck in due to a SpectraLogic-specific change to zdb that was never upstreamed and later reverted, but the tests were not reverted. Sponsored by: Spectra Logic Corp Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh projects/zfsd/head/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt Fri Feb 9 22:33:22 2018 (r329088) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/commands.txt Fri Feb 9 22:33:22 2018 (r329089) @@ -147,6 +147,7 @@ #%%STFSUITEDIR%%/bin/swap #/sbin/swapadd /usr/bin/sort +/usr/bin/stat /usr/bin/strings /bin/sync /usr/bin/tar Modified: projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib Fri Feb 9 22:33:22 2018 (r329088) +++ projects/zfsd/head/tests/sys/cddl/zfs/include/libtest.kshlib Fri Feb 9 22:33:22 2018 (r329089) @@ -3311,16 +3311,18 @@ function file_dva # dataset filepath [level] [offset] typeset -i offset=$4 typeset -i dva_num=$5 - # A lot of these numbers can be larger than 32-bit, so we have to - # use floats to manage them... :( - typeset -i blksz=0 - typeset -i blknum=0 - typeset -i startoff + typeset -li blksz=0 + typeset -li blknum=0 + typeset -li startoff + typeset -li inode + eval `$STAT -s "$filepath"` + inode="$st_ino" + # The inner match is for 'DVA[0]=<0:1b412600:200>', in which the # text surrounding the actual DVA is a fixed size with 8 characters # before it and 1 after. - $ZDB -P -vvvvv -o "ZFS plain file" $dataset $filepath | \ + $ZDB -P -vvvvv $dataset $inode | \ $AWK -v level=${level} -v dva_num=${dva_num} ' BEGIN { stage = 0; } (stage == 0) && ($1=="Object") { stage = 1; next; } Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh Fri Feb 9 22:33:22 2018 (r329088) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zpool_clear/zpool_clear_001_pos.ksh Fri Feb 9 22:33:22 2018 (r329089) @@ -83,7 +83,7 @@ function test_clear log_note "Testing ${type} clear type ..." [ "$type" = "device" ] && vdev_arg="${fbase}.0" - corrupt_file $TESTPOOL1 /f + corrupt_file $TESTPOOL1 /$TESTPOOL1/f log_must $ZPOOL scrub $TESTPOOL1 wait_for 20 1 is_pool_scrubbed $TESTPOOL1 log_must pool_has_errors $TESTPOOL1 Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib Fri Feb 9 22:33:22 2018 (r329088) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib Fri Feb 9 22:33:22 2018 (r329089) @@ -212,7 +212,7 @@ function damage_devs typeset -i i=0 log_mustnot pool_has_errors $pool while [ $i -lt $cnt ]; do - corrupt_file $TESTPOOL /file $i + corrupt_file $TESTPOOL $TESTDIR/file $i (( i += 1 )) done sync_pool $pool
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802092233.w19MXNqP027070>