1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

Merge pull request #22804 from mrc0mmand/test-tweaks

A couple of TEST-69 tweaks
This commit is contained in:
Luca Boccassi 2022-03-21 20:05:06 +00:00 committed by GitHub
commit a557e61993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -13,18 +13,23 @@ _ORIG_NSPAWN="${SYSTEMD_NSPAWN:?}"
SYSTEMD_NSPAWN="${STATEDIR:?}/run-nspawn"
setup_nspawn_root_hook() {
cat > "${STATEDIR:?}"/run-nspawn <<-EOF
#!/bin/bash
exec "${TEST_BASE_DIR:?}"/test-shutdown.py -- "$_ORIG_NSPAWN" "\$@"
exit 1
EOF
cat >"${STATEDIR:?}/run-nspawn" <<EOF
#!/bin/bash
exec "${TEST_BASE_DIR:?}/test-shutdown.py" -v -- "$_ORIG_NSPAWN" "\$@"
exit 1
EOF
chmod 755 "${STATEDIR:?}"/run-nspawn
}
test_append_files() {
local workspace="${1:?}"
# prevent shutdown in test suite, the expect script does that manually.
rm "${workspace:?}/usr/lib/systemd/tests/testdata/units/end.service"
mkdir -p "${workspace:?}/etc/systemd/system/end.service.d"
cat >"$workspace/etc/systemd/system/end.service.d/99-override.conf" <<EOF
[Service]
ExecStart=
ExecStart=/bin/true
EOF
inst /usr/bin/screen
echo "PS1='screen\$WINDOW # '" >>"$workspace/root/.bashrc"
echo 'startup_message off' >"$workspace/etc/screenrc"

View File

@ -4,4 +4,4 @@ Description=TEST-69-SHUTDOWN
[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
ExecStart=/bin/true