#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) {
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));
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;