summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-11-20 15:28:12 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2014-11-20 15:28:12 +0100
commit5eef597e931b0428bb984dc2bf0736d032a9198c (patch)
treec24d24d36d083e227a6ba3c1b5ae5c40ae822cb2 /test
parente842803ae5f3f162fa51f30787c3b2423e3826cf (diff)
downloadsystemd-5eef597e931b0428bb984dc2bf0736d032a9198c.tar.gz
Imported Upstream version 217
Diffstat (limited to 'test')
-rw-r--r--test/a.service7
-rw-r--r--test/b.service6
-rw-r--r--test/basic.target15
-rw-r--r--test/bus-policy/hello.conf14
-rw-r--r--test/bus-policy/methods.conf17
-rw-r--r--test/bus-policy/ownerships.conf24
-rw-r--r--test/bus-policy/signals.conf15
-rw-r--r--test/c.service6
-rw-r--r--test/d.service8
-rw-r--r--test/e.service8
-rw-r--r--test/end.service6
-rw-r--r--test/f.service5
-rw-r--r--test/g.service6
-rw-r--r--test/grandchild.service7
-rw-r--r--test/h.service6
-rw-r--r--test/hello-after-sleep.target5
-rw-r--r--test/hello.service5
-rw-r--r--test/parent-deep.slice5
-rw-r--r--test/paths.target10
-rw-r--r--test/shutdown.target12
-rw-r--r--test/sleep.service6
-rw-r--r--test/sockets.target10
-rw-r--r--test/sysinit.target13
-rw-r--r--test/testsuite.target6
-rw-r--r--test/timers.target10
-rwxr-xr-xtest/udev-test.pl62
-rw-r--r--test/unstoppable.service5
27 files changed, 268 insertions, 31 deletions
diff --git a/test/a.service b/test/a.service
new file mode 100644
index 0000000000..4168d2d051
--- /dev/null
+++ b/test/a.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=A
+Requires=b.service
+Before=b.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/b.service b/test/b.service
new file mode 100644
index 0000000000..e03bae36be
--- /dev/null
+++ b/test/b.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=B
+Wants=f.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/basic.target b/test/basic.target
new file mode 100644
index 0000000000..228f62c4b1
--- /dev/null
+++ b/test/basic.target
@@ -0,0 +1,15 @@
+# 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 timers.target paths.target slices.target
+JobTimeoutSec=15min
+JobTimeoutAction=poweroff-force
diff --git a/test/bus-policy/hello.conf b/test/bus-policy/hello.conf
new file mode 100644
index 0000000000..af09893de6
--- /dev/null
+++ b/test/bus-policy/hello.conf
@@ -0,0 +1,14 @@
+<?xml version="1.0"?> <!--*-nxml-*-->
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+
+ <policy context="default">
+ <allow user="*"/>
+
+ <deny user="1"/>
+ <deny group="1"/>
+ </policy>
+
+</busconfig>
diff --git a/test/bus-policy/methods.conf b/test/bus-policy/methods.conf
new file mode 100644
index 0000000000..4bc38f9151
--- /dev/null
+++ b/test/bus-policy/methods.conf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?> <!--*-nxml-*-->
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+
+ <policy context="default">
+ <deny send_type="method_call"/>
+
+ <deny send_destination="org.test.test1"/>
+ <allow send_destination="org.test.test1" send_interface="org.test.int1"/>
+ <allow send_destination="org.test.test1" send_interface="org.test.int2"/>
+
+ <allow receive_sender="org.test.test3" receive_interface="org.test.int3" receive_member="Member111"/>
+ </policy>
+
+</busconfig>
diff --git a/test/bus-policy/ownerships.conf b/test/bus-policy/ownerships.conf
new file mode 100644
index 0000000000..bc3a230a26
--- /dev/null
+++ b/test/bus-policy/ownerships.conf
@@ -0,0 +1,24 @@
+<?xml version="1.0"?> <!--*-nxml-*-->
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+
+ <policy context="default">
+ <allow own="org.test.test1"/>
+ </policy>
+
+ <policy context="mandatory">
+ <deny own="org.test.test3"/>
+ </policy>
+
+ <policy user="root">
+ <allow own="org.test.test2"/>
+ <allow own="org.test.test3"/>
+ </policy>
+
+ <policy user="1">
+ <allow own="org.test.test4"/>
+ </policy>
+
+</busconfig>
diff --git a/test/bus-policy/signals.conf b/test/bus-policy/signals.conf
new file mode 100644
index 0000000000..440e3fe6d0
--- /dev/null
+++ b/test/bus-policy/signals.conf
@@ -0,0 +1,15 @@
+<?xml version="1.0"?> <!--*-nxml-*-->
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+
+ <policy context="default">
+ <allow send_type="signal"/>
+ </policy>
+
+ <policy user="1">
+ <deny send_type="signal"/>
+ </policy>
+
+</busconfig>
diff --git a/test/c.service b/test/c.service
new file mode 100644
index 0000000000..e2f60a8fbf
--- /dev/null
+++ b/test/c.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=C
+Requires=a.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/d.service b/test/d.service
new file mode 100644
index 0000000000..921fd2ee1b
--- /dev/null
+++ b/test/d.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=D:Cyclic
+After=b.service
+Before=a.service
+Requires=a.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/e.service b/test/e.service
new file mode 100644
index 0000000000..5ba98c7c43
--- /dev/null
+++ b/test/e.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=E:Cyclic
+After=b.service
+Before=a.service
+Wants=a.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/end.service b/test/end.service
new file mode 100644
index 0000000000..0f04dfeb20
--- /dev/null
+++ b/test/end.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=End the test
+After=testsuite.service
+
+[Service]
+ExecStart=/usr/bin/systemctl poweroff --no-block
diff --git a/test/f.service b/test/f.service
new file mode 100644
index 0000000000..7dde681c17
--- /dev/null
+++ b/test/f.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=F
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/g.service b/test/g.service
new file mode 100644
index 0000000000..cbfa82a454
--- /dev/null
+++ b/test/g.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=G
+Conflicts=e.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/grandchild.service b/test/grandchild.service
new file mode 100644
index 0000000000..ab641300e4
--- /dev/null
+++ b/test/grandchild.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Grandchild Service
+
+[Service]
+Slice=parent-deep.slice
+Type=oneshot
+ExecStart=/bin/true
diff --git a/test/h.service b/test/h.service
new file mode 100644
index 0000000000..74a7751cad
--- /dev/null
+++ b/test/h.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=H
+Wants=g.service
+
+[Service]
+ExecStart=/bin/true
diff --git a/test/hello-after-sleep.target b/test/hello-after-sleep.target
new file mode 100644
index 0000000000..526fbd2a12
--- /dev/null
+++ b/test/hello-after-sleep.target
@@ -0,0 +1,5 @@
+[Unit]
+Description=Sleep for a minute, then say hello.
+Wants=sleep.service hello.service
+After=sleep.service
+Before=hello.service
diff --git a/test/hello.service b/test/hello.service
new file mode 100644
index 0000000000..82907b64e1
--- /dev/null
+++ b/test/hello.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Hello World
+
+[Service]
+ExecStart=/bin/echo "Hello World"
diff --git a/test/parent-deep.slice b/test/parent-deep.slice
new file mode 100644
index 0000000000..79b302f38d
--- /dev/null
+++ b/test/parent-deep.slice
@@ -0,0 +1,5 @@
+[Unit]
+Description=Deeper Parent Slice
+
+[Slice]
+MemoryLimit=3G
diff --git a/test/paths.target b/test/paths.target
new file mode 100644
index 0000000000..25c7fd031e
--- /dev/null
+++ b/test/paths.target
@@ -0,0 +1,10 @@
+# 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/shutdown.target b/test/shutdown.target
new file mode 100644
index 0000000000..73e302b8b2
--- /dev/null
+++ b/test/shutdown.target
@@ -0,0 +1,12 @@
+# 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/sleep.service b/test/sleep.service
new file mode 100644
index 0000000000..946c44b621
--- /dev/null
+++ b/test/sleep.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Sleep for 1 minute
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sleep 60
diff --git a/test/sockets.target b/test/sockets.target
new file mode 100644
index 0000000000..26ab065d02
--- /dev/null
+++ b/test/sockets.target
@@ -0,0 +1,10 @@
+# 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/sysinit.target b/test/sysinit.target
new file mode 100644
index 0000000000..ec33503330
--- /dev/null
+++ b/test/sysinit.target
@@ -0,0 +1,13 @@
+# 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/testsuite.target b/test/testsuite.target
new file mode 100644
index 0000000000..1a7e5b371a
--- /dev/null
+++ b/test/testsuite.target
@@ -0,0 +1,6 @@
+[Unit]
+Description=Testsuite target
+Requires=multi-user.target
+After=multi-user.target
+Conflicts=rescue.target
+AllowIsolate=yes
diff --git a/test/timers.target b/test/timers.target
new file mode 100644
index 0000000000..07fda3d9d0
--- /dev/null
+++ b/test/timers.target
@@ -0,0 +1,10 @@
+# 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)
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 23f1b726e0..14f11df8af 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -549,21 +549,21 @@ KERNEL=="tty33", OWNER="bad", GROUP="name"
EOF
},
{
- desc => "permissions OWNER=5000",
+ desc => "permissions OWNER=1",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "node",
- exp_perms => "5000::0600",
+ exp_perms => "1::0600",
rules => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="5000"
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1"
EOF
},
{
- desc => "permissions GROUP=100",
+ desc => "permissions GROUP=1",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "node",
- exp_perms => ":100:0660",
+ exp_perms => ":1:0660",
rules => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="100"
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", GROUP="1"
EOF
},
{
@@ -603,30 +603,30 @@ SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", MODE="0777"
EOF
},
{
- desc => "permissions OWNER=5000 GROUP=100 MODE=0777",
+ desc => "permissions OWNER=1 GROUP=1 MODE=0777",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "node",
- exp_perms => "5000:100:0777",
+ exp_perms => "1:1:0777",
rules => <<EOF
-SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="5000", GROUP="100", MODE="0777"
+SUBSYSTEMS=="scsi", KERNEL=="sda", SYMLINK+="node", OWNER="1", GROUP="1", MODE="0777"
EOF
},
{
- desc => "permissions OWNER to 5000",
+ desc => "permissions OWNER to 1",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => "5000::",
+ exp_perms => "1::",
rules => <<EOF
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="5000"
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1"
EOF
},
{
- desc => "permissions GROUP to 100",
+ desc => "permissions GROUP to 1",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => ":100:0660",
+ exp_perms => ":1:0660",
rules => <<EOF
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="100"
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="1"
EOF
},
{
@@ -642,19 +642,19 @@ EOF
desc => "permissions OWNER, GROUP, MODE",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => "5000:100:0777",
+ exp_perms => "1:1:0777",
rules => <<EOF
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="5000", GROUP="100", MODE="0777"
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", OWNER="1", GROUP="1", MODE="0777"
EOF
},
{
desc => "permissions only rule",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => "5000:100:0777",
+ exp_perms => "1:1:0777",
rules => <<EOF
-KERNEL=="ttyACM[0-9]*", OWNER="5000", GROUP="100", MODE="0777"
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
+KERNEL=="ttyACM[0-9]*", OWNER="1", GROUP="1", MODE="0777"
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n"
EOF
},
@@ -662,12 +662,12 @@ EOF
desc => "multiple permissions only rule",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => "3000:4000:0777",
+ exp_perms => "1:1:0777",
rules => <<EOF
-SUBSYSTEM=="tty", OWNER="3000"
-SUBSYSTEM=="tty", GROUP="4000"
+SUBSYSTEM=="tty", OWNER="1"
+SUBSYSTEM=="tty", GROUP="1"
SUBSYSTEM=="tty", MODE="0777"
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n"
EOF
},
@@ -675,13 +675,13 @@ EOF
desc => "permissions only rule with override at SYMLINK+ rule",
devpath => "/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0",
exp_name => "ttyACM0",
- exp_perms => "3000:8000:0777",
+ exp_perms => "1:2:0777",
rules => <<EOF
-SUBSYSTEM=="tty", OWNER="3000"
-SUBSYSTEM=="tty", GROUP="4000"
+SUBSYSTEM=="tty", OWNER="1"
+SUBSYSTEM=="tty", GROUP="1"
SUBSYSTEM=="tty", MODE="0777"
-KERNEL=="ttyUSX[0-9]*", OWNER="5001", GROUP="101", MODE="0444"
-KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="8000"
+KERNEL=="ttyUSX[0-9]*", OWNER="2", GROUP="2", MODE="0444"
+KERNEL=="ttyACM[0-9]*", SYMLINK+="ttyACM%n", GROUP="2"
EOF
},
{
@@ -1274,11 +1274,11 @@ EOF
desc => "TEST PROGRAM feeds OWNER, GROUP, MODE",
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
exp_name => "sda",
- exp_perms => "5000:100:0400",
+ exp_perms => "1:1:0400",
exp_rem_error => "yes",
rules => <<EOF
KERNEL=="sda", MODE="666"
-KERNEL=="sda", PROGRAM=="/bin/echo 5000 100 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
+KERNEL=="sda", PROGRAM=="/bin/echo 1 1 0400", OWNER="%c{1}", GROUP="%c{2}", MODE="%c{3}"
EOF
},
{
diff --git a/test/unstoppable.service b/test/unstoppable.service
new file mode 100644
index 0000000000..24fb0a25e1
--- /dev/null
+++ b/test/unstoppable.service
@@ -0,0 +1,5 @@
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/echo 'I'm unstoppable!'
+ExecStop=/bin/systemctl start --no-block unstoppable.service