[LTP] [PATCH] vma05.sh: Fix check for core file presence

Yang Xu xuyang2018.jy@fujitsu.com
Fri Nov 10 04:56:48 CET 2023


When I tested it, I found that the test produced the error:
vma05 1 TBROK: missing core file

I try to get the generated core file
  rm -rf core*
  { vma05_vdso; } > /dev/null 2>&1
+ ls -l *core*
  [ -f core ] || tst_brk TCONF "missing core file"

<<<test_output>>>
incrementing stop
vma05 1 TINFO: timeout per run is 0h 5m 0s
vma05 1 TPASS: [vsyscall] reported correctly
-rw------- 1 root root 458752 Nov 10 02:16 core.931905
vma05 1 TBROK: missing core file

The test actually generates not core but in the form of core.n
So may be '[ -f core ]' should be changed to '[ -f core* ]'

Fixes: 63529eef ("vma05.sh: Add check for core file presence")
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/mem/vma/vma05.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/mem/vma/vma05.sh b/testcases/kernel/mem/vma/vma05.sh
index a09951462..6f5459308 100755
--- a/testcases/kernel/mem/vma/vma05.sh
+++ b/testcases/kernel/mem/vma/vma05.sh
@@ -54,7 +54,7 @@ vma_report_check()
 
 	rm -rf core*
 	{ vma05_vdso; } > /dev/null 2>&1
-	[ -f core ] || tst_brk TBROK "missing core file"
+	[ -f core* ] || tst_brk TBROK "missing core file"
 
 	TRACE=$(gdb -silent -ex="thread apply all backtrace" -ex="quit"\
 		vma05_vdso ./core* 2> /dev/null)
-- 
2.39.1



More information about the ltp mailing list