Skip to contentSkip to conversation

xfstests-bld: be tolerant of /proc/slabinfo being missing

PATCH Applied Eric Biggers 2 participants 2 messages Feb 6, 2017 – Feb 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests-bld: be tolerant of /proc/slabinfo being missing

From: Eric Biggers <[email protected]>

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.

---
 kvm-xfstests/test-appliance/files/root/runtests.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kvm-xfstests/test-appliance/files/root/runtests.sh +4 -4
index 377001b..6fd6999 100755
@@ -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
Signature · 1 line
2.11.0.483.g087da7b7c-goog
#1 lore raw
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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.

Thanks, applied.

- Ted