@@ -6,7 +6,7 @@ set -o pipefail
66# shellcheck source=test/units/test-control.sh
77. " $( dirname " $0 " ) " /test-control.sh
88
9- clear_unit () {
9+ clear_unit () {
1010 local UNIT_NAME=" ${1:? } "
1111 systemctl stop " $UNIT_NAME " 2> /dev/null || :
1212 rm -f /{etc,run,usr/lib}/systemd/system/" $UNIT_NAME "
@@ -22,14 +22,14 @@ clear_unit () {
2222 fi
2323}
2424
25- clear_units () {
25+ clear_units () {
2626 for u in " $@ " ; do
2727 clear_unit " $u "
2828 done
2929 systemctl daemon-reload
3030}
3131
32- create_service () {
32+ create_service () {
3333 local SERVICE_NAME=" ${1:? } "
3434 clear_units " ${SERVICE_NAME} " .service
3535
4343 mkdir -p /{etc,run,usr/lib}/systemd/system/" $SERVICE_NAME " .service.{d,wants,requires}
4444}
4545
46- create_services () {
46+ create_services () {
4747 for u in " $@ " ; do
4848 create_service " $u "
4949 done
5050}
5151
52- check_ok () {
52+ check_ok () {
5353 x=" $( systemctl show --value -p " ${2:? } " " ${1:? } " ) "
5454 case " $x " in
5555 * ${3:? } * ) return 0 ;;
5656 * ) return 1 ;;
5757 esac
5858}
5959
60- check_ko () {
60+ check_ko () {
6161 ! check_ok " $@ "
6262}
6363
64- testcase_basic_dropins () {
64+ testcase_basic_dropins () {
6565 echo " Testing basic dropins..."
6666
6767 echo " *** test a wants b wants c"
127127 clear_units test15-{a,b,c,c1}.service
128128}
129129
130- testcase_linked_units () {
130+ testcase_linked_units () {
131131 echo " Testing linked units..."
132132 echo " *** test linked unit (same basename)"
133133
@@ -180,7 +180,7 @@ testcase_template_alias() {
180180 clear_units test15-{a,b}@.service
181181}
182182
183- testcase_hierarchical_service_dropins () {
183+ testcase_hierarchical_service_dropins () {
184184 echo " Testing hierarchical service dropins..."
185185 echo " *** test service.d/ top level drop-in"
186186 create_services a-b-c
@@ -226,7 +226,7 @@ ExecCondition=echo $dropin
226226 clear_units a-b-c.service
227227}
228228
229- testcase_hierarchical_slice_dropins () {
229+ testcase_hierarchical_slice_dropins () {
230230 echo " Testing hierarchical slice dropins..."
231231 echo " *** test slice.d/ top level drop-in"
232232 # Slice units don't even need a fragment, so we test the defaults here
@@ -285,7 +285,7 @@ MemoryMax=1000000001
285285 clear_units a-b-c.slice
286286}
287287
288- testcase_transient_service_dropins () {
288+ testcase_transient_service_dropins () {
289289 echo " Testing dropins for a transient service..."
290290 echo " *** test transient service drop-ins"
291291
@@ -320,7 +320,7 @@ testcase_transient_service_dropins () {
320320 /etc/systemd/system/a-b-.service.d/drop3.conf
321321}
322322
323- testcase_transient_slice_dropins () {
323+ testcase_transient_slice_dropins () {
324324 echo " Testing dropins for a transient slice..."
325325 echo " *** test transient slice drop-ins"
326326
@@ -370,7 +370,7 @@ testcase_transient_slice_dropins () {
370370 /etc/systemd/system/a-b-.slice.d/drop3.conf
371371}
372372
373- testcase_template_dropins () {
373+ testcase_template_dropins () {
374374 echo " Testing template dropins..."
375375
376376 create_services foo bar@ yup@
519519 clear_units foo.service {bar,yup,bar-alias}@{,1,2,3}.service
520520}
521521
522- testcase_alias_dropins () {
522+ testcase_alias_dropins () {
523523 echo " Testing alias dropins..."
524524
525525 echo " *** test a wants b1 alias of b"
@@ -551,7 +551,7 @@ testcase_alias_dropins () {
551551 clear_units test15-{a,x,y}.service
552552}
553553
554- testcase_masked_dropins () {
554+ testcase_masked_dropins () {
555555 echo " Testing masked dropins..."
556556
557557 create_services test15-a test15-b
672672 clear_units test15-{a,b}.service
673673}
674674
675- testcase_invalid_dropins () {
675+ testcase_invalid_dropins () {
676676 echo " Testing invalid dropins..."
677677 # Assertion failed on earlier versions, command exits unsuccessfully on later versions
678678 systemctl cat
[email protected] || true @@ -685,7 +685,7 @@ testcase_invalid_dropins () {
685685 return 0
686686}
687687
688- testcase_symlink_dropin_directory () {
688+ testcase_symlink_dropin_directory () {
689689 # For issue #21920.
690690 echo " Testing symlink drop-in directory..."
691691 create_services test15-a
0 commit comments