summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-31 15:40:43 +0200
committerGitHub <noreply@github.com>2024-05-31 15:40:43 +0200
commit80a5f762bb273431f3debc603ea2426caf731e43 (patch)
tree0d08376a80b2a347fa5cf996b3cd8491ac5bc01a /test
parentcryptsetup-generator: Fix memory leak (diff)
parenttest: optionally allow to disable user service manager, and disable it on TES... (diff)
downloadsystemd-80a5f762bb273431f3debc603ea2426caf731e43.tar.xz
systemd-80a5f762bb273431f3debc603ea2426caf731e43.zip
Merge pull request #33121 from yuwata/test-integration-tests-mkosi
Test: several integration test improvements
Diffstat (limited to 'test')
-rw-r--r--test/TEST-64-UDEV-STORAGE/meson.build6
-rw-r--r--test/meson.build4
-rw-r--r--test/test.service.in4
-rwxr-xr-xtest/units/TEST-24-CRYPTSETUP.sh12
-rwxr-xr-xtest/units/TEST-50-DISSECT.sh1
5 files changed, 16 insertions, 11 deletions
diff --git a/test/TEST-64-UDEV-STORAGE/meson.build b/test/TEST-64-UDEV-STORAGE/meson.build
index d54c262386..15981ce35f 100644
--- a/test/TEST-64-UDEV-STORAGE/meson.build
+++ b/test/TEST-64-UDEV-STORAGE/meson.build
@@ -4,7 +4,11 @@ name = fs.name(meson.current_source_dir())
unit = configure_file(
input : files('../test.service.in'),
output : '@0@.service'.format(name),
- configuration : integration_test_template['configuration'],
+ # Disable user service manager by default for performance.
+ configuration : integration_test_template['configuration'] + {
+ 'wants' : '',
+ 'after' : '',
+ },
)
foreach testcase : [
diff --git a/test/meson.build b/test/meson.build
index 92edd079b4..c767b4c64a 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -286,8 +286,8 @@ integration_test_template = {
'configuration' : {
'memory-accounting' : 'no',
'command' : testdata_dir / 'units/%N.sh',
- 'wants' : '',
- 'after' : '',
+ 'wants' : 'multi-user.target user@4711.service',
+ 'after' : 'user@4711.service',
},
'cmdline' : [],
'credentials' : [],
diff --git a/test/test.service.in b/test/test.service.in
index 57f2afbce1..790c513da4 100644
--- a/test/test.service.in
+++ b/test/test.service.in
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=%N
-Wants=basic.target network.target multi-user.target user@4711.service @wants@
-After=basic.target network.target user@4711.service @after@
+Wants=basic.target network.target @wants@
+After=basic.target network.target @after@
Before=getty-pre.target
[Service]
diff --git a/test/units/TEST-24-CRYPTSETUP.sh b/test/units/TEST-24-CRYPTSETUP.sh
index 439a45c015..b788c82cd7 100755
--- a/test/units/TEST-24-CRYPTSETUP.sh
+++ b/test/units/TEST-24-CRYPTSETUP.sh
@@ -71,7 +71,7 @@ cryptsetup_start_and_check() {
if [[ "$umount_header_and_key" -ne 0 ]]; then
umount "$TMPFS_DETACHED_KEYFILE"
umount "$TMPFS_DETACHED_HEADER"
- udevadm settle --timeout=30
+ udevadm settle --timeout=60
fi
systemctl status "$unit"
@@ -143,18 +143,18 @@ cryptsetup luksAddKey --batch-mode \
STORE_IMAGE="$WORKDIR/store.img"
truncate -s 64M "$STORE_IMAGE"
STORE_LOOP="$(losetup --show --find --partscan "$STORE_IMAGE")"
-sfdisk "$STORE_LOOP" <<EOF
+udevadm lock --device "$STORE_LOOP" sfdisk "$STORE_LOOP" <<EOF
label: gpt
type=0FC63DAF-8483-4772-8E79-3D69D8477DE4 name=header_store size=32M
type=0FC63DAF-8483-4772-8E79-3D69D8477DE4 name=keyfile_store
EOF
-udevadm settle --timeout=30
+udevadm settle --timeout=60
mkdir -p /mnt
-mkfs.ext4 -L header_store "/dev/disk/by-partlabel/header_store"
+udevadm lock --device "/dev/disk/by-partlabel/header_store" mkfs.ext4 -L header_store "/dev/disk/by-partlabel/header_store"
mount "/dev/disk/by-partlabel/header_store" /mnt
cp "$IMAGE_DETACHED_HEADER" /mnt/header
umount /mnt
-mkfs.ext4 -L keyfile_store "/dev/disk/by-partlabel/keyfile_store"
+udevadm lock --device "/dev/disk/by-partlabel/keyfile_store" mkfs.ext4 -L keyfile_store "/dev/disk/by-partlabel/keyfile_store"
mount "/dev/disk/by-partlabel/keyfile_store" /mnt
cp "$IMAGE_DETACHED_KEYFILE2" /mnt/keyfile
umount /mnt
@@ -167,7 +167,7 @@ mount -t tmpfs -o size=32M tmpfs "$TMPFS_DETACHED_HEADER"
cp "$IMAGE_DETACHED_KEYFILE" "$TMPFS_DETACHED_KEYFILE/keyfile"
cp "$IMAGE_DETACHED_HEADER" "$TMPFS_DETACHED_HEADER/header"
-udevadm settle --timeout=30
+udevadm settle --timeout=60
# Prepare our test crypttab
[[ -e /etc/crypttab ]] && cp -fv /etc/crypttab /tmp/crypttab.bak
diff --git a/test/units/TEST-50-DISSECT.sh b/test/units/TEST-50-DISSECT.sh
index b1286d70ff..0e378a8e5b 100755
--- a/test/units/TEST-50-DISSECT.sh
+++ b/test/units/TEST-50-DISSECT.sh
@@ -206,6 +206,7 @@ if [[ -n "${OPENSSL_CONFIG:-}" ]]; then
udevadm lock --device="${loop}p3" dd if="$MINIMAL_IMAGE.verity-sig" of="${loop}p3"
fi
losetup -d "$loop"
+udevadm settle --timeout=60
: "Run subtests"