Some of the test cases for fanotify14 do rely on a fairly recent kernel changes. Make sure those are available before triggering relevant tests.
Signed-off-by: Beata Michalska beata.michalska@arm.com --- testcases/kernel/syscalls/fanotify/fanotify14.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify14.c b/testcases/kernel/syscalls/fanotify/fanotify14.c index 4596511f0..8556f70c0 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -27,6 +27,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include <errno.h> +#include <stdbool.h>
#ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -65,6 +66,12 @@ static struct test_case_t { struct test_case_flags_t mask; int expected_errno; int *pfd; + /* + * This should be handled by min_kver from the test itself, + * but as in this case it's a set of test cases ... + */ + bool verify_kver; + } test_cases[] = { /* FAN_REPORT_FID without class FAN_CLASS_NOTIF is not valid */ { @@ -228,6 +235,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL, + .verify_kver = true, }, /* filesystem mark on anonymous pipe is not valid */ { @@ -236,6 +244,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL, + .verify_kver = true, }, };
@@ -246,6 +255,11 @@ static void do_test(unsigned int number) tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number, tc->init.desc);
+ if (tc->verify_kver && tst_kvercmp(6, 5, 0) < 0) { + tst_res(TCONF, "Required kernel version 6.5.0 or higher"); + return; + } + if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) { FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID, fan_report_target_fid_unsupported);
On 25/01/2024 15:19, Beata Michalska wrote:
Some of the test cases for fanotify14 do rely on a fairly recent kernel changes. Make sure those are available before triggering relevant tests.
Might those test cases be fixed by this upstream series [1]? I would expect it to apply cleanly but didn't actually try it.
Otherwise this patch looks sensible.
Kevin
[1] https://lore.kernel.org/ltp/20231020150749.21165-1-mdoucha@suse.cz/
Signed-off-by: Beata Michalska beata.michalska@arm.com
testcases/kernel/syscalls/fanotify/fanotify14.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify14.c b/testcases/kernel/syscalls/fanotify/fanotify14.c index 4596511f0..8556f70c0 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -27,6 +27,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include <errno.h> +#include <stdbool.h> #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -65,6 +66,12 @@ static struct test_case_t { struct test_case_flags_t mask; int expected_errno; int *pfd;
- /*
* This should be handled by min_kver from the test itself,
* but as in this case it's a set of test cases ...
*/
- bool verify_kver;
} test_cases[] = { /* FAN_REPORT_FID without class FAN_CLASS_NOTIF is not valid */ { @@ -228,6 +235,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
}, /* filesystem mark on anonymous pipe is not valid */ {.verify_kver = true,
@@ -236,6 +244,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
},.verify_kver = true,
}; @@ -246,6 +255,11 @@ static void do_test(unsigned int number) tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number, tc->init.desc);
- if (tc->verify_kver && tst_kvercmp(6, 5, 0) < 0) {
tst_res(TCONF, "Required kernel version 6.5.0 or higher");
return;
- }
- if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) { FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID, fan_report_target_fid_unsupported);
On Thu, Jan 25, 2024 at 03:38:07PM +0100, Kevin Brodsky wrote:
On 25/01/2024 15:19, Beata Michalska wrote:
Some of the test cases for fanotify14 do rely on a fairly recent kernel changes. Make sure those are available before triggering relevant tests.
Might those test cases be fixed by this upstream series [1]? I would expect it to apply cleanly but didn't actually try it.
Those solve different issue. This patch makes sure the relevant kernel[1] change is in place for the new fantotify14 test cases [2]
[1] https://github.com/torvalds/linux/commit/69562eb0bd3e [2] https://github.com/linux-test-project/ltp/commit/8e897008c0fbebaab3611fe5e05...
--- BR Beata
Otherwise this patch looks sensible.
Kevin
[1] https://lore.kernel.org/ltp/20231020150749.21165-1-mdoucha@suse.cz/
Signed-off-by: Beata Michalska beata.michalska@arm.com
testcases/kernel/syscalls/fanotify/fanotify14.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify14.c b/testcases/kernel/syscalls/fanotify/fanotify14.c index 4596511f0..8556f70c0 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -27,6 +27,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include <errno.h> +#include <stdbool.h> #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -65,6 +66,12 @@ static struct test_case_t { struct test_case_flags_t mask; int expected_errno; int *pfd;
- /*
* This should be handled by min_kver from the test itself,
* but as in this case it's a set of test cases ...
*/
- bool verify_kver;
} test_cases[] = { /* FAN_REPORT_FID without class FAN_CLASS_NOTIF is not valid */ { @@ -228,6 +235,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
}, /* filesystem mark on anonymous pipe is not valid */ {.verify_kver = true,
@@ -236,6 +244,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
},.verify_kver = true,
}; @@ -246,6 +255,11 @@ static void do_test(unsigned int number) tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number, tc->init.desc);
- if (tc->verify_kver && tst_kvercmp(6, 5, 0) < 0) {
tst_res(TCONF, "Required kernel version 6.5.0 or higher");
return;
- }
- if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) { FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID, fan_report_target_fid_unsupported);
On 25/01/2024 16:04, Beata Michalska wrote:
On Thu, Jan 25, 2024 at 03:38:07PM +0100, Kevin Brodsky wrote:
On 25/01/2024 15:19, Beata Michalska wrote:
Some of the test cases for fanotify14 do rely on a fairly recent kernel changes. Make sure those are available before triggering relevant tests.
Might those test cases be fixed by this upstream series [1]? I would expect it to apply cleanly but didn't actually try it.
Those solve different issue. This patch makes sure the relevant kernel[1] change is in place for the new fantotify14 test cases [2]
Oh I see, then it makes sense to proceed with your patch.
Kevin
[1] https://github.com/torvalds/linux/commit/69562eb0bd3e [2] https://github.com/linux-test-project/ltp/commit/8e897008c0fbebaab3611fe5e05...
BR Beata
Otherwise this patch looks sensible.
Kevin
[1] https://lore.kernel.org/ltp/20231020150749.21165-1-mdoucha@suse.cz/
Signed-off-by: Beata Michalska beata.michalska@arm.com
testcases/kernel/syscalls/fanotify/fanotify14.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify14.c b/testcases/kernel/syscalls/fanotify/fanotify14.c index 4596511f0..8556f70c0 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -27,6 +27,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include <errno.h> +#include <stdbool.h> #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -65,6 +66,12 @@ static struct test_case_t { struct test_case_flags_t mask; int expected_errno; int *pfd;
- /*
* This should be handled by min_kver from the test itself,
* but as in this case it's a set of test cases ...
*/
- bool verify_kver;
} test_cases[] = { /* FAN_REPORT_FID without class FAN_CLASS_NOTIF is not valid */ { @@ -228,6 +235,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
}, /* filesystem mark on anonymous pipe is not valid */ {.verify_kver = true,
@@ -236,6 +244,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
},.verify_kver = true,
}; @@ -246,6 +255,11 @@ static void do_test(unsigned int number) tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number, tc->init.desc);
- if (tc->verify_kver && tst_kvercmp(6, 5, 0) < 0) {
tst_res(TCONF, "Required kernel version 6.5.0 or higher");
return;
- }
- if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) { FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID, fan_report_target_fid_unsupported);
On Thu, Jan 25, 2024 at 04:23:54PM +0100, Kevin Brodsky wrote:
On 25/01/2024 16:04, Beata Michalska wrote:
On Thu, Jan 25, 2024 at 03:38:07PM +0100, Kevin Brodsky wrote:
On 25/01/2024 15:19, Beata Michalska wrote:
Some of the test cases for fanotify14 do rely on a fairly recent kernel changes. Make sure those are available before triggering relevant tests.
Might those test cases be fixed by this upstream series [1]? I would expect it to apply cleanly but didn't actually try it.
Those solve different issue. This patch makes sure the relevant kernel[1] change is in place for the new fantotify14 test cases [2]
Oh I see, then it makes sense to proceed with your patch.
Thanks for the review. Landed on next.
--- BR Beata
Kevin
[1] https://github.com/torvalds/linux/commit/69562eb0bd3e [2] https://github.com/linux-test-project/ltp/commit/8e897008c0fbebaab3611fe5e05...
BR Beata
Otherwise this patch looks sensible.
Kevin
[1] https://lore.kernel.org/ltp/20231020150749.21165-1-mdoucha@suse.cz/
Signed-off-by: Beata Michalska beata.michalska@arm.com
testcases/kernel/syscalls/fanotify/fanotify14.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify14.c b/testcases/kernel/syscalls/fanotify/fanotify14.c index 4596511f0..8556f70c0 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify14.c +++ b/testcases/kernel/syscalls/fanotify/fanotify14.c @@ -27,6 +27,7 @@ #define _GNU_SOURCE #include "tst_test.h" #include <errno.h> +#include <stdbool.h> #ifdef HAVE_SYS_FANOTIFY_H #include "fanotify.h" @@ -65,6 +66,12 @@ static struct test_case_t { struct test_case_flags_t mask; int expected_errno; int *pfd;
- /*
* This should be handled by min_kver from the test itself,
* but as in this case it's a set of test cases ...
*/
- bool verify_kver;
} test_cases[] = { /* FAN_REPORT_FID without class FAN_CLASS_NOTIF is not valid */ { @@ -228,6 +235,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
}, /* filesystem mark on anonymous pipe is not valid */ {.verify_kver = true,
@@ -236,6 +244,7 @@ static struct test_case_t { .mask = { FAN_ACCESS, "anonymous pipe"}, .pfd = pipes, .expected_errno = EINVAL,
},.verify_kver = true,
}; @@ -246,6 +255,11 @@ static void do_test(unsigned int number) tst_res(TINFO, "Test case %d: fanotify_init(%s, O_RDONLY)", number, tc->init.desc);
- if (tc->verify_kver && tst_kvercmp(6, 5, 0) < 0) {
tst_res(TCONF, "Required kernel version 6.5.0 or higher");
return;
- }
- if (fan_report_target_fid_unsupported && tc->init.flags & FAN_REPORT_TARGET_FID) { FANOTIFY_INIT_FLAGS_ERR_MSG(FAN_REPORT_TARGET_FID, fan_report_target_fid_unsupported);
linux-morello-ltp@op-lists.linaro.org