diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-05-16 08:25:27 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-05-19 14:37:42 +0200 |
commit | fbc205bab17a25ae3dabef5a2ad97edcfcef9eef (patch) | |
tree | 58e97ef6b8cd054bec8ded905f73cc7170ffb4df /tests/unit/testutil.h | |
parent | ef403b6687ec5739933f9f215093e1ea5c923666 (diff) | |
download | seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar.gz seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar.bz2 seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar.lz seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar.xz seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.tar.zst seitan-fbc205bab17a25ae3dabef5a2ad97edcfcef9eef.zip |
ops: fix op_call and tests
Diffstat (limited to 'tests/unit/testutil.h')
-rw-r--r-- | tests/unit/testutil.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/testutil.h b/tests/unit/testutil.h index 4f104ac..b63d467 100644 --- a/tests/unit/testutil.h +++ b/tests/unit/testutil.h @@ -34,6 +34,12 @@ static inline void *test_gluten_write_ptr(struct gluten *g, } } +#define write_instr(gluten, ops) \ + do { \ + struct gluten_offset x = { OFFSET_INSTRUCTION, 0 }; \ + memcpy(test_gluten_write_ptr(&gluten, x), &ops, sizeof(ops)); \ + } while (0) + #define ck_write_gluten(gluten, value, ref) \ do { \ void *p = test_gluten_write_ptr(&gluten, value); \ @@ -58,6 +64,8 @@ struct args_target { bool filter_args[6]; struct bpf_arg args[6]; void *targs[6]; + void *tclone; + bool ns[NS_NUM]; int (*install_filter)(struct args_target *at); int (*target)(void *); }; @@ -74,7 +82,6 @@ extern char stdout_buff[BUFSIZ]; extern struct gluten gluten; int target(); -pid_t do_clone(int (*fn)(void *), void *arg); int create_test_fd(); int get_fd_notifier(pid_t pid); void target_exit(); @@ -91,4 +98,5 @@ void check_target_result_nonegative(); void ck_error_msg(char *s); void ck_stderr(); void ck_stdout(); +int install_single_syscall(long nr); #endif /* TESTUTIL_H */ |