diff options
author | наб <[email protected]> | 2021-12-27 18:29:38 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-01-26 11:30:09 -0800 |
commit | d9fdba124d87be7b09f4f2a0f6256da41ee5eaa2 (patch) | |
tree | 11ee01b1e3e2a65348b341e6fa8d841b0df5aa1e /tests | |
parent | e0c5a48b3f37cffedb9f720ab3952effb4a8dcb4 (diff) |
tests: prune remaining xargs(1), add missing zfs-project -c0 note
-c0 suppresses diagnoses ‒ it's not just -c but with NULs; cf.
http://build.zfsonlinux.org/builders/Debian%2010%20x86_64%20%28TEST%29/builds/10605/steps/shell_4/logs/log
search for the second "zfs project -s -p" instance
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12979
Diffstat (limited to 'tests')
7 files changed, 9 insertions, 13 deletions
diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index ca7628855..13fee6752 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -109,8 +109,7 @@ export SYSTEM_FILES_COMMON='arp vmstat wait wc - which - xargs' + which' export SYSTEM_FILES_FREEBSD='chflags compress diff --git a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh index 2bce471a7..efb6c4754 100755 --- a/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh +++ b/tests/zfs-tests/tests/functional/alloc_class/alloc_class_012_pos.ksh @@ -33,7 +33,7 @@ function file_in_special_vdev # <dataset> <inode> { typeset dataset="$1" typeset inum="$2" - typeset num_normal=$(echo $ZPOOL_DISKS | wc -w | xargs) + typeset num_normal=$(echo $ZPOOL_DISKS | wc -w) zdb -dddddd $dataset $inum | awk -v d=$num_normal '{ # find DVAs from string "offset level dva" only for L0 (data) blocks diff --git a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_object_range_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_object_range_pos.ksh index 61c031a0c..1e63ac7d2 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_object_range_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zdb/zdb_object_range_pos.ksh @@ -142,8 +142,8 @@ log_must test "\n$actual\n" == "\n$expected\n" # Specifying individual object IDs works objects="$start1 $end1 $start2 $end2" expected="$objects" -actual=$(get_object_list $TESTPOOL/$TESTFS $objects | awk '{print $1}' | xargs) -log_must test "$actual" == "$expected" +actual=$(get_object_list $TESTPOOL/$TESTFS $objects | awk '{print $1}' | tr '\n' ' ') +log_must test "${actual% }" == "$expected" # Get all objects in the meta-objset to test m (spacemap) and z (zap) flags all_mos_objects=$(get_object_list $TESTPOOL 0:-1) diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib index 272d0834c..c64b4a35a 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add.kshlib @@ -57,7 +57,7 @@ function find_mnttab_dev if is_freebsd; then # FreeBSD doesn't have a mnttab file. mount -p | awk -v dir="^${DEV_DSKDIR}" \ - '$1 ~ dir { print $1 }' | xargs + '$1 ~ dir { print $1 }' return 0 elif is_linux; then typeset mnttab="/etc/mtab" diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh index 054d39be3..fe5559148 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_clear.ksh @@ -43,7 +43,7 @@ for i in `seq 1 $EVENTS_NUM`; do done # wait a bit to allow the kernel module to process new events zpool_events_settle -EVENTS_NUM=$(zpool events -H | wc -l | xargs) +EVENTS_NUM=$(zpool events -H | wc -l) # 3. Verify 'zpool events -c' successfully clear new events CLEAR_OUTPUT=$(zpool events -c) diff --git a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib index 6b925501b..a64aa6806 100644 --- a/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib +++ b/tests/zfs-tests/tests/functional/mv_files/mv_files_common.kshlib @@ -152,8 +152,7 @@ function generate_files # function mv_files { - find $1 -type f -print | xargs -I "{}" \ - mv {} $2 > /dev/null 2>&1 + find $1 -type f -exec mv {} $2 \; > /dev/null 2>&1 } # @@ -165,8 +164,7 @@ function mv_files function count_files { typeset -i file_num - file_num=`find $1 -type f -print | \ - wc -l` + file_num=$(find $1 -type f -print | wc -l) (( file_num != $2 )) && \ log_fail "The file number of target directory"\ "$2 is not equal to that of the source "\ diff --git a/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh b/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh index d61019242..9942a88cb 100755 --- a/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/projectquota/projecttree_002_pos.ksh @@ -109,8 +109,7 @@ log_must eval "zfs project -cr $PRJDIR/a1/a2 | grep a3 | grep 'not set'" log_must eval "zfs project -cr $PRJDIR/a1/a2 | grep d4 | grep 'not set'" log_must eval "zfs project $PRJDIR/a1/a2/a3/d4 | grep '0 \-'" -log_must eval \ - "zfs project -cr -0 $PRJDIR/a1/a2 | xargs -0 zfs project -s -p $PRJID2" +log_must eval "zfs project -s -p $PRJID2 $(zfs project -cr0 $PRJDIR/a1/a2 | tr '\0' '\t')" log_mustnot eval "zfs project -cr $PRJDIR/a1/a2 | grep a3 | grep 'not set'" log_mustnot eval "zfs project -cr $PRJDIR/a1/a2 | grep d4 | grep 'not set'" |