Hello everybody,
for me this test fails and I think it is correct to skip it in case
permission is denied. Patch attached.
--
main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];)
putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
From 50ff13f7cf44f9e7e93c82f67ac777456b7e8364 Mon Sep 17 00:00:00 2001 From: Christian Hesse <[email protected]> Date: Tue, 30 Jul 2013 11:35:25 +0200 Subject: [PATCH 1/1] tests: skip test for test-unit-file when executed without privileges
---
src/test/test-unit-file.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index a7fe77a..e7924b5 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -36,7 +36,7 @@
#include "strv.h"
#include "fileio.h"
-static void test_unit_file_get_set(void) {
+static int test_unit_file_get_set(void) {
int r;
Hashmap *h;
Iterator i;
@@ -46,6 +46,10 @@ static void test_unit_file_get_set(void) {
assert(h);
r = unit_file_get_list(UNIT_FILE_SYSTEM, NULL, h);
+ if (r == -EPERM || r == -EACCES) {
+ puts("unit_file_get_list: Permission denied. Skipping test.");
+ return EXIT_TEST_SKIP;
+ }
log_info("unit_file_get_list: %s", strerror(-r));
assert(r >= 0);
@@ -53,6 +57,8 @@ static void test_unit_file_get_set(void) {
printf("%s = %s\n", p->path, unit_file_state_to_string(p->state));
unit_file_list_free(h);
+
+ return 0;
}
static void check_execcommand(ExecCommand *c,
@@ -351,11 +357,13 @@ static void test_install_printf(void) {
#pragma GCC diagnostic pop
int main(int argc, char *argv[]) {
+ int r;
log_parse_environment();
log_open();
- test_unit_file_get_set();
+ if ((r = test_unit_file_get_set()) != 0)
+ return r;
test_config_parse_exec();
test_load_env_file_1();
test_load_env_file_2();
--
1.8.3.4
signature.asc
Description: PGP signature
_______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
