From bff4578491fc74bc2bb78f4b292f3eb3ddb4ba99 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Sun, 20 May 2018 03:31:11 +0200 Subject: [PATCH] tests: add personality specification syntax checks * tests/options-syntax.test: Add personality specification syntax checks. --- tests/options-syntax.test | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/options-syntax.test b/tests/options-syntax.test index a7ec00f1..1a290d01 100755 --- a/tests/options-syntax.test +++ b/tests/options-syntax.test @@ -60,6 +60,37 @@ check_h "invalid -X argument: 'test'" -Xtest check_h "invalid -X argument: 'a'" -Xa check_h "invalid -X argument: 'abbreviated'" -X abbreviated +check_h "incorrect personality designator '' in qualification 'getcwd@'" -e trace=getcwd@ +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=getcwd@42 +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=gettid,getcwd@42 +check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123 + +check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy + +case "$STRACE_NATIVE_ARCH" in +x86_64) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +x32) + check_h "incorrect personality designator '64' in qualification 'getcwd@64'" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 + ;; +*) + pers="$((SIZEOF_LONG * 8))" + inv_pers="$((96 - pers))" + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@"$pers" + check_h "incorrect personality designator '$inv_pers' in qualification 'getcwd@$inv_pers'" -e trace=getcwd@"$inv_pers" + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 +esac + ../zeroargc "$STRACE_EXE" /bin/true 2> "$LOG" && dump_log_and_fail_with \ 'zeroargc strace failed to handle the error properly' -- 2.40.0