Commit 51a1d165 authored by Joern Engel's avatar Joern Engel Committed by Linus Torvalds

selftests: exit 1 on failure

In case this ever gets scripted, it should return 0 on success and 1 on
failure.  Parsing the output should be left to meatbags.
Signed-off-by: default avatarJoern Engel <joern@logfs.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0786f7b2
...@@ -8,7 +8,7 @@ all: hugepage-mmap hugepage-shm map_hugetlb thuge-gen ...@@ -8,7 +8,7 @@ all: hugepage-mmap hugepage-shm map_hugetlb thuge-gen
$(CC) $(CFLAGS) -o $@ $^ $(CC) $(CFLAGS) -o $@ $^
run_tests: all run_tests: all
@/bin/sh ./run_vmtests || echo "vmtests: [FAIL]" @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1)
clean: clean:
$(RM) hugepage-mmap hugepage-shm map_hugetlb $(RM) hugepage-mmap hugepage-shm map_hugetlb
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#we need 256M, below is the size in kB #we need 256M, below is the size in kB
needmem=262144 needmem=262144
mnt=./huge mnt=./huge
exitcode=0
#get pagesize and freepages from /proc/meminfo #get pagesize and freepages from /proc/meminfo
while read name size unit; do while read name size unit; do
...@@ -41,6 +42,7 @@ echo "--------------------" ...@@ -41,6 +42,7 @@ echo "--------------------"
./hugepage-mmap ./hugepage-mmap
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1
else else
echo "[PASS]" echo "[PASS]"
fi fi
...@@ -55,6 +57,7 @@ echo "--------------------" ...@@ -55,6 +57,7 @@ echo "--------------------"
./hugepage-shm ./hugepage-shm
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1
else else
echo "[PASS]" echo "[PASS]"
fi fi
...@@ -67,6 +70,7 @@ echo "--------------------" ...@@ -67,6 +70,7 @@ echo "--------------------"
./map_hugetlb ./map_hugetlb
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1
else else
echo "[PASS]" echo "[PASS]"
fi fi
...@@ -75,3 +79,4 @@ fi ...@@ -75,3 +79,4 @@ fi
umount $mnt umount $mnt
rm -rf $mnt rm -rf $mnt
echo $nr_hugepgs > /proc/sys/vm/nr_hugepages echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
exit $exitcode
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment