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 <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12979
This commit is contained in:
parent
e0c5a48b3f
commit
d9fdba124d
|
@ -104,7 +104,7 @@ target directory's project ID or the one specified with
|
||||||
.Fl p .
|
.Fl p .
|
||||||
.Bl -tag -width "-p id"
|
.Bl -tag -width "-p id"
|
||||||
.It Fl 0
|
.It Fl 0
|
||||||
Delimit filenames with a NUL byte instead of newline.
|
Delimit filenames with a NUL byte instead of newline, don't output diagnoses.
|
||||||
.It Fl d
|
.It Fl d
|
||||||
Check the directory project ID and inherit flag, not its children.
|
Check the directory project ID and inherit flag, not its children.
|
||||||
.It Fl p Ar id
|
.It Fl p Ar id
|
||||||
|
|
|
@ -109,8 +109,7 @@ export SYSTEM_FILES_COMMON='arp
|
||||||
vmstat
|
vmstat
|
||||||
wait
|
wait
|
||||||
wc
|
wc
|
||||||
which
|
which'
|
||||||
xargs'
|
|
||||||
|
|
||||||
export SYSTEM_FILES_FREEBSD='chflags
|
export SYSTEM_FILES_FREEBSD='chflags
|
||||||
compress
|
compress
|
||||||
|
|
|
@ -33,7 +33,7 @@ function file_in_special_vdev # <dataset> <inode>
|
||||||
{
|
{
|
||||||
typeset dataset="$1"
|
typeset dataset="$1"
|
||||||
typeset inum="$2"
|
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 '{
|
zdb -dddddd $dataset $inum | awk -v d=$num_normal '{
|
||||||
# find DVAs from string "offset level dva" only for L0 (data) blocks
|
# find DVAs from string "offset level dva" only for L0 (data) blocks
|
||||||
|
|
|
@ -142,8 +142,8 @@ log_must test "\n$actual\n" == "\n$expected\n"
|
||||||
# Specifying individual object IDs works
|
# Specifying individual object IDs works
|
||||||
objects="$start1 $end1 $start2 $end2"
|
objects="$start1 $end1 $start2 $end2"
|
||||||
expected="$objects"
|
expected="$objects"
|
||||||
actual=$(get_object_list $TESTPOOL/$TESTFS $objects | awk '{print $1}' | xargs)
|
actual=$(get_object_list $TESTPOOL/$TESTFS $objects | awk '{print $1}' | tr '\n' ' ')
|
||||||
log_must test "$actual" == "$expected"
|
log_must test "${actual% }" == "$expected"
|
||||||
|
|
||||||
# Get all objects in the meta-objset to test m (spacemap) and z (zap) flags
|
# Get all objects in the meta-objset to test m (spacemap) and z (zap) flags
|
||||||
all_mos_objects=$(get_object_list $TESTPOOL 0:-1)
|
all_mos_objects=$(get_object_list $TESTPOOL 0:-1)
|
||||||
|
|
|
@ -57,7 +57,7 @@ function find_mnttab_dev
|
||||||
if is_freebsd; then
|
if is_freebsd; then
|
||||||
# FreeBSD doesn't have a mnttab file.
|
# FreeBSD doesn't have a mnttab file.
|
||||||
mount -p | awk -v dir="^${DEV_DSKDIR}" \
|
mount -p | awk -v dir="^${DEV_DSKDIR}" \
|
||||||
'$1 ~ dir { print $1 }' | xargs
|
'$1 ~ dir { print $1 }'
|
||||||
return 0
|
return 0
|
||||||
elif is_linux; then
|
elif is_linux; then
|
||||||
typeset mnttab="/etc/mtab"
|
typeset mnttab="/etc/mtab"
|
||||||
|
|
|
@ -43,7 +43,7 @@ for i in `seq 1 $EVENTS_NUM`; do
|
||||||
done
|
done
|
||||||
# wait a bit to allow the kernel module to process new events
|
# wait a bit to allow the kernel module to process new events
|
||||||
zpool_events_settle
|
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
|
# 3. Verify 'zpool events -c' successfully clear new events
|
||||||
CLEAR_OUTPUT=$(zpool events -c)
|
CLEAR_OUTPUT=$(zpool events -c)
|
||||||
|
|
|
@ -152,8 +152,7 @@ function generate_files
|
||||||
#
|
#
|
||||||
function mv_files
|
function mv_files
|
||||||
{
|
{
|
||||||
find $1 -type f -print | xargs -I "{}" \
|
find $1 -type f -exec mv {} $2 \; > /dev/null 2>&1
|
||||||
mv {} $2 > /dev/null 2>&1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -165,8 +164,7 @@ function mv_files
|
||||||
function count_files
|
function count_files
|
||||||
{
|
{
|
||||||
typeset -i file_num
|
typeset -i file_num
|
||||||
file_num=`find $1 -type f -print | \
|
file_num=$(find $1 -type f -print | wc -l)
|
||||||
wc -l`
|
|
||||||
(( file_num != $2 )) && \
|
(( file_num != $2 )) && \
|
||||||
log_fail "The file number of target directory"\
|
log_fail "The file number of target directory"\
|
||||||
"$2 is not equal to that of the source "\
|
"$2 is not equal to that of the source "\
|
||||||
|
|
|
@ -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 -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 $PRJDIR/a1/a2/a3/d4 | grep '0 \-'"
|
||||||
|
|
||||||
log_must eval \
|
log_must eval "zfs project -s -p $PRJID2 $(zfs project -cr0 $PRJDIR/a1/a2 | tr '\0' '\t')"
|
||||||
"zfs project -cr -0 $PRJDIR/a1/a2 | xargs -0 zfs project -s -p $PRJID2"
|
|
||||||
log_mustnot eval "zfs project -cr $PRJDIR/a1/a2 | grep a3 | grep 'not set'"
|
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'"
|
log_mustnot eval "zfs project -cr $PRJDIR/a1/a2 | grep d4 | grep 'not set'"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue