From f55198f03430318ab0e9162d8e2ce563c7ee7225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 20 Mar 2020 16:12:12 +0100 Subject: [PATCH] test: replace symlinks with actual unit files During installation, meson complains: > Installing /home/zbyszek/src/systemd-work/test/units/sysinit.target to /var/tmp/systemd-test.Q1FSuj/root/usr/lib/systemd/tests/testdata/units > Warning: trying to copy a symlink that points to a file. This will copy the file, > but this will be changed in a future version of Meson to copy the symlink as is. Please update your > build definitions so that it will not break when the change happens. It *is* convenient to have those files as symlinks, but it is also confusing, because symlinks create aliases, and it seems that in those cases we actually don't want aliases (at least in the case of loopy*.service that'd make the test pointless). --- test/test-path/basic.target | 23 ++++++++++++++++++- test/test-path/path-changed.service | 7 +++++- test/test-path/path-directorynotempty.service | 7 +++++- test/test-path/path-exists.service | 7 +++++- test/test-path/path-existsglob.service | 7 +++++- test/test-path/path-makedirectory.service | 7 +++++- test/test-path/path-modified.service | 7 +++++- test/test-path/paths.target | 13 ++++++++++- test/test-path/sysinit.target | 16 ++++++++++++- test/units/basic.target | 23 ++++++++++++++++++- test/units/loopy2.service | 3 ++- test/units/loopy4.service | 6 ++++- test/units/shutdown.target | 15 +++++++++++- test/units/sockets.target | 13 ++++++++++- test/units/sysinit.target | 16 ++++++++++++- test/units/timers.target | 16 ++++++++++++- 16 files changed, 170 insertions(+), 16 deletions(-) mode change 120000 => 100644 test/test-path/basic.target mode change 120000 => 100644 test/test-path/path-changed.service mode change 120000 => 100644 test/test-path/path-directorynotempty.service mode change 120000 => 100644 test/test-path/path-exists.service mode change 120000 => 100644 test/test-path/path-existsglob.service mode change 120000 => 100644 test/test-path/path-makedirectory.service mode change 120000 => 100644 test/test-path/path-modified.service mode change 120000 => 100644 test/test-path/paths.target mode change 120000 => 100644 test/test-path/sysinit.target mode change 120000 => 100644 test/units/basic.target mode change 120000 => 100644 test/units/loopy2.service mode change 120000 => 100644 test/units/loopy4.service mode change 120000 => 100644 test/units/shutdown.target mode change 120000 => 100644 test/units/sockets.target mode change 120000 => 100644 test/units/sysinit.target mode change 120000 => 100644 test/units/timers.target diff --git a/test/test-path/basic.target b/test/test-path/basic.target deleted file mode 120000 index a882b72cc9..0000000000 --- a/test/test-path/basic.target +++ /dev/null @@ -1 +0,0 @@ -../../units/basic.target \ No newline at end of file diff --git a/test/test-path/basic.target b/test/test-path/basic.target new file mode 100644 index 0000000000..4f44292249 --- /dev/null +++ b/test/test-path/basic.target @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Basic System +Documentation=man:systemd.special(7) +Requires=sysinit.target +Wants=sockets.target timers.target paths.target slices.target +After=sysinit.target sockets.target paths.target slices.target tmp.mount + +# We support /var, /tmp, /var/tmp, being on NFS, but we don't pull in +# remote-fs.target by default, hence pull them in explicitly here. Note that we +# require /var and /var/tmp, but only add a Wants= type dependency on /tmp, as +# we support that unit being masked, and this should not be considered an error. +RequiresMountsFor=/var /var/tmp +Wants=tmp.mount diff --git a/test/test-path/path-changed.service b/test/test-path/path-changed.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-changed.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-changed.service b/test/test-path/path-changed.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-changed.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-directorynotempty.service b/test/test-path/path-directorynotempty.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-directorynotempty.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-directorynotempty.service b/test/test-path/path-directorynotempty.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-directorynotempty.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-exists.service b/test/test-path/path-exists.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-exists.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-exists.service b/test/test-path/path-exists.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-exists.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-existsglob.service b/test/test-path/path-existsglob.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-existsglob.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-existsglob.service b/test/test-path/path-existsglob.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-existsglob.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-makedirectory.service b/test/test-path/path-makedirectory.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-makedirectory.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-makedirectory.service b/test/test-path/path-makedirectory.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-makedirectory.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-modified.service b/test/test-path/path-modified.service deleted file mode 120000 index 8bdf178830..0000000000 --- a/test/test-path/path-modified.service +++ /dev/null @@ -1 +0,0 @@ -path-service.service \ No newline at end of file diff --git a/test/test-path/path-modified.service b/test/test-path/path-modified.service new file mode 100644 index 0000000000..f8499ec619 --- /dev/null +++ b/test/test-path/path-modified.service @@ -0,0 +1,6 @@ +[Unit] +Description=Service Test for Path units + +[Service] +ExecStart=/bin/true +Type=oneshot diff --git a/test/test-path/paths.target b/test/test-path/paths.target deleted file mode 120000 index b402796cb9..0000000000 --- a/test/test-path/paths.target +++ /dev/null @@ -1 +0,0 @@ -../../units/paths.target \ No newline at end of file diff --git a/test/test-path/paths.target b/test/test-path/paths.target new file mode 100644 index 0000000000..9b6ed1c13f --- /dev/null +++ b/test/test-path/paths.target @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Paths +Documentation=man:systemd.special(7) diff --git a/test/test-path/sysinit.target b/test/test-path/sysinit.target deleted file mode 120000 index 9d10e5b2e2..0000000000 --- a/test/test-path/sysinit.target +++ /dev/null @@ -1 +0,0 @@ -../../units/sysinit.target \ No newline at end of file diff --git a/test/test-path/sysinit.target b/test/test-path/sysinit.target new file mode 100644 index 0000000000..b6c16a1412 --- /dev/null +++ b/test/test-path/sysinit.target @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=System Initialization +Documentation=man:systemd.special(7) +Conflicts=emergency.service emergency.target +Wants=local-fs.target swap.target +After=local-fs.target swap.target emergency.service emergency.target diff --git a/test/units/basic.target b/test/units/basic.target deleted file mode 120000 index a882b72cc9..0000000000 --- a/test/units/basic.target +++ /dev/null @@ -1 +0,0 @@ -../../units/basic.target \ No newline at end of file diff --git a/test/units/basic.target b/test/units/basic.target new file mode 100644 index 0000000000..4f44292249 --- /dev/null +++ b/test/units/basic.target @@ -0,0 +1,22 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Basic System +Documentation=man:systemd.special(7) +Requires=sysinit.target +Wants=sockets.target timers.target paths.target slices.target +After=sysinit.target sockets.target paths.target slices.target tmp.mount + +# We support /var, /tmp, /var/tmp, being on NFS, but we don't pull in +# remote-fs.target by default, hence pull them in explicitly here. Note that we +# require /var and /var/tmp, but only add a Wants= type dependency on /tmp, as +# we support that unit being masked, and this should not be considered an error. +RequiresMountsFor=/var /var/tmp +Wants=tmp.mount diff --git a/test/units/loopy2.service b/test/units/loopy2.service deleted file mode 120000 index 961b1fe9bc..0000000000 --- a/test/units/loopy2.service +++ /dev/null @@ -1 +0,0 @@ -loopy.service \ No newline at end of file diff --git a/test/units/loopy2.service b/test/units/loopy2.service new file mode 100644 index 0000000000..9eb645748e --- /dev/null +++ b/test/units/loopy2.service @@ -0,0 +1,2 @@ +[Service] +ExecStart=/bin/true diff --git a/test/units/loopy4.service b/test/units/loopy4.service deleted file mode 120000 index 43e5658bcd..0000000000 --- a/test/units/loopy4.service +++ /dev/null @@ -1 +0,0 @@ -loopy3.service \ No newline at end of file diff --git a/test/units/loopy4.service b/test/units/loopy4.service new file mode 100644 index 0000000000..606e26b5da --- /dev/null +++ b/test/units/loopy4.service @@ -0,0 +1,5 @@ +[Service] +ExecStart=/bin/true + +[Unit] +Conflicts=loopy4.service diff --git a/test/units/shutdown.target b/test/units/shutdown.target deleted file mode 120000 index 8e58943bc4..0000000000 --- a/test/units/shutdown.target +++ /dev/null @@ -1 +0,0 @@ -../../units/shutdown.target \ No newline at end of file diff --git a/test/units/shutdown.target b/test/units/shutdown.target new file mode 100644 index 0000000000..d48e6d6494 --- /dev/null +++ b/test/units/shutdown.target @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Shutdown +Documentation=man:systemd.special(7) +DefaultDependencies=no +RefuseManualStart=yes diff --git a/test/units/sockets.target b/test/units/sockets.target deleted file mode 120000 index 745480af56..0000000000 --- a/test/units/sockets.target +++ /dev/null @@ -1 +0,0 @@ -../../units/sockets.target \ No newline at end of file diff --git a/test/units/sockets.target b/test/units/sockets.target new file mode 100644 index 0000000000..9af67fdb1f --- /dev/null +++ b/test/units/sockets.target @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Sockets +Documentation=man:systemd.special(7) diff --git a/test/units/sysinit.target b/test/units/sysinit.target deleted file mode 120000 index 9d10e5b2e2..0000000000 --- a/test/units/sysinit.target +++ /dev/null @@ -1 +0,0 @@ -../../units/sysinit.target \ No newline at end of file diff --git a/test/units/sysinit.target b/test/units/sysinit.target new file mode 100644 index 0000000000..b6c16a1412 --- /dev/null +++ b/test/units/sysinit.target @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=System Initialization +Documentation=man:systemd.special(7) +Conflicts=emergency.service emergency.target +Wants=local-fs.target swap.target +After=local-fs.target swap.target emergency.service emergency.target diff --git a/test/units/timers.target b/test/units/timers.target deleted file mode 120000 index 7718a12683..0000000000 --- a/test/units/timers.target +++ /dev/null @@ -1 +0,0 @@ -../../units/timers.target \ No newline at end of file diff --git a/test/units/timers.target b/test/units/timers.target new file mode 100644 index 0000000000..b1aa8c797c --- /dev/null +++ b/test/units/timers.target @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# 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. + +[Unit] +Description=Timers +Documentation=man:systemd.special(7) + +DefaultDependencies=no +Conflicts=shutdown.target