2017-04-30 12:26:44

by Mickaël Salaün

[permalink] [raw]
Subject: [PATCH v1] selftests: Make test_harness.h more generally available

The seccomp/test_harness.h file contains useful helpers to build tests.
Moving it to the selftest directory should benefit to other test
components.

Signed-off-by: Mickaël Salaün <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Will Drewry <[email protected]>
Link: https://lkml.kernel.org/r/CAGXu5j+8CVz8vL51DRYXqOY=xc3zuKFf=PTENe88XYHzFYidUQ@mail.gmail.com
---
tools/testing/selftests/seccomp/seccomp_bpf.c | 2 +-
tools/testing/selftests/{seccomp => }/test_harness.h | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename tools/testing/selftests/{seccomp => }/test_harness.h (100%)

diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
index 03f1fa495d74..d7095ff58e72 100644
--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
+++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
@@ -37,7 +37,7 @@
#include <unistd.h>
#include <sys/syscall.h>

-#include "test_harness.h"
+#include "../test_harness.h"

#ifndef PR_SET_PTRACER
# define PR_SET_PTRACER 0x59616d61
diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/test_harness.h
similarity index 100%
rename from tools/testing/selftests/seccomp/test_harness.h
rename to tools/testing/selftests/test_harness.h
--
2.11.0


2017-04-30 17:39:14

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH v1] selftests: Make test_harness.h more generally available

On Sun, Apr 30, 2017 at 5:26 AM, Mickaël Salaün <[email protected]> wrote:
> The seccomp/test_harness.h file contains useful helpers to build tests.
> Moving it to the selftest directory should benefit to other test
> components.

Unless Shuah thinks this should live in a new include/ directory, this
looks fine to me.

Acked-by: Kees Cook <[email protected]>

Thanks!

-Kees

>
> Signed-off-by: Mickaël Salaün <[email protected]>
> Cc: Andy Lutomirski <[email protected]>
> Cc: Kees Cook <[email protected]>
> Cc: Shuah Khan <[email protected]>
> Cc: Will Drewry <[email protected]>
> Link: https://lkml.kernel.org/r/CAGXu5j+8CVz8vL51DRYXqOY=xc3zuKFf=PTENe88XYHzFYidUQ@mail.gmail.com
> ---
> tools/testing/selftests/seccomp/seccomp_bpf.c | 2 +-
> tools/testing/selftests/{seccomp => }/test_harness.h | 0
> 2 files changed, 1 insertion(+), 1 deletion(-)
> rename tools/testing/selftests/{seccomp => }/test_harness.h (100%)
>
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index 03f1fa495d74..d7095ff58e72 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -37,7 +37,7 @@
> #include <unistd.h>
> #include <sys/syscall.h>
>
> -#include "test_harness.h"
> +#include "../test_harness.h"
>
> #ifndef PR_SET_PTRACER
> # define PR_SET_PTRACER 0x59616d61
> diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/test_harness.h
> similarity index 100%
> rename from tools/testing/selftests/seccomp/test_harness.h
> rename to tools/testing/selftests/test_harness.h
> --
> 2.11.0
>



--
Kees Cook
Pixel Security

2017-04-30 18:23:26

by Will Drewry

[permalink] [raw]
Subject: Re: [PATCH v1] selftests: Make test_harness.h more generally available

On Sun, Apr 30, 2017 at 12:39 PM, Kees Cook <[email protected]> wrote:
>
> On Sun, Apr 30, 2017 at 5:26 AM, Mickaël Salaün <[email protected]> wrote:
> > The seccomp/test_harness.h file contains useful helpers to build tests.
> > Moving it to the selftest directory should benefit to other test
> > components.
>
> Unless Shuah thinks this should live in a new include/ directory, this
> looks fine to me.
>
> Acked-by: Kees Cook <[email protected]>

Same here!

Acked-by: Will Drewry <[email protected]>

>
> Thanks!
>
> -Kees
>
> >
> > Signed-off-by: Mickaël Salaün <[email protected]>
> > Cc: Andy Lutomirski <[email protected]>
> > Cc: Kees Cook <[email protected]>
> > Cc: Shuah Khan <[email protected]>
> > Cc: Will Drewry <[email protected]>
> > Link: https://lkml.kernel.org/r/CAGXu5j+8CVz8vL51DRYXqOY=xc3zuKFf=PTENe88XYHzFYidUQ@mail.gmail.com
> > ---
> > tools/testing/selftests/seccomp/seccomp_bpf.c | 2 +-
> > tools/testing/selftests/{seccomp => }/test_harness.h | 0
> > 2 files changed, 1 insertion(+), 1 deletion(-)
> > rename tools/testing/selftests/{seccomp => }/test_harness.h (100%)
> >
> > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> > index 03f1fa495d74..d7095ff58e72 100644
> > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> > @@ -37,7 +37,7 @@
> > #include <unistd.h>
> > #include <sys/syscall.h>
> >
> > -#include "test_harness.h"
> > +#include "../test_harness.h"
> >
> > #ifndef PR_SET_PTRACER
> > # define PR_SET_PTRACER 0x59616d61
> > diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/test_harness.h
> > similarity index 100%
> > rename from tools/testing/selftests/seccomp/test_harness.h
> > rename to tools/testing/selftests/test_harness.h
> > --
> > 2.11.0
> >
>
>
>
> --
> Kees Cook
> Pixel Security