From: Michael Tremer Date: Tue, 9 Aug 2022 13:35:37 +0000 (+0000) Subject: tests: jail: Actually run a useful command X-Git-Tag: 0.9.28~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e6645400c05e1c9f1babad86a42c02888f5d601;p=pakfire.git tests: jail: Actually run a useful command Signed-off-by: Michael Tremer --- diff --git a/tests/libpakfire/jail.c b/tests/libpakfire/jail.c index cb847745b..c502b6ae1 100644 --- a/tests/libpakfire/jail.c +++ b/tests/libpakfire/jail.c @@ -23,8 +23,8 @@ #include "../testsuite.h" -static const char* cmd[2] = { - "/usr/bin/does-not-exist", +static const char* cmd_hello_world[] = { + "/command", "echo", "Hello World!", NULL, }; static int test_create(const struct test* t) { @@ -79,16 +79,11 @@ FAIL: static int test_exec(const struct test* t) { struct pakfire_jail* jail = NULL; - const char* argv[] = { - "/does-not-exist", - NULL, - }; - // Create a new jail ASSERT_SUCCESS(pakfire_jail_create(&jail, t->pakfire, 0)); // Try to execute something - ASSERT(pakfire_jail_exec(jail, argv, NULL) == 127); + ASSERT_SUCCESS(pakfire_jail_exec(jail, cmd_hello_world, NULL)); // Destroy it ASSERT_NULL(pakfire_jail_unref(jail)); @@ -114,7 +109,7 @@ static int test_launch_into_cgroup(const struct test* t) { ASSERT_SUCCESS(pakfire_jail_set_cgroup(jail, cgroup)); // Run command - ASSERT(pakfire_jail_exec(jail, cmd, NULL) == 0); + ASSERT(pakfire_jail_exec(jail, cmd_hello_world, NULL) == 0); r = EXIT_SUCCESS;