1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-09 09:57:26 +03:00

Merge pull request #25632 from keszybz/chroot-fix

Add trivial check for preset operation in chroot
This commit is contained in:
Luca Boccassi 2022-12-07 20:51:47 +01:00 committed by GitHub
commit 2d18605ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View File

@ -158,6 +158,7 @@ BASICTOOLS=(
cat
chmod
chown
chroot
cmp
cryptsetup
cut

View File

@ -192,7 +192,7 @@ testcase_nvme_subsystem() {
testcase_virtio_scsi_identically_named_partitions() {
local num
if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
num=$((4 * 4))
else
num=$((16 * 8))
@ -306,7 +306,7 @@ testcase_simultaneous_events() {
local -a devices symlinks
local -A running
if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
num_part=2
iterations=10
timeout=240
@ -401,7 +401,7 @@ testcase_lvm_basic() {
/dev/disk/by-id/ata-foobar_deadbeeflvm{0..3}
)
if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
timeout=180
else
timeout=30
@ -454,7 +454,7 @@ testcase_lvm_basic() {
helper_check_device_units
# Same as above, but now with more "stress"
if [[ -n "${ASAN_OPTIONS:-}" ]] || [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then
if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
iterations=10
else
iterations=50
@ -479,7 +479,7 @@ testcase_lvm_basic() {
helper_check_device_units
# Create & remove LVs in a loop, i.e. with more "stress"
if [[ -n "${ASAN_OPTIONS:-}" ]]; then
if [[ -v ASAN_OPTIONS ]]; then
iterations=8
partitions=16
elif [[ "$(systemd-detect-virt -v)" == "qemu" ]]; then

View File

@ -139,6 +139,16 @@ systemd-analyze cat-config systemd/system.conf systemd/journald.conf >/dev/null
systemd-analyze cat-config systemd/system.conf foo/bar systemd/journald.conf >/dev/null
systemd-analyze cat-config foo/bar
if [[ ! -v ASAN_OPTIONS ]]; then
# check that systemd-analyze cat-config paths work in a chroot
mkdir -p /tmp/root
mount --bind / /tmp/root
systemd-analyze cat-config systemd/system-preset >/tmp/out1
chroot /tmp/root systemd-analyze cat-config systemd/system-preset >/tmp/out2
diff /tmp/out{1,2}
fi
# verify
mkdir -p /tmp/img/usr/lib/systemd/system/
mkdir -p /tmp/img/opt/