test-execute: block /sys not /proc
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Mar 2019 14:27:32 +0000 (15:27 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Mar 2019 14:46:41 +0000 (15:46 +0100)
As explained in the previous commit, blocking /proc can cause us
to go into a long loop or fail the test.

src/test/test-execute.c
test/meson.build
test/test-execute/exec-inaccessiblepaths-proc.service [deleted file]
test/test-execute/exec-inaccessiblepaths-sys.service [new file with mode: 0644]

index 4d44a28a313c9c37cba32c77e2e66faee7c84f17..f59d267776f408161d44b0d883a736a716587507 100644 (file)
@@ -327,7 +327,7 @@ static void test_exec_inaccessiblepaths(Manager *m) {
                 return;
         }
 
-        test(m, "exec-inaccessiblepaths-proc.service", can_unshare ? 0 : EXIT_FAILURE, CLD_EXITED);
+        test(m, "exec-inaccessiblepaths-sys.service", can_unshare ? 0 : EXIT_FAILURE, CLD_EXITED);
 
         if (path_is_read_only_fs("/") > 0) {
                 log_notice("Root directory is readonly, skipping remaining tests in %s", __func__);
index 870f8bc6a74b53ba0b1ccf8ea5daf5f8cec7d8f9..7255c79dcb8ccc92f1be7ae21a842338ffea2f8a 100644 (file)
@@ -67,7 +67,7 @@ test_data_files = '''
         test-execute/exec-ignoresigpipe-no.service
         test-execute/exec-ignoresigpipe-yes.service
         test-execute/exec-inaccessiblepaths-mount-propagation.service
-        test-execute/exec-inaccessiblepaths-proc.service
+        test-execute/exec-inaccessiblepaths-sys.service
         test-execute/exec-ioschedulingclass-best-effort.service
         test-execute/exec-ioschedulingclass-idle.service
         test-execute/exec-ioschedulingclass-none.service
diff --git a/test/test-execute/exec-inaccessiblepaths-proc.service b/test/test-execute/exec-inaccessiblepaths-proc.service
deleted file mode 100644 (file)
index ebdb484..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-[Unit]
-Description=Test to make sure that mount namespace setup works properly with the 'InaccessiblePaths=/proc' option
-
-[Service]
-InaccessiblePaths=/proc
-ExecStart=/bin/sh -x -c 'test "$$(stat -c %%a /proc)" = "0"'
-Type=oneshot
diff --git a/test/test-execute/exec-inaccessiblepaths-sys.service b/test/test-execute/exec-inaccessiblepaths-sys.service
new file mode 100644 (file)
index 0000000..5ff6f36
--- /dev/null
@@ -0,0 +1,7 @@
+[Unit]
+Description=Test to make sure that mount namespace setup works properly with the 'InaccessiblePaths=/proc' option
+
+[Service]
+InaccessiblePaths=/sys
+ExecStart=/bin/sh -x -c 'test "$$(stat -c %%a /sys)" = "0"'
+Type=oneshot