[systemd-commits] 6 commits - .gitignore Makefile.am src/core src/test test/path-changed.path test/path-changed.service test/path-directorynotempty.path test/path-directorynotempty.service test/path-existsglob.path test/path-existsglob.service test/path-exists.path test/path-exists.service test/path-makedirectory.path test/path-makedirectory.service test/path-modified.path test/path-modified.service test/path-mycustomunit.service test/path-service.service test/path-unit.path

Tom Gundersen tomegun at kemper.freedesktop.org
Sat Nov 8 17:58:17 PST 2014


 .gitignore                          |    3 
 Makefile.am                         |   56 ++++---
 src/core/manager.c                  |    3 
 src/test/test-path.c                |  272 ++++++++++++++++++++++++++++++++++++
 test/path-changed.path              |    8 +
 test/path-changed.service           |    1 
 test/path-directorynotempty.path    |    8 +
 test/path-directorynotempty.service |    1 
 test/path-exists.path               |    8 +
 test/path-exists.service            |    1 
 test/path-existsglob.path           |    8 +
 test/path-existsglob.service        |    1 
 test/path-makedirectory.path        |   10 +
 test/path-makedirectory.service     |    1 
 test/path-modified.path             |    8 +
 test/path-modified.service          |    1 
 test/path-mycustomunit.service      |    6 
 test/path-service.service           |    6 
 test/path-unit.path                 |    9 +
 19 files changed, 382 insertions(+), 29 deletions(-)

New commits:
commit 5445c7a002f885a16fe43e90bd33594496efdad8
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Nov 8 22:33:02 2014 +0100

    build-sys: do not include tests in code coverage

diff --git a/Makefile.am b/Makefile.am
index 416e4d3..2bb1f02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1893,7 +1893,8 @@ lcov-report:
 	$(MKDIR_P) $(coverage_dir)
 	lcov $(coverage_opts) --compat-libtool --capture --no-external \
 		| sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
-	genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
+	lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
+	genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
 	@echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
 
 # lcov doesn't work properly with vpath builds, make sure that bad

commit 8444e49c99352959d8b453b32c98d455c4960f4e
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Nov 8 22:31:04 2014 +0100

    update .gitignore

diff --git a/.gitignore b/.gitignore
index f1174e7..a4a236f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,7 +143,6 @@
 /test-bus-kernel-bloom
 /test-bus-marshal
 /test-bus-match
-/test-bus-memfd
 /test-bus-objects
 /test-bus-policy
 /test-bus-server
@@ -196,7 +195,6 @@
 /test-journal-syslog
 /test-journal-verify
 /test-libsystemd-sym*
-/test-libsystemd-*-sym*
 /test-libudev
 /test-libudev-sym*
 /test-list

commit ad02805f85f600a9f1c5ffbf3527b8079d37656b
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Nov 8 22:05:29 2014 +0100

    build-sys: link to libsystemd-core only when needed
    
    Multiple executables do not need libsystemd-core

diff --git a/Makefile.am b/Makefile.am
index ca8e339..416e4d3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1531,7 +1531,7 @@ test_fdset_SOURCES = \
 	src/test/test-fdset.c
 
 test_fdset_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_ratelimit_SOURCES = \
 	src/test/test-ratelimit.c
@@ -1544,31 +1544,31 @@ test_util_SOURCES = \
 
 test_util_LDADD = \
 	-lm \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_uid_range_SOURCES = \
 	src/test/test-uid-range.c
 
 test_uid_range_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_socket_util_SOURCES = \
 	src/test/test-socket-util.c
 
 test_socket_util_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_ring_SOURCES = \
 	src/test/test-ring.c
 
 test_ring_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_barrier_SOURCES = \
 	src/test/test-barrier.c
 
 test_barrier_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_pty_SOURCES = \
 	src/test/test-pty.c
@@ -1611,13 +1611,13 @@ test_hashmap_SOURCES = \
 	src/test/test-hashmap-plain.c
 
 test_hashmap_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_set_SOURCES = \
 	src/test/test-set.c
 
 test_set_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_xml_SOURCES = \
 	src/test/test-xml.c
