diff mbox series

[3/3] iopl01: skip test if kernel is locked down

Message ID 20200720194920.22784-3-ernunes@redhat.com
State Changes Requested
Headers show
Series [1/3] lib: add function to check for kernel lockdown | expand

Commit Message

Erico Nunes July 20, 2020, 7:49 p.m. UTC
iopl is restricted under kernel lockdown.

Signed-off-by: Erico Nunes <ernunes@redhat.com>
---
 testcases/kernel/syscalls/iopl/iopl01.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Cyril Hrubis July 21, 2020, 3:29 p.m. UTC | #1
Hi!
> iopl is restricted under kernel lockdown.
> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  testcases/kernel/syscalls/iopl/iopl01.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/iopl/iopl01.c b/testcases/kernel/syscalls/iopl/iopl01.c
> index edf586cd1..4237d3f10 100644
> --- a/testcases/kernel/syscalls/iopl/iopl01.c
> +++ b/testcases/kernel/syscalls/iopl/iopl01.c
> @@ -42,6 +42,12 @@ static void verify_iopl(void)
>  	}
>  }
>  
> +static void setup(void)
> +{
> +	/* iopl is restricted under kernel lockdown. */
> +	tst_lockdown_skip();
> +}
> +
>  static void cleanup(void)
>  {
>  	/*
> @@ -54,6 +60,7 @@ static void cleanup(void)
>  static struct tst_test test = {
>  	.test_all = verify_iopl,
>  	.needs_root = 1,
> +	.setup = setup,
>  	.cleanup = cleanup,
>  };

Here as well, shouldn't we add iopl03?

Or at least change the library so that we have a function that returns
if kernel is locked or not so that someone can write such test.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/iopl/iopl01.c b/testcases/kernel/syscalls/iopl/iopl01.c
index edf586cd1..4237d3f10 100644
--- a/testcases/kernel/syscalls/iopl/iopl01.c
+++ b/testcases/kernel/syscalls/iopl/iopl01.c
@@ -42,6 +42,12 @@  static void verify_iopl(void)
 	}
 }
 
+static void setup(void)
+{
+	/* iopl is restricted under kernel lockdown. */
+	tst_lockdown_skip();
+}
+
 static void cleanup(void)
 {
 	/*
@@ -54,6 +60,7 @@  static void cleanup(void)
 static struct tst_test test = {
 	.test_all = verify_iopl,
 	.needs_root = 1,
+	.setup = setup,
 	.cleanup = cleanup,
 };