[PATCH 5/6] tests/openat2*-y: skip when no /proc

Dmitry V. Levin ldv at altlinux.org
Wed May 5 17:16:47 UTC 2021


On Tue, May 04, 2021 at 07:40:57PM +0000, Alyssa Ross wrote:
> ---
>  tests/openat2-v-y.c | 2 ++
>  tests/openat2-y.c   | 2 ++
>  tests/openat2.c     | 5 +++++
>  3 files changed, 9 insertions(+)
> 
> diff --git a/tests/openat2-v-y.c b/tests/openat2-v-y.c
> index dcbca1a2..7f3f56b9 100644
> --- a/tests/openat2-v-y.c
> +++ b/tests/openat2-v-y.c
> @@ -1,2 +1,4 @@
>  #define FD0_PATH "</dev/full>"
> +#define SKIP_IF_PROC_IS_UNAVAILABLE skip_if_unavailable("/proc/self/fd/")
> +
>  #include "openat2-v.c"
> diff --git a/tests/openat2-y.c b/tests/openat2-y.c
> index 50b18630..dccc8cfe 100644
> --- a/tests/openat2-y.c
> +++ b/tests/openat2-y.c
> @@ -1,2 +1,4 @@
>  #define FD0_PATH "</dev/full>"
> +#define SKIP_IF_PROC_IS_UNAVAILABLE skip_if_unavailable("/proc/self/fd/")
> +
>  #include "openat2.c"
> diff --git a/tests/openat2.c b/tests/openat2.c
> index b87d770c..2b651146 100644
> --- a/tests/openat2.c
> +++ b/tests/openat2.c
> @@ -24,12 +24,17 @@
>  #ifndef FD0_PATH
>  # define FD0_PATH ""
>  #endif
> +#ifndef SKIP_IF_PROC_IS_UNAVAILABLE
> +# define SKIP_IF_PROC_IS_UNAVAILABLE
> +#endif
>  
>  static const char sample[] = "openat2.sample";
>  
>  int
>  main(void)
>  {
> +	SKIP_IF_PROC_IS_UNAVAILABLE;
> +
>  	long rc;
>  	const char *rcstr;
>  	struct open_how *how = tail_alloc(sizeof(*how));

Applied, thanks.


-- 
ldv


More information about the Strace-devel mailing list