@@ -1628,15 +1628,15 @@ test_xml_LDADD = \
 test_list_SOURCES = \
 	src/test/test-list.c
 
+test_list_LDADD = \
+	libsystemd-shared.la
+
 test_unaligned_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_unaligned_SOURCES = \
 	src/test/test-unaligned.c
 
-test_list_LDADD = \
-	libsystemd-core.la
-
 test_tables_SOURCES = \
 	src/test/test-tables.c \
 	src/shared/test-tables.h \
@@ -1665,19 +1665,19 @@ test_prioq_SOURCES = \
 	src/test/test-prioq.c
 
 test_prioq_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_fileio_SOURCES = \
 	src/test/test-fileio.c
 
 test_fileio_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_time_SOURCES = \
 	src/test/test-time.c
 
 test_time_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_architecture_SOURCES = \
 	src/test/test-architecture.c
@@ -1689,7 +1689,7 @@ test_log_SOURCES = \
 	src/test/test-log.c
 
 test_log_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_ipcrm_SOURCES = \
 	src/test/test-ipcrm.c
@@ -1714,13 +1714,13 @@ test_ellipsize_SOURCES = \
 	src/test/test-ellipsize.c
 
 test_ellipsize_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_date_SOURCES = \
 	src/test/test-date.c
 
 test_date_LDADD = \
-	libsystemd-core.la
+	libsystemd-shared.la
 
 test_sleep_SOURCES = \
 	src/test/test-sleep.c
@@ -3927,7 +3927,6 @@ systemd_journal_upload_CFLAGS = \
 	$(LIBCURL_CFLAGS)
 
 systemd_journal_upload_LDADD = \
-	libsystemd-core.la \
 	libsystemd-internal.la \
 	libsystemd-journal-internal.la \
 	libsystemd-shared.la \

commit 0c2a5d721ece665618614d05049975ad84a9ee4a
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Nov 8 21:55:07 2014 +0100

    core: remove unused macro GC_QUEUE_USEC_MAX
    
    It is unused since cf1265e188e876dda906dca0029248a06dc80c33

diff --git a/src/core/manager.c b/src/core/manager.c
index 350f2f3..6c7eac2 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -79,9 +79,6 @@
 #include "bus-kernel.h"
 #include "time-util.h"
 
-/* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */
-#define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC)
-
 /* Initial delay and the interval for printing status messages about running jobs */
 #define JOBS_IN_PROGRESS_WAIT_USEC (5*USEC_PER_SEC)
 #define JOBS_IN_PROGRESS_PERIOD_USEC (USEC_PER_SEC / 3)

commit b36bf0f3611f7845c08b1c553a57e6a6e400e75a
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Sat Nov 8 21:11:19 2014 +0100

    build-sys: avoid duplication of macro definition
    
    TEST_DIR is already defined in AM_CFLAGS

diff --git a/Makefile.am b/Makefile.am
index 698a7b0..ca8e339 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1765,8 +1765,7 @@ test_cgroup_mask_SOURCES = \
 	src/test/test-cgroup-mask.c
 
 test_cgroup_mask_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	-DTEST_DIR=\"$(abs_top_srcdir)/test\"
+	$(AM_CPPFLAGS)
 
 test_cgroup_mask_CFLAGS = \
 	$(AM_CFLAGS) \
@@ -1844,8 +1843,7 @@ test_sched_prio_SOURCES = \
 	src/test/test-sched-prio.c
 
 test_sched_prio_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	-DTEST_DIR=\"$(abs_top_srcdir)/test\"
+	$(AM_CPPFLAGS)
 
 test_sched_prio_CFLAGS = \
 	$(AM_CFLAGS) \

commit bc9992978cd1456b5bb79e72e8cf7a2331d3a7c6
Author: Ronny Chevalier <chevalier.ronny at gmail.com>
Date:   Wed Nov 5 21:27:01 2014 +0100

    tests: add test-path
    
    It tests all available directives of Path units:
    - PathChanged
    - PathModified
    - PathExists
    - PathExisysGlob
    - DirectoryNotEmpty
    - MakeDirectory
    - DirectoryMode
    - Unit

diff --git a/.gitignore b/.gitignore
index 4c66564..f1174e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -213,6 +213,7 @@
 /test-network
 /test-network-tables
 /test-ns
