mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
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 .
|
||||
.Bl -tag -width "-p id"
|
||||
.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
|
||||
Check the directory project ID and inherit flag, not its children.
|
||||
.It Fl p Ar id
|
||||
|
@ -109,8 +109,7 @@ export SYSTEM_FILES_COMMON='arp
|
||||
vmstat
|
||||
wait
|
||||
wc
|
||||
which
|
||||
xargs'
|
||||
which'
|
||||
|
||||
export SYSTEM_FILES_FREEBSD='chflags
|
||||
compress
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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 "\
|
||||
|
@ -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'"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user