Skip to content

Commit

Permalink
Merge pull request #1310 from ejoerns/fix-service-tests
Browse files Browse the repository at this point in the history
test/service: run service tests only as root
  • Loading branch information
ejoerns committed Jan 2, 2024
2 parents 3a2b438 + cea684d commit cc03d35
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ static void service_test_info(ServiceFixture *fixture, gconstpointer user_data,
return;
}

/* needs to run as root */
if (!test_running_as_root())
return;

bundlepath = g_build_filename(fixture->tmpdir, "good-bundle.raucb", NULL);
g_assert_true(test_copy_file("test", "good-bundle.raucb", fixture->tmpdir, "good-bundle.raucb"));

Expand Down Expand Up @@ -420,6 +424,10 @@ static void service_test_slot_status(ServiceFixture *fixture, gconstpointer user
return;
}

/* needs to run as root */
if (!test_running_as_root())
return;

installer = r_installer_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"de.pengutronix.rauc",
Expand Down

0 comments on commit cc03d35

Please sign in to comment.