From: "Luis Henriques (SUSE)" <luis.henriques@linux.dev>
To: fstests@vger.kernel.org
Cc: "Luis Henriques (SUSE)" <luis.henriques@linux.dev>
Subject: [PATCH] generic/077: ignore errors occurred while accessing the filler files
Date: Wed, 5 Jun 2024 17:32:10 +0100 [thread overview]
Message-ID: <20240605163210.18450-1-luis.henriques@linux.dev> (raw)
When looking for data to fill in the filesystem, errors accessing files
may occur. This will cause the test to fail as it'll show in the output
lines such as:
du: cannot read directory '/usr/etc/sudoers.d': Permission denied
Ignoring these errors should be safe, so simply redirecting the stderr of
'du' to $seqres.full fixes it. Unfortunately, this exposed a different
issue, which was the truncation of the $seqres.full file while copying files
into the filesystem. This patch also fixes that.
Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
---
tests/generic/077 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/generic/077 b/tests/generic/077
index 2624e88f1456..4d66f1055403 100755
--- a/tests/generic/077
+++ b/tests/generic/077
@@ -12,13 +12,13 @@ _begin_fstest acl attr auto enospc
# Something w/ enough data to fill 256M of fs...
filler=""
[ -d /lib/modules ] && \
- [ $(( $(du -h -m /lib/modules | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+ [ $(( $(du -h -m /lib/modules 2>> $seqres.full | tail -1| cut -f1) * 2 )) -ge 256 ] && \
filler=/lib/modules
# fall back in case /lib/modules doesn't exist or smaller
[[ -z $filler ]] && \
[ -d /usr ] && \
- [ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -ge 256 ] && \
+ [ $(( $(du -h -m /usr 2>> $seqres.full | tail -1| cut -f1) * 2 )) -ge 256 ] && \
filler=/usr
# Override the default cleanup function.
@@ -58,10 +58,10 @@ echo "*** set default ACL"
setfacl -R -dm u:fsgqa:rwx,g::rwx,o::r-x,m::rwx $SCRATCH_MNT/subdir
echo "*** populate filesystem, pass #1" | tee -a $seqres.full
-cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
+cp -rf $filler $SCRATCH_MNT/subdir >>$seqres.full 2>&1
echo "*** populate filesystem, pass #2" | tee -a $seqres.full
-cp -rf $filler $SCRATCH_MNT/subdir >$seqres.full 2>&1
+cp -rf $filler $SCRATCH_MNT/subdir >>$seqres.full 2>&1
_check_scratch_fs
next reply other threads:[~2024-06-05 16:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 16:32 Luis Henriques (SUSE) [this message]
2024-06-07 4:51 ` [PATCH] generic/077: ignore errors occurred while accessing the filler files Zorro Lang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240605163210.18450-1-luis.henriques@linux.dev \
--to=luis.henriques@linux.dev \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.