brk is disabled in purecap, so only check that calling it returns -ENOSYS. Do it explicitly otherwise the test would be skipped by tst_syscall.
brk02 cannot be completed in purecap as brk is not implemented. We don't need to add anything as tst_syscall will skip it with TCONF in purecap by detecting the -ENOSYS return.
Add brk01 and brk02 to the morello_transitional_extended list.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com --- runtest/morello_transitional_extended | 3 +++ testcases/kernel/syscalls/brk/brk01.c | 10 ++++++++++ 2 files changed, 13 insertions(+)
diff --git a/runtest/morello_transitional_extended b/runtest/morello_transitional_extended index 067fe82da..9549f9aa5 100644 --- a/runtest/morello_transitional_extended +++ b/runtest/morello_transitional_extended @@ -1,5 +1,8 @@ #DESCRIPTION: Morello transitional extended ABI system calls
+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 919435755..a5de55b0a 100644 --- a/testcases/kernel/syscalls/brk/brk01.c +++ b/testcases/kernel/syscalls/brk/brk01.c @@ -17,6 +17,16 @@ void verify_brk(void) size_t inc = getpagesize() * 2 - 1; unsigned int i;
+#ifdef __CHERI_PURE_CAPABILITY__ + /* + * tst_syscall skips the test with TCONF if the syscall returns -ENOSYS. + * Use a direct syscall to check that it does return -ENOSYS correctly + * and explicitly PASS or FAIL. + */ + TST_EXP_FAIL(syscall(__NR_brk, 0), ENOSYS, "brk is not implemented in purecap"); + return; +#endif + cur_brk = (uintptr_t)tst_syscall(__NR_brk, 0);
for (i = 0; i < 33; i++) {