[PATCH v2 3/3] tests: check -z and -Z options

Dmitry V. Levin ldv at altlinux.org
Fri Apr 5 01:19:57 UTC 2019


On Tue, Apr 02, 2019 at 09:57:28PM +0200, Paul Chaignon wrote:
> This patch adds two test cases for the -z and -Z options.
> 
> Signed-off-by: Paul Chaignon <paul.chaignon at gmail.com>
> ---
>  tests/.gitignore            |  2 ++
>  tests/gen_tests.in          |  2 ++
>  tests/open-Z.c              | 59 +++++++++++++++++++++++++++++++++++++
>  tests/open-z.c              | 58 ++++++++++++++++++++++++++++++++++++
>  tests/pure_executables.list |  2 ++
>  5 files changed, 123 insertions(+)
>  create mode 100644 tests/open-Z.c
>  create mode 100644 tests/open-z.c
> 
> diff --git a/tests/.gitignore b/tests/.gitignore
> index 5a601641..f837656a 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -362,6 +362,8 @@ oldselect-efault
>  oldselect-efault-P
>  oldstat
>  open
> +open-z
> +open-Z
>  openat
>  orphaned_process_group
>  osf_utimes
> diff --git a/tests/gen_tests.in b/tests/gen_tests.in
> index 314608eb..d4ba061e 100644
> --- a/tests/gen_tests.in
> +++ b/tests/gen_tests.in
> @@ -309,6 +309,8 @@ oldselect-efault	-a13 -e trace=select
>  oldselect-efault-P	-a13 -e trace=select -P /dev/full 9>>/dev/full
>  oldstat	-a32 -v -P stat.sample -P /dev/full
>  open	-a30 -P $NAME.sample
> +open-Z	-a30 -e trace=open -P open.sample -Z
> +open-z	-a30 -e trace=open -P open.sample -z

These tests are not really about open, maybe call them strace-z/strace-Z?

>  openat	-a36 -P $NAME.sample
>  orphaned_process_group	. "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld'
>  osf_utimes	-a21
> diff --git a/tests/open-Z.c b/tests/open-Z.c
> new file mode 100644
> index 00000000..b692502f
> --- /dev/null
> +++ b/tests/open-Z.c
> @@ -0,0 +1,59 @@
> +/*
> + * Copyright (c) 2019 Paul Chaignon <paul.chaignon at gmail.com>
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier: LGPL-2.1-or-later
> + */
> +
> +#include "tests.h"
> +#include <asm/unistd.h>
> +
> +#ifdef __NR_open

__NR_open is not available on new architectures.
I suggest using chdir instead, it's much simpler and universally
available.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190405/45d071e4/attachment.bin>


More information about the Strace-devel mailing list