When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc
logic wrongly returns errors. Detect that and throw an error.
* tests/ipc_sem.c: Return 99 when errno is EFAULT.
* tests/ipc_sem.test: Save output to $OUT and show it when failing.
Handle exit status 99 to throw an ERROR.
return rc;
fail:
- rc = 1;
+ rc = errno == EFAULT ? 99 : 1;
goto done;
}
OUT="$LOG.out"
-./ipc_sem > /dev/null || {
- if [ $? -eq 77 ]; then
+./ipc_sem > "$OUT" || {
+ case $? in
+ 77)
+ rm -f "$OUT"
framework_skip_ 'ipc semget/semctl syscalls do not behave as expected'
- else
+ ;;
+ 99)
+ cat "$OUT"
+ rm -f "$OUT"
+ framework_failure_ 'broken kernel detected'
+ ;;
+ *)
+ cat "$OUT"
+ rm -f "$OUT"
fail_ 'ipc_sem failed'
- fi
+ ;;
+ esac
}
-args="-eipc ./ipc_sem $f"
+args='-eipc ./ipc_sem'
$STRACE -o "$LOG" $args > "$OUT" &&
LC_ALL=C grep -E -x -f "$OUT" "$LOG" > /dev/null || {
cat "$OUT" "$LOG"