]> granicus.if.org Git - strace/commitdiff
tests/qual_syscall.test: rewrite without ls
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 29 Sep 2016 23:56:23 +0000 (23:56 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 30 Sep 2016 13:09:36 +0000 (13:09 +0000)
* tests/qual_syscall.test: Invoke ./umovestr instead of ls.
Update expected output.

tests/qual_syscall.test

index 1aff1cc0f7f98135d3789ff52c3d8b0eb17553d3..0b4fa42e8aae8f916c1ece4ce483f36dad783da8 100755 (executable)
@@ -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