[PATCH 2/4] tests: add option_u.test
Dmitry V. Levin
ldv at altlinux.org
Tue Mar 29 12:12:13 UTC 2016
On Tue, Mar 29, 2016 at 07:06:09PM +0800, "Zhou, Wenjian/周文剑" wrote:
> On 03/25/2016 06:48 AM, Dmitry V. Levin wrote:
> > On Wed, Mar 23, 2016 at 04:56:37PM +0800, Zhou Wenjian wrote:
> >> --- /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}')
> >
> > What is it?
>
> It is used to get a user's name.
> Then use strace tracing "whoami".
> If -u option works, the output of "whoami" will be the user's name.
In other words, you tell strace to switch to a random user and then you
check whether it worked out or not.
Do you have to run the test as root to make it work as you've described?
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160329/4293bfae/attachment.bin>
More information about the Strace-devel
mailing list