Skip to content

Commit

Permalink
Add failing test to show service.d global drop-in does not get overri…
Browse files Browse the repository at this point in the history
…dden by more specific dropins

(cherry picked from commit f5dd6e5)

Related: #2156620
  • Loading branch information
GothAck authored and dtardon committed Jun 15, 2023
1 parent db14dec commit f9dcc06
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/TEST-15-DROPIN/test-dropin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,31 @@ EOF
clear_services a b c
}

test_hierarchical_dropins () {
echo "Testing hierarchical dropins..."
echo "*** test service.d/ top level drop-in"
create_services a-b-c
check_ko a-b-c ExecCondition "/bin/echo service.d"
check_ko a-b-c ExecCondition "/bin/echo a-.service.d"
check_ko a-b-c ExecCondition "/bin/echo a-b-.service.d"
check_ko a-b-c ExecCondition "/bin/echo a-b-c.service.d"

for dropin in service.d a-.service.d a-b-.service.d a-b-c.service.d; do
mkdir -p /usr/lib/systemd/system/$dropin
echo "
[Service]
ExecCondition=/bin/echo $dropin
" >/usr/lib/systemd/system/$dropin/override.conf
systemctl daemon-reload
check_ok a-b-c ExecCondition "/bin/echo $dropin"
done
for dropin in service.d a-.service.d a-b-.service.d a-b-c.service.d; do
rm -rf /usr/lib/systemd/system/$dropin
done

clear_services a-b-c
}

test_template_dropins () {
echo "Testing template dropins..."

Expand Down Expand Up @@ -303,6 +328,7 @@ test_invalid_dropins () {
}

test_basic_dropins
test_hierarchical_dropins
test_template_dropins
test_alias_dropins
test_masked_dropins
Expand Down

0 comments on commit f9dcc06

Please sign in to comment.