aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-02-21 13:27:23 +0100
committerAlice Frosi <afrosi@redhat.com>2023-02-21 13:28:09 +0100
commit49e031fcb87ffed118725cb91d6251d166bf8f47 (patch)
tree4d41fbc77bddc184ae1f04dd640771867849966e
parent989b06c20488af52c8c1d1a294a170a01817b157 (diff)
downloadseitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar.gz
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar.bz2
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar.lz
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar.xz
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.tar.zst
seitan-49e031fcb87ffed118725cb91d6251d166bf8f47.zip
test: add test for act_call
-rw-r--r--tests/unit/test_actions.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/unit/test_actions.c b/tests/unit/test_actions.c
index df31809..4916200 100644
--- a/tests/unit/test_actions.c
+++ b/tests/unit/test_actions.c
@@ -278,6 +278,22 @@ START_TEST(test_act_return_empty_ref)
}
END_TEST
+START_TEST(test_act_call)
+{
+ struct action actions[] = {
+ {
+ .type = A_CALL,
+ .call = { .nr = __NR_getppid, .has_ret = false },
+ },
+ { .type = A_CONT },
+ };
+ int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1,
+ notifyfd, req.id);
+ ck_assert_msg(ret == 0, strerror(errno));
+ check_target_result(1, 0, true);
+}
+END_TEST
+
static void test_inject(struct action actions[], int n)
{
int fd_inj;
@@ -312,7 +328,7 @@ Suite *action_call_suite(void)
{
Suite *s;
int timeout = 30;
- TCase *cont, *block, *ret;
+ TCase *cont, *block, *ret, *call;
TCase *inject, *inject_a;
s = suite_create("Perform actions");
@@ -337,6 +353,12 @@ Suite *action_call_suite(void)
tcase_add_test(block, test_act_block);
suite_add_tcase(s, block);
+ call = tcase_create("a_call");
+ tcase_add_checked_fixture(call, setup_without_fd, teardown);
+ tcase_set_timeout(call, timeout);
+ tcase_add_test(call, test_act_call);
+ suite_add_tcase(s, call);
+
inject = tcase_create("a_inject");
tcase_add_checked_fixture(inject, setup_fd, teardown);
tcase_set_timeout(inject, timeout);