mirror of
https://github.com/systemd/systemd.git
synced 2024-12-04 15:53:41 +08:00
test: Drop /usr overlay workaround
/usr is not erofs anymore in the mkosi images so let's drop the workaround where we mount a writable tmpfs on top of /usr.
This commit is contained in:
parent
db07533f74
commit
b8afa59583
@ -8,10 +8,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
# Needed to write units to /usr/lib/systemd/system to test /etc and /run overrides.
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
clear_unit() {
|
||||
local unit_name="${1:?}"
|
||||
local base suffix
|
||||
|
@ -12,16 +12,10 @@ at_exit() {
|
||||
rm -fvr "/usr/lib/systemd/system/$UNIT_NAME" "/etc/systemd/system/$UNIT_NAME.d" "+4"
|
||||
fi
|
||||
|
||||
maybe_umount_usr_overlay
|
||||
|
||||
rm -f /etc/init.d/issue-24990
|
||||
return 0
|
||||
}
|
||||
|
||||
# Needed for /usr/lib/systemd/system/$UNIT_NAME to test overrides in /etc and /run
|
||||
maybe_mount_usr_overlay
|
||||
trap at_exit EXIT
|
||||
|
||||
# Create a simple unit file for testing
|
||||
# Note: the service file is created under /usr on purpose to test
|
||||
# the 'revert' verb as well
|
||||
|
@ -6,10 +6,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
# Needed to create mount.mytmpfs helper
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
teardown_test_dependencies() (
|
||||
set +eux
|
||||
|
||||
|
@ -9,10 +9,6 @@ set -o pipefail
|
||||
# shellcheck source=test/units/util.sh
|
||||
. "$(dirname "$0")"/util.sh
|
||||
|
||||
# Needed to generate test locales in /usr/lib
|
||||
maybe_mount_usr_overlay
|
||||
trap 'maybe_umount_usr_overlay' EXIT
|
||||
|
||||
enable_debug() {
|
||||
mkdir -p /run/systemd/system/systemd-localed.service.d
|
||||
cat >>/run/systemd/system/systemd-localed.service.d/override.conf <<EOF
|
||||
|
@ -226,22 +226,6 @@ kernel_supports_lsm() {
|
||||
return 1
|
||||
}
|
||||
|
||||
MOUNTED_USR_OVERLAY=false
|
||||
|
||||
maybe_mount_usr_overlay() {
|
||||
if [[ ! -w /usr ]]; then
|
||||
mkdir -p /tmp/usr-overlay/{upperdir,workdir}
|
||||
mount -t overlay -o lowerdir=/usr,upperdir=/tmp/usr-overlay/upperdir,workdir=/tmp/usr-overlay/workdir overlay /usr
|
||||
MOUNTED_USR_OVERLAY=true
|
||||
fi
|
||||
}
|
||||
|
||||
maybe_umount_usr_overlay() {
|
||||
if "$MOUNTED_USR_OVERLAY"; then
|
||||
umount -l /usr
|
||||
fi
|
||||
}
|
||||
|
||||
install_extension_images() {
|
||||
local os_release
|
||||
os_release="$(test -e /etc/os-release && echo /etc/os-release || echo /usr/lib/os-release)"
|
||||
|
Loading…
Reference in New Issue
Block a user