+/test-path
 /test-path-util
 /test-prioq
 /test-ratelimit
diff --git a/Makefile.am b/Makefile.am
index 461ffa9..698a7b0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1321,6 +1321,7 @@ tests += \
 	test-env-replace \
 	test-strbuf \
 	test-strv \
+	test-path \
 	test-path-util \
 	test-strxcpyx \
 	test-unit-name \
@@ -1809,6 +1810,15 @@ test_path_util_SOURCES = \
 test_path_util_LDADD = \
 	libsystemd-shared.la
 
+test_path_SOURCES = \
+	src/test/test-path.c
+
+test_path_CFLAGS = \
+	$(AM_CFLAGS)
+
+test_path_LDADD = \
+	libsystemd-core.la
+
 test_strxcpyx_SOURCES = \
 	src/test/test-strxcpyx.c
 
diff --git a/src/test/test-path.c b/src/test/test-path.c
new file mode 100644
index 0000000..29b187a
--- /dev/null
+++ b/src/test/test-path.c
@@ -0,0 +1,272 @@
+/***
+  This file is part of systemd.
+
+  Copyright 2014 Ronny Chevalier
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <stdio.h>
+#include <stdbool.h>
+
+#include "unit.h"
+#include "manager.h"
+#include "util.h"
+#include "macro.h"
+#include "strv.h"
+#include "mkdir.h"
+
+typedef void (*test_function_t)(Manager *m);
+
+static int setup_test(Manager **m) {
+        char **tests_path = STRV_MAKE("exists", "existsglobFOOBAR", "changed", "modified", "unit",
+                                      "directorynotempty", "makedirectory");
+        char **test_path;
+        Manager *tmp;
+        int r;
+
+        assert_se(m);
+
+        r = manager_new(SYSTEMD_USER, true, &tmp);
+        if (IN_SET(r, -EPERM, -EACCES, -EADDRINUSE, -EHOSTDOWN, -ENOENT)) {
+                printf("Skipping test: manager_new: %s", strerror(-r));
+                return -EXIT_TEST_SKIP;
+        }
+        assert_se(r >= 0);
+        assert_se(manager_startup(tmp, NULL, NULL) >= 0);
+
+        STRV_FOREACH(test_path, tests_path) {
+               rm_rf_dangerous(strappenda("/tmp/test-path_", *test_path), false, true, false);
+        }
+
+        *m = tmp;
+
+        return 0;
+}
+
+static void shutdown_test(Manager *m) {
+        assert_se(m);
+
+        manager_free(m);
+}
+
+static void check_stop_unlink(Manager *m, Unit *unit, const char *test_path, const char *service_name) {
+        _cleanup_free_ char *tmp = NULL;
+        Unit *service_unit = NULL;
+        Service *service = NULL;
+        usec_t ts;
+        usec_t timeout = 2 * USEC_PER_SEC;
+
+        assert_se(m);
+        assert_se(unit);
+        assert_se(test_path);
+
+        if (!service_name) {
+                assert_se(tmp = strreplace(unit->id, ".path", ".service"));
+                service_unit = manager_get_unit(m, tmp);
+        } else
+                service_unit = manager_get_unit(m, service_name);
+        assert_se(service_unit);
+        service = SERVICE(service_unit);
+
+        ts = now(CLOCK_MONOTONIC);
+        /* We proces events until the service related to the path has been successfully started */
+        while(service->result != SERVICE_SUCCESS || service->state != SERVICE_START) {
+                usec_t n;
+                int r;
+
+                r = sd_event_run(m->event, 100 * USEC_PER_MSEC);
+                assert_se(r >= 0);
+
+                printf("%s: state = %s; result = %s \n",
+                                service_unit->id,
+                                service_state_to_string(service->state),
+                                service_result_to_string(service->result));
+
+
+                /* But we timeout if the service has not been started in the allocated time */
+                n = now(CLOCK_MONOTONIC);
+                if (ts + timeout < n) {
+                        log_error("Test timeout when testing %s", unit->id);
+                        exit(EXIT_FAILURE);
+                }
+        }
+
+        assert_se(UNIT_VTABLE(unit)->stop(unit) >= 0);
+        assert_se(UNIT_VTABLE(service_unit)->stop(service_unit) >= 0);
+        rm_rf_dangerous(test_path, false, true, false);
+}
+
+static void test_path_exists(Manager *m) {
+        const char *test_path = "/tmp/test-path_exists";
+        Unit *unit = NULL;
+
+        assert_se(m);
+
+        assert_se(manager_load_unit(m, "path-exists.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        assert_se(touch(test_path) >= 0);
+
+        check_stop_unlink(m, unit, test_path, NULL);
+}
+
+static void test_path_existsglob(Manager *m) {
+        const char *test_path = "/tmp/test-path_existsglobFOOBAR";
+        Unit *unit = NULL;
+
+        assert_se(m);
+        assert_se(manager_load_unit(m, "path-existsglob.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        assert_se(touch(test_path) >= 0);
+
+        check_stop_unlink(m, unit, test_path, NULL);
+}
+
+static void test_path_changed(Manager *m) {
+        const char *test_path = "/tmp/test-path_changed";
+        FILE *f;
+        Unit *unit = NULL;
+
+        assert_se(m);
+
+        assert_se(touch(test_path) >= 0);
+
+        assert_se(manager_load_unit(m, "path-changed.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        f = fopen(test_path, "w");
+        assert_se(f);
+        fclose(f);
+
+        check_stop_unlink(m, unit, test_path, NULL);
+}
+
+static void test_path_modified(Manager *m) {
+        _cleanup_fclose_ FILE *f = NULL;
+        const char *test_path = "/tmp/test-path_modified";
+        Unit *unit = NULL;
+
+        assert_se(m);
+
+        assert_se(touch(test_path) >= 0);
+
+        assert_se(manager_load_unit(m, "path-modified.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        f = fopen(test_path, "w");
+        assert_se(f);
+        fputs("test", f);
+
+        check_stop_unlink(m, unit, test_path, NULL);
+}
+
+static void test_path_unit(Manager *m) {
+        const char *test_path = "/tmp/test-path_unit";
+        Unit *unit = NULL;
+
+        assert_se(m);
+
+        assert_se(manager_load_unit(m, "path-unit.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        assert_se(touch(test_path) >= 0);
+
+        check_stop_unlink(m, unit, test_path, "path-mycustomunit.service");
+}
+
+static void test_path_directorynotempty(Manager *m) {
+        const char *test_path = "/tmp/test-path_directorynotempty/";
+        Unit *unit = NULL;
+
+        assert_se(m);
+
+        assert_se(access(test_path, F_OK) < 0);
+
+        assert_se(manager_load_unit(m, "path-directorynotempty.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        /* MakeDirectory default to no */
+        assert_se(access(test_path, F_OK) < 0);
+
+        assert_se(mkdir_p(test_path, 0755) >= 0);
+        assert_se(touch(strappenda(test_path, "test_file")) >= 0);
+
+        check_stop_unlink(m, unit, test_path, NULL);
+}
+
+static void test_path_makedirectory_directorymode(Manager *m) {
+        const char *test_path = "/tmp/test-path_makedirectory/";
+        Unit *unit = NULL;
+        struct stat s;
+
+        assert_se(m);
+
+        assert_se(access(test_path, F_OK) < 0);
+
+        assert_se(manager_load_unit(m, "path-makedirectory.path", NULL, NULL, &unit) >= 0);
+        assert_se(UNIT_VTABLE(unit)->start(unit) >= 0);
+
+        /* Check if the directory has been created */
+        assert_se(access(test_path, F_OK) >= 0);
+
+        /* Check the mode we specified with DirectoryMode=0744 */
+        assert_se(stat(test_path, &s) >= 0);
+        assert_se((s.st_mode & S_IRWXU) == 0700);
+        assert_se((s.st_mode & S_IRWXG) == 0040);
+        assert_se((s.st_mode & S_IRWXO) == 0004);
+
+        assert_se(UNIT_VTABLE(unit)->stop(unit) >= 0);
+        rm_rf_dangerous(test_path, false, true, false);
+}
+
+int main(int argc, char *argv[]) {
+        test_function_t tests[] = {
+                test_path_exists,
+                test_path_existsglob,
+                test_path_changed,
+                test_path_modified,
+                test_path_unit,
+                test_path_directorynotempty,
+                test_path_makedirectory_directorymode,
+                NULL,
+        };
+        test_function_t *test = NULL;
+        Manager *m = NULL;
+
+        log_parse_environment();
+        log_open();
+
+        /* It is needed otherwise cgroup creation fails */
+        if (getuid() != 0)
+                return EXIT_TEST_SKIP;
+
+        assert_se(set_unit_path(TEST_DIR ":") >= 0);
+
+        for (test = tests; test && *test; test++) {
+                int r;
+
+                /* We create a clean environment for each test */
+                r = setup_test(&m);
+                if (r < 0)
+                        return -r;
+
+                (*test)(m);
+
+                shutdown_test(m);
+        }
+
+        return 0;
+}
diff --git a/test/path-changed.path b/test/path-changed.path
new file mode 100644
index 0000000..e58bdd9
--- /dev/null
+++ b/test/path-changed.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test PathChanged
+
+[Path]
+PathChanged=/tmp/test-path_changed
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-changed.service b/test/path-changed.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-changed.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-directorynotempty.path b/test/path-directorynotempty.path
new file mode 100644
index 0000000..17e599f
--- /dev/null
+++ b/test/path-directorynotempty.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test DirectoryNotEmpty
+
+[Path]
+DirectoryNotEmpty=/tmp/test-path_directorynotempty/
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-directorynotempty.service b/test/path-directorynotempty.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-directorynotempty.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-exists.path b/test/path-exists.path
new file mode 100644
index 0000000..c4c9105
--- /dev/null
+++ b/test/path-exists.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test PathExists
+
+[Path]
+PathExists=/tmp/test-path_exists
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-exists.service b/test/path-exists.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-exists.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-existsglob.path b/test/path-existsglob.path
new file mode 100644
index 0000000..a058599
--- /dev/null
+++ b/test/path-existsglob.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test PathExistsGlob
+
+[Path]
+PathExistsGlob=/tmp/test-path_existsglob*
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-existsglob.service b/test/path-existsglob.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-existsglob.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-makedirectory.path b/test/path-makedirectory.path
new file mode 100644
index 0000000..9408479
--- /dev/null
+++ b/test/path-makedirectory.path
@@ -0,0 +1,10 @@
+[Unit]
+Description=Test MakeDirectory & DirectoryMode
+
+[Path]
+DirectoryNotEmpty=/tmp/test-path_makedirectory/
+MakeDirectory=yes
+DirectoryMode=0744
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-makedirectory.service b/test/path-makedirectory.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-makedirectory.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-modified.path b/test/path-modified.path
new file mode 100644
index 0000000..1836322
--- /dev/null
+++ b/test/path-modified.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=Test PathModified
+
+[Path]
+PathModified=/tmp/test-path_modified
+
+[Install]
+WantedBy=multi-user.target
diff --git a/test/path-modified.service b/test/path-modified.service
new file mode 120000
index 0000000..8bdf178
--- /dev/null
+++ b/test/path-modified.service
@@ -0,0 +1 @@
+path-service.service
\ No newline at end of file
diff --git a/test/path-mycustomunit.service b/test/path-mycustomunit.service
new file mode 100644
index 0000000..172ac0d
--- /dev/null
+++ b/test/path-mycustomunit.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Service Test Path Unit=
+
+[Service]
+ExecStart=/bin/true
+Type=oneshot
diff --git a/test/path-service.service b/test/path-service.service
new file mode 100644
index 0000000..f8499ec
--- /dev/null
+++ b/test/path-service.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Service Test for Path units
+
+[Service]
+ExecStart=/bin/true
+Type=oneshot
diff --git a/test/path-unit.path b/test/path-unit.path
new file mode 100644
index 0000000..95e572d
--- /dev/null
+++ b/test/path-unit.path
@@ -0,0 +1,9 @@
+[Unit]
+Description=Test Path Unit=
+
+[Path]
+PathExists=/tmp/test-path_unit
+Unit=path-mycustomunit.service
+
+[Install]
+WantedBy=multi-user.target



More information about the systemd-commits mailing list