From aa8e00da547b50ea20e3691133bb3ae1d9644a2b Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Fri, 30 Oct 2015 18:12:31 +0100 Subject: test-path: move all related test files to a specific directory To avoid polluting test/ --- Makefile.am | 34 ++++++++++++++------------- src/test/test-path.c | 2 +- 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 ------- test/paths.target | 1 - test/test-path/basic.target | 1 + test/test-path/path-changed.path | 8 +++++++ test/test-path/path-changed.service | 1 + test/test-path/path-directorynotempty.path | 8 +++++++ test/test-path/path-directorynotempty.service | 1 + test/test-path/path-exists.path | 8 +++++++ test/test-path/path-exists.service | 1 + test/test-path/path-existsglob.path | 8 +++++++ test/test-path/path-existsglob.service | 1 + test/test-path/path-makedirectory.path | 10 ++++++++ test/test-path/path-makedirectory.service | 1 + test/test-path/path-modified.path | 8 +++++++ test/test-path/path-modified.service | 1 + test/test-path/path-mycustomunit.service | 6 +++++ test/test-path/path-service.service | 6 +++++ test/test-path/path-unit.path | 9 +++++++ test/test-path/paths.target | 1 + test/test-path/sysinit.target | 1 + 36 files changed, 99 insertions(+), 95 deletions(-) delete mode 100644 test/path-changed.path delete mode 120000 test/path-changed.service delete mode 100644 test/path-directorynotempty.path delete mode 120000 test/path-directorynotempty.service delete mode 100644 test/path-exists.path delete mode 120000 test/path-exists.service delete mode 100644 test/path-existsglob.path delete mode 120000 test/path-existsglob.service delete mode 100644 test/path-makedirectory.path delete mode 120000 test/path-makedirectory.service delete mode 100644 test/path-modified.path delete mode 120000 test/path-modified.service delete mode 100644 test/path-mycustomunit.service delete mode 100644 test/path-service.service delete mode 100644 test/path-unit.path delete mode 120000 test/paths.target create mode 120000 test/test-path/basic.target create mode 100644 test/test-path/path-changed.path create mode 120000 test/test-path/path-changed.service create mode 100644 test/test-path/path-directorynotempty.path create mode 120000 test/test-path/path-directorynotempty.service create mode 100644 test/test-path/path-exists.path create mode 120000 test/test-path/path-exists.service create mode 100644 test/test-path/path-existsglob.path create mode 120000 test/test-path/path-existsglob.service create mode 100644 test/test-path/path-makedirectory.path create mode 120000 test/test-path/path-makedirectory.service create mode 100644 test/test-path/path-modified.path create mode 120000 test/test-path/path-modified.service create mode 100644 test/test-path/path-mycustomunit.service create mode 100644 test/test-path/path-service.service create mode 100644 test/test-path/path-unit.path create mode 120000 test/test-path/paths.target create mode 120000 test/test-path/sysinit.target diff --git a/Makefile.am b/Makefile.am index 4319c2fdb7..be001bd09e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1515,7 +1515,6 @@ EXTRA_DIST += \ test/h.service \ test/parent-deep.slice \ test/parent.slice \ - test/paths.target \ test/sched_idle_bad.service \ test/sched_idle_ok.service \ test/sched_rr_bad.service \ @@ -1529,21 +1528,24 @@ EXTRA_DIST += \ test/testsuite.target \ test/timers.target \ test/unstoppable.service \ - test/path-changed.service \ - test/path-directorynotempty.service \ - test/path-existsglob.service \ - test/path-exists.service \ - test/path-makedirectory.service \ - test/path-modified.service \ - test/path-mycustomunit.service \ - test/path-service.service \ - test/path-changed.path \ - test/path-directorynotempty.path \ - test/path-existsglob.path \ - test/path-exists.path \ - test/path-makedirectory.path \ - test/path-modified.path \ - test/path-unit.path \ + test/test-path/paths.target \ + test/test-path/basic.target \ + test/test-path/sysinit.target \ + test/test-path/path-changed.service \ + test/test-path/path-directorynotempty.service \ + test/test-path/path-existsglob.service \ + test/test-path/path-exists.service \ + test/test-path/path-makedirectory.service \ + test/test-path/path-modified.service \ + test/test-path/path-mycustomunit.service \ + test/test-path/path-service.service \ + test/test-path/path-changed.path \ + test/test-path/path-directorynotempty.path \ + test/test-path/path-existsglob.path \ + test/test-path/path-exists.path \ + test/test-path/path-makedirectory.path \ + test/test-path/path-modified.path \ + test/test-path/path-unit.path \ test/test-execute/exec-environment-empty.service \ test/test-execute/exec-environment-multiple.service \ test/test-execute/exec-environment.service \ diff --git a/src/test/test-path.c b/src/test/test-path.c index ff0f044958..8302bdd283 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); - assert_se(set_unit_path(TEST_DIR) >= 0); + assert_se(set_unit_path(TEST_DIR "/test-path/") >= 0); for (test = tests; test && *test; test++) { int r; diff --git a/test/path-changed.path b/test/path-changed.path deleted file mode 100644 index e58bdd925f..0000000000 --- a/test/path-changed.path +++ /dev/null @@ -1,8 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-changed.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-directorynotempty.path b/test/path-directorynotempty.path deleted file mode 100644 index 17e599fc0e..0000000000 --- a/test/path-directorynotempty.path +++ /dev/null @@ -1,8 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-directorynotempty.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-exists.path b/test/path-exists.path deleted file mode 100644 index c4c9105af4..0000000000 --- a/test/path-exists.path +++ /dev/null @@ -1,8 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-exists.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-existsglob.path b/test/path-existsglob.path deleted file mode 100644 index a058599605..0000000000 --- a/test/path-existsglob.path +++ /dev/null @@ -1,8 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-existsglob.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-makedirectory.path b/test/path-makedirectory.path deleted file mode 100644 index 9408479c0f..0000000000 --- a/test/path-makedirectory.path +++ /dev/null @@ -1,10 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-makedirectory.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-modified.path b/test/path-modified.path deleted file mode 100644 index 18363227ba..0000000000 --- a/test/path-modified.path +++ /dev/null @@ -1,8 +0,0 @@ -[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 deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/path-modified.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/path-mycustomunit.service b/test/path-mycustomunit.service deleted file mode 100644 index 172ac0d0d5..0000000000 --- a/test/path-mycustomunit.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Service Test Path Unit= - -[Service] -ExecStart=/bin/true -Type=oneshot diff --git a/test/path-service.service b/test/path-service.service deleted file mode 100644 index f8499ec619..0000000000 --- a/test/path-service.service +++ /dev/null @@ -1,6 +0,0 @@ -[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 deleted file mode 100644 index 95e572d6d5..0000000000 --- a/test/path-unit.path +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Test Path Unit= - -[Path] -PathExists=/tmp/test-path_unit -Unit=path-mycustomunit.service - -[Install] -WantedBy=multi-user.target diff --git a/test/paths.target b/test/paths.target deleted file mode 120000 index e9939c9801..0000000000 --- a/test/paths.target +++ /dev/null @@ -1 +0,0 @@ -../units/paths.target \ No newline at end of file diff --git a/test/test-path/basic.target b/test/test-path/basic.target new file mode 120000 index 0000000000..a882b72cc9 --- /dev/null +++ b/test/test-path/basic.target @@ -0,0 +1 @@ +../../units/basic.target \ No newline at end of file diff --git a/test/test-path/path-changed.path b/test/test-path/path-changed.path new file mode 100644 index 0000000000..e58bdd925f --- /dev/null +++ b/test/test-path/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/test-path/path-changed.service b/test/test-path/path-changed.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-changed.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-directorynotempty.path b/test/test-path/path-directorynotempty.path new file mode 100644 index 0000000000..17e599fc0e --- /dev/null +++ b/test/test-path/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/test-path/path-directorynotempty.service b/test/test-path/path-directorynotempty.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-directorynotempty.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-exists.path b/test/test-path/path-exists.path new file mode 100644 index 0000000000..c4c9105af4 --- /dev/null +++ b/test/test-path/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/test-path/path-exists.service b/test/test-path/path-exists.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-exists.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-existsglob.path b/test/test-path/path-existsglob.path new file mode 100644 index 0000000000..a058599605 --- /dev/null +++ b/test/test-path/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/test-path/path-existsglob.service b/test/test-path/path-existsglob.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-existsglob.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-makedirectory.path b/test/test-path/path-makedirectory.path new file mode 100644 index 0000000000..9408479c0f --- /dev/null +++ b/test/test-path/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/test-path/path-makedirectory.service b/test/test-path/path-makedirectory.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-makedirectory.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-modified.path b/test/test-path/path-modified.path new file mode 100644 index 0000000000..18363227ba --- /dev/null +++ b/test/test-path/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/test-path/path-modified.service b/test/test-path/path-modified.service new file mode 120000 index 0000000000..8bdf178830 --- /dev/null +++ b/test/test-path/path-modified.service @@ -0,0 +1 @@ +path-service.service \ No newline at end of file diff --git a/test/test-path/path-mycustomunit.service b/test/test-path/path-mycustomunit.service new file mode 100644 index 0000000000..172ac0d0d5 --- /dev/null +++ b/test/test-path/path-mycustomunit.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service Test Path Unit= + +[Service] +ExecStart=/bin/true +Type=oneshot diff --git a/test/test-path/path-service.service b/test/test-path/path-service.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-service.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service Test for Path units + +[Service] +ExecStart=/bin/true +Type=oneshot diff --git a/test/test-path/path-unit.path b/test/test-path/path-unit.path new file mode 100644 index 0000000000..95e572d6d5 --- /dev/null +++ b/test/test-path/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 diff --git a/test/test-path/paths.target b/test/test-path/paths.target new file mode 120000 index 0000000000..b402796cb9 --- /dev/null +++ b/test/test-path/paths.target @@ -0,0 +1 @@ +../../units/paths.target \ No newline at end of file diff --git a/test/test-path/sysinit.target b/test/test-path/sysinit.target new file mode 120000 index 0000000000..9d10e5b2e2 --- /dev/null +++ b/test/test-path/sysinit.target @@ -0,0 +1 @@ +../../units/sysinit.target \ No newline at end of file -- cgit v1.2.3-54-g00ecf