Add integration test for ExtraFileDescriptors after daemon-reexec
This commit adds a corresponding integration test for ExtraFileDescriptors after systemctl daemon-reexec. This ensures systemd keeps the file descriptors while the service manager is restarting and we don't lose ability to restart the service correctly.
This commit is contained in:
@@ -31,8 +31,8 @@ busctl call \
|
||||
org.freedesktop.systemd1.Manager StartTransientUnit \
|
||||
"ssa(sv)a(sa(sv))" "$TEST_UNIT" replace 4 \
|
||||
ExecStart "a(sasb)" 1 \
|
||||
/usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-openfile-child.sh \
|
||||
5 /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-openfile-child.sh 2 "test:other" "Hello" "Extra" \
|
||||
/usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-ExtraFileDescriptors-child.sh \
|
||||
5 /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-ExtraFileDescriptors-child.sh 2 "test:other" "Hello" "Extra" \
|
||||
true \
|
||||
RemainAfterExit "b" true \
|
||||
Type "s" oneshot \
|
||||
@@ -51,6 +51,15 @@ timeout 10s bash -xec 'while [[ "$(systemctl show -P SubState test-23-extra-fd.s
|
||||
assert_eq "$(systemctl show -P Result "$TEST_UNIT")" "success"
|
||||
assert_eq "$(systemctl show -P ExecMainStatus "$TEST_UNIT")" "0"
|
||||
|
||||
# Verify extra file descriptors stay accessible even after service manager re-executes
|
||||
systemctl daemon-reexec
|
||||
|
||||
systemctl restart "$TEST_UNIT"
|
||||
|
||||
assert_eq "$(systemctl show -P SubState "$TEST_UNIT")" "exited"
|
||||
assert_eq "$(systemctl show -P Result "$TEST_UNIT")" "success"
|
||||
assert_eq "$(systemctl show -P ExecMainStatus "$TEST_UNIT")" "0"
|
||||
|
||||
systemctl stop "$TEST_UNIT"
|
||||
|
||||
systemctl log-level info
|
||||
|
||||
Reference in New Issue
Block a user