return r;
}
+static int test_send_one_signal(const struct test* t,
+ struct pakfire_jail* jail, const char* signal) {
+ const char* argv[] = {
+ "/command", "send-signal", signal, NULL,
+ };
+
+ // Perform the command
+ return pakfire_jail_exec(jail, argv, NULL, NULL, NULL);
+}
+
+static int test_send_signal(const struct test* t) {
+ struct pakfire_jail* jail = NULL;
+ int r = EXIT_FAILURE;
+
+ // Create a new jail
+ ASSERT_SUCCESS(pakfire_jail_create(&jail, t->pakfire, 0));
+
+ // Sending SIGTERM to ourselves
+ ASSERT(test_send_one_signal(t, jail, "15") == 0);
+
+ // Sending SIGKILL to ourselves
+ ASSERT(test_send_one_signal(t, jail, "9") == 0);
+
+ // Sending SIGSTOP to ourselves (this should be ignored by the jail)
+ ASSERT(test_send_one_signal(t, jail, "23") == 0);
+
+ // Success
+ r = EXIT_SUCCESS;
+
+FAIL:
+ if (jail)
+ pakfire_jail_unref(jail);
+
+ return r;
+}
+
int main(int argc, const char* argv[]) {
testsuite_add_test(test_create);
testsuite_add_test(test_exit_code);
testsuite_add_test(test_file_ownership);
testsuite_add_test(test_bind);
testsuite_add_test(test_communicate);
+ testsuite_add_test(test_send_signal);
return testsuite_run(argc, argv);
}