From 55334effedd7c463e1dcc916bedf0b1eff64fe29 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 29 Sep 2016 23:56:23 +0000 Subject: [PATCH] tests/qual_syscall.test: rewrite without ls * tests/qual_syscall.test: Invoke ./umovestr instead of ls. Update expected output. --- tests/qual_syscall.test | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tests/qual_syscall.test b/tests/qual_syscall.test index 1aff1cc0..0b4fa42e 100755 --- a/tests/qual_syscall.test +++ b/tests/qual_syscall.test @@ -4,22 +4,29 @@ . "${srcdir=.}/init.sh" -check_prog ls -run_strace -e execve ls - -grep '^execve(' "$LOG" > /dev/null || - dump_log_and_fail_with "$STRACE $args output mismatch" - -grep -v '^execve(' "$LOG" | +run_prog ./umovestr +pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' + +check_output_mismatch() +{ + local pattern + pattern="$1"; shift + run_strace "$@" ./umovestr + LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || + dump_log_and_fail_with "$STRACE $args output mismatch" +} + +check_output_mismatch "$pattern_abbrev_verbose" -e execve +LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -run_strace -e trace=process ls - -grep '^execve(' "$LOG" > /dev/null || - dump_log_and_fail_with "$STRACE $args output mismatch" +check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +LC_ALL=C grep '^chdir' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" -grep '^open' "$LOG" > /dev/null && +run_strace -e 42 ./umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" exit 0 -- 2.50.1