Skip to content

Commit bdfd515

Browse files
committed
test: move TEST-42-EXECSTOPPOST setup to static files
1 parent 0ac5dbf commit bdfd515

File tree

4 files changed

+22
-30
lines changed

4 files changed

+22
-30
lines changed

test/TEST-42-EXECSTOPPOST/test.sh

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,9 @@ test_setup() {
1212
eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
1313

1414
setup_basic_environment
15-
1615
mask_supporting_services
17-
18-
# setup policy for Type=dbus test
19-
mkdir -p $initdir/etc/dbus-1/system.d
20-
cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
21-
<?xml version="1.0"?>
22-
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
23-
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
24-
<busconfig>
25-
<policy user="root">
26-
<allow own="systemd.test.ExecStopPost"/>
27-
</policy>
28-
</busconfig>
29-
EOF
30-
31-
# setup the testsuite service
32-
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
33-
[Unit]
34-
Description=Testsuite service
35-
Before=getty-pre.target
36-
Wants=getty-pre.target
37-
38-
[Service]
39-
ExecStart=/testsuite.sh
40-
Type=oneshot
41-
EOF
42-
cp testsuite.sh $initdir/
43-
44-
setup_testsuite
4516
)
4617
setup_nspawn_root
4718
}
4819

49-
do_test "$@"
20+
do_test "$@" 42

test/test-functions

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,19 @@ install_dbus() {
909909
| while read file; do
910910
inst $file
911911
done
912+
913+
# setup policy for Type=dbus test
914+
mkdir -p $initdir/etc/dbus-1/system.d
915+
cat > $initdir/etc/dbus-1/system.d/systemd.test.ExecStopPost.conf <<EOF
916+
<?xml version="1.0"?>
917+
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
918+
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
919+
<busconfig>
920+
<policy user="root">
921+
<allow own="systemd.test.ExecStopPost"/>
922+
</policy>
923+
</busconfig>
924+
EOF
912925
}
913926

914927
install_user_dbus() {

test/units/testsuite-42.service

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=TEST-42-EXECSTOPPOST
3+
Before=getty-pre.target
4+
Wants=getty-pre.target
5+
6+
[Service]
7+
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
8+
Type=oneshot

0 commit comments

Comments
 (0)