[PATCH 2/4] tests: add option_u.test

Zhou Wenjian zhouwj-fnst at cn.fujitsu.com
Wed Mar 23 08:56:37 UTC 2016


* tests/option_u.test: New test.
* tests/.gitignore: Add option_u.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add option_u.test.
---
 tests/.gitignore    |  1 +
 tests/Makefile.am   |  1 +
 tests/option_u.test | 13 +++++++++++++
 3 files changed, 15 insertions(+)
 create mode 100755 tests/option_u.test

diff --git a/tests/.gitignore b/tests/.gitignore
index 6669e2e..01ed01f 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -152,3 +152,4 @@ xetpgid
 xetpriority
 xettimeofday
 option_d_r
+option_u
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fbfe8b9..db3abb5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -380,6 +380,7 @@ TESTS = \
 	redirect.test \
 	restart_syscall.test \
 	option_d_r.test \
+	option_u.test \
 	$(LIBUNWIND_TESTS)
 
 XFAIL_TESTS_ =
diff --git a/tests/option_u.test b/tests/option_u.test
new file mode 100755
index 0000000..5192a4f
--- /dev/null
+++ b/tests/option_u.test
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Check option -u.
+
+. "${srcdir=.}/init.sh"
+
+user=$(tail -n 1 /etc/passwd | awk -F ":" '{print $1}')
+OUT="$LOG.out"
+run_prog whoami
+run_strace -u $user $args > "$OUT"
+echo $user > "$LOG"
+match_diff "$LOG" "$OUT"
+exit 0
-- 
1.8.3.1







More information about the Strace-devel mailing list