FS/XFS testing framework
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org, Eric Biggers <ebiggers@google.com>
Subject: [PATCH] xfstests-bld: be tolerant of /proc/slabinfo being missing
Date: Mon,  6 Feb 2017 13:42:33 -0800	[thread overview]
Message-ID: <20170206214237.8838-1-ebiggers3@gmail.com> (raw)

From: Eric Biggers <ebiggers@google.com>

In kernels compiled without /proc/slabinfo (CONFIG_SLABINFO),
runtests.sh would report errors when trying to save the contents of
/proc/slabinfo.  Update runtests.sh to consider /proc/slabinfo to be
optional, saving its contents only if present.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 kvm-xfstests/test-appliance/files/root/runtests.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kvm-xfstests/test-appliance/files/root/runtests.sh b/kvm-xfstests/test-appliance/files/root/runtests.sh
index 377001b..6fd6999 100755
--- a/kvm-xfstests/test-appliance/files/root/runtests.sh
+++ b/kvm-xfstests/test-appliance/files/root/runtests.sh
@@ -190,7 +190,7 @@ do
     find $i -type f ! -name check.time -print | xargs rm -f 2> /dev/null
 done
 
-cp /proc/slabinfo /results/slabinfo.before
+[ -e /proc/slabinfo ] && cp /proc/slabinfo /results/slabinfo.before
 cp /proc/meminfo /results/meminfo.before
 
 free -m
@@ -321,7 +321,7 @@ do
 	if test ! -f /.dockerenv ; then
 	    echo 3 > /proc/sys/vm/drop_caches
 	fi
-	cp /proc/slabinfo "$RESULT_BASE/slabinfo.before"
+	[ -e /proc/slabinfo ] && cp /proc/slabinfo "$RESULT_BASE/slabinfo.before"
 	cp /proc/meminfo "$RESULT_BASE/meminfo.before"
 	echo -n "BEGIN TEST $i: $TESTNAME " ; date
 	logger "BEGIN TEST $i: $TESTNAME "
@@ -424,7 +424,7 @@ END	{ if (NR > 0) {
 	if test ! -f /.dockerenv ; then
 	    echo 3 > /proc/sys/vm/drop_caches
 	fi
-	cp /proc/slabinfo "$RESULT_BASE/slabinfo.after"
+	[ -e /proc/slabinfo ] && cp /proc/slabinfo "$RESULT_BASE/slabinfo.after"
 	cp /proc/meminfo "$RESULT_BASE/meminfo.after"
 	free -m
 	gce_run_hooks fs-config-end $i
@@ -434,5 +434,5 @@ END	{ if (NR > 0) {
 	logger "END TEST $i: $TESTNAME "
 done
 
-cp /proc/slabinfo /results/slabinfo.after
+[ -e /proc/slabinfo ] && cp /proc/slabinfo /results/slabinfo.after
 cp /proc/meminfo /results/meminfo.after
-- 
2.11.0.483.g087da7b7c-goog


             reply	other threads:[~2017-02-06 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 21:42 Eric Biggers [this message]
2017-02-07 17:39 ` [PATCH] xfstests-bld: be tolerant of /proc/slabinfo being missing Theodore Ts'o

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=20170206214237.8838-1-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox