diff --git a/test/TEST-15-DROPIN/test.sh b/test/TEST-15-DROPIN/test.sh index 63bbd35051..42d6c3dd79 100755 --- a/test/TEST-15-DROPIN/test.sh +++ b/test/TEST-15-DROPIN/test.sh @@ -10,13 +10,8 @@ test_setup() { setup_basic_environment mask_supporting_services - # import the test scripts in the rootfs and plug them in systemd - cp testsuite.service $initdir/etc/systemd/system/ - cp test-dropin.sh $initdir/ - setup_testsuite - # create dedicated rootfs for nspawn (located in $TESTDIR/nspawn-root) setup_nspawn_root } -do_test "$@" +do_test "$@" 15 diff --git a/test/TEST-15-DROPIN/testsuite.service b/test/TEST-15-DROPIN/testsuite.service deleted file mode 100644 index 4c9f65e2b1..0000000000 --- a/test/TEST-15-DROPIN/testsuite.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Testsuite service - -[Service] -ExecStart=/test-dropin.sh -Type=oneshot diff --git a/test/units/testsuite-15.service b/test/units/testsuite-15.service new file mode 100644 index 0000000000..2d07bd6943 --- /dev/null +++ b/test/units/testsuite-15.service @@ -0,0 +1,6 @@ +[Unit] +Description=TEST-15-DROPIN + +[Service] +ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh +Type=oneshot diff --git a/test/TEST-15-DROPIN/test-dropin.sh b/test/units/testsuite-15.sh similarity index 60% rename from test/TEST-15-DROPIN/test-dropin.sh rename to test/units/testsuite-15.sh index f80c9df107..c1d640a31c 100755 --- a/test/TEST-15-DROPIN/test-dropin.sh +++ b/test/units/testsuite-15.sh @@ -56,65 +56,65 @@ test_basic_dropins () { echo "Testing basic dropins..." echo "*** test a wants b wants c" - create_services a b c - ln -s ../b.service /etc/systemd/system/a.service.wants/ - ln -s ../c.service /etc/systemd/system/b.service.wants/ - check_ok a Wants b.service - check_ok b Wants c.service + create_services test15-a test15-b test15-c + ln -s ../test15-b.service /etc/systemd/system/test15-a.service.wants/ + ln -s ../test15-c.service /etc/systemd/system/test15-b.service.wants/ + check_ok test15-a Wants test15-b.service + check_ok test15-b Wants test15-c.service echo "*** test a wants,requires b" - create_services a b c - ln -s ../b.service /etc/systemd/system/a.service.wants/ - ln -s ../b.service /etc/systemd/system/a.service.requires/ - check_ok a Wants b.service - check_ok a Requires b.service + create_services test15-a test15-b test15-c + ln -s ../test15-b.service /etc/systemd/system/test15-a.service.wants/ + ln -s ../test15-b.service /etc/systemd/system/test15-a.service.requires/ + check_ok test15-a Wants test15-b.service + check_ok test15-a Requires test15-b.service echo "*** test a wants nonexistent" - create_service a - ln -s ../nonexistent.service /etc/systemd/system/a.service.wants/ - check_ok a Wants nonexistent.service - systemctl start a - systemctl stop a + create_service test15-a + ln -s ../nonexistent.service /etc/systemd/system/test15-a.service.wants/ + check_ok test15-a Wants nonexistent.service + systemctl start test15-a + systemctl stop test15-a echo "*** test a requires nonexistent" - ln -sf ../nonexistent.service /etc/systemd/system/a.service.requires/ + ln -sf ../nonexistent.service /etc/systemd/system/test15-a.service.requires/ systemctl daemon-reload - check_ok a Requires nonexistent.service + check_ok test15-a Requires nonexistent.service # 'b' is already loaded when 'c' pulls it in via a dropin. echo "*** test a,c require b" - create_services a b c - ln -sf ../b.service /etc/systemd/system/a.service.requires/ - ln -sf ../b.service /etc/systemd/system/c.service.requires/ - systemctl start a - check_ok c Requires b.service - systemctl stop a b + create_services test15-a test15-b test15-c + ln -sf ../test15-b.service /etc/systemd/system/test15-a.service.requires/ + ln -sf ../test15-b.service /etc/systemd/system/test15-c.service.requires/ + systemctl start test15-a + check_ok test15-c Requires test15-b.service + systemctl stop test15-a test15-b # 'b' is already loaded when 'c' pulls it in via an alias dropin. echo "*** test a wants alias" - create_services a b c - ln -sf c.service /etc/systemd/system/c1.service - ln -sf ../c.service /etc/systemd/system/a.service.wants/ - ln -sf ../c1.service /etc/systemd/system/b.service.wants/ - systemctl start a - check_ok a Wants c.service - check_ok b Wants c.service - systemctl stop a c + create_services test15-a test15-b test15-c + ln -sf test15-c.service /etc/systemd/system/test15-c1.service + ln -sf ../test15-c.service /etc/systemd/system/test15-a.service.wants/ + ln -sf ../test15-c1.service /etc/systemd/system/test15-b.service.wants/ + systemctl start test15-a + check_ok test15-a Wants test15-c.service + check_ok test15-b Wants test15-c.service + systemctl stop test15-a test15-c echo "*** test service.d/ top level drop-in" - create_services a b - check_ko a ExecCondition "/bin/echo a" - check_ko b ExecCondition "/bin/echo b" + create_services test15-a test15-b + check_ko test15-a ExecCondition "/bin/echo a" + check_ko test15-b ExecCondition "/bin/echo b" mkdir -p /usr/lib/systemd/system/service.d cat >/usr/lib/systemd/system/service.d/override.conf </usr/lib/systemd/system/a.service.d/override.conf </usr/lib/systemd/system/test15-a.service.d/override.conf </usr/lib/systemd/system/a.service.d/wants-b.conf</usr/lib/systemd/system/test15-a.service.d/wants-b.conf<