mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-09-19 01:45:00 +03:00
test: tidy up the feature handling
This commit is contained in:
@@ -47,20 +47,25 @@ _host_has_feature() {
|
|||||||
|
|
||||||
test_append_files() {
|
test_append_files() {
|
||||||
(
|
(
|
||||||
|
local feature
|
||||||
|
# An associative array of requested (but optional) features and their
|
||||||
|
# respective "handlers" from test/test-functions
|
||||||
|
local -A features=(
|
||||||
|
[multipath]=install_multipath
|
||||||
|
[lvm]=install_lvm
|
||||||
|
)
|
||||||
|
|
||||||
instmods "=block" "=md" "=nvme" "=scsi"
|
instmods "=block" "=md" "=nvme" "=scsi"
|
||||||
install_dmevent
|
install_dmevent
|
||||||
generate_module_dependencies
|
generate_module_dependencies
|
||||||
image_install lsblk wc
|
image_install lsblk wc
|
||||||
|
|
||||||
# Configure multipath
|
# Install the optional features if the host has the respective tooling
|
||||||
if _host_has_feature "multipath"; then
|
for feature in "${!features[@]}"; do
|
||||||
install_multipath
|
if _host_has_feature "$feature"; then
|
||||||
fi
|
"${features[$feature]}"
|
||||||
|
fi
|
||||||
# Configure LVM
|
done
|
||||||
if _host_has_feature "lvm"; then
|
|
||||||
install_lvm
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in {0..127}; do
|
for i in {0..127}; do
|
||||||
dd if=/dev/zero of="${TESTDIR:?}/disk$i.img" bs=1M count=1
|
dd if=/dev/zero of="${TESTDIR:?}/disk$i.img" bs=1M count=1
|
||||||
|
Reference in New Issue
Block a user