Hi Teo,
On 18-10-2022 09:46, Teo Couprie Diaz wrote:
brk is disabled in purecap so in normal operation the test would be skipped by LTP. If that is not the case, guarantee the test will fail.
Add brk01 and brk02 to the morello_transitional_extended list.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
runtest/morello_transitional_extended | 2 ++ testcases/kernel/syscalls/brk/brk01.c | 13 +++++++++++++ 2 files changed, 15 insertions(+)
diff --git a/runtest/morello_transitional_extended b/runtest/morello_transitional_extended index 067fe82da..8ddab7095 100644 --- a/runtest/morello_transitional_extended +++ b/runtest/morello_transitional_extended @@ -1,5 +1,7 @@ #DESCRIPTION: Morello transitional extended ABI system calls +brk01 brk02
This should be: +brk01 brk01 +brk02 brk02
- epoll_create01 epoll_create01 epoll_create02 epoll_create02 epoll_create1_01 epoll_create1_01
diff --git a/testcases/kernel/syscalls/brk/brk01.c b/testcases/kernel/syscalls/brk/brk01.c index c16b46eaa..5157a5605 100644 --- a/testcases/kernel/syscalls/brk/brk01.c +++ b/testcases/kernel/syscalls/brk/brk01.c
Shouldn't a similar change be needed for brk02.c ?
@@ -9,7 +9,19 @@ #include <errno.h> #include "tst_test.h" +#include "lapi/syscalls.h" +#ifdef __CHERI_PURE_CAPABILITY__ +void verify_brk(void) +{
- /*
* tst_syscall skips the test if the syscall returns -ENOSYS,
* which is the expected behavior in purecap.
*/
- tst_syscall(__NR_brk, 0);
- tst_res(TFAIL, "brk should not be implemented in purecap");
+} +#else
nit: I would prefer to have a single verify_brk(void), and the ifdef __CHERI_PURE_CAPABILITY__ block should be inside the function. Up to you though.
Thanks, Tudor
void verify_brk(void) { uintptr_t cur_brk, new_brk; @@ -65,6 +77,7 @@ void verify_brk(void) tst_res(TPASS, "brk() works fine"); } +#endif /* __CHERI_PURE_CAPABILITY__ */ static struct tst_test test = { .test_all = verify_brk,