From bc9992978cd1456b5bb79e72e8cf7a2331d3a7c6 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Wed, 5 Nov 2014 21:27:01 +0100 Subject: tests: add test-path It tests all available directives of Path units: - PathChanged - PathModified - PathExists - PathExisysGlob - DirectoryNotEmpty - MakeDirectory - DirectoryMode - Unit --- 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 +++++++++ 15 files changed, 77 insertions(+) create mode 100644 test/path-changed.path create mode 120000 test/path-changed.service create mode 100644 test/path-directorynotempty.path create mode 120000 test/path-directorynotempty.service create mode 100644 test/path-exists.path create mode 120000 test/path-exists.service create mode 100644 test/path-existsglob.path create mode 120000 test/path-existsglob.service create mode 100644 test/path-makedirectory.path create mode 120000 test/path-makedirectory.service create mode 100644 test/path-modified.path create mode 120000 test/path-modified.service create mode 100644 test/path-mycustomunit.service create mode 100644 test/path-service.service create mode 100644 test/path-unit.path (limited to 'test') diff --git a/test/path-changed.path b/test/path-changed.path new file mode 100644 index 000000000..e58bdd925 --- /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 000000000..8bdf17883 --- /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 000000000..17e599fc0 --- /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 000000000..8bdf17883 --- /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 000000000..c4c9105af --- /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 000000000..8bdf17883 --- /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 000000000..a05859960 --- /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 000000000..8bdf17883 --- /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 000000000..9408479c0 --- /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 000000000..8bdf17883 --- /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 000000000..18363227b --- /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 000000000..8bdf17883 --- /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 000000000..172ac0d0d --- /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 000000000..f8499ec61 --- /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 000000000..95e572d6d --- /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 -- cgit v1.2.3-65-gdbad