mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
test: tidy up the feature handling
This commit is contained in:
parent
babe935563
commit
70ec7736f8
@ -47,20 +47,25 @@ _host_has_feature() {
|
||||
|
||||
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"
|
||||
install_dmevent
|
||||
generate_module_dependencies
|
||||
image_install lsblk wc
|
||||
|
||||
# Configure multipath
|
||||
if _host_has_feature "multipath"; then
|
||||
install_multipath
|
||||
fi
|
||||
|
||||
# Configure LVM
|
||||
if _host_has_feature "lvm"; then
|
||||
install_lvm
|
||||
fi
|
||||
# Install the optional features if the host has the respective tooling
|
||||
for feature in "${!features[@]}"; do
|
||||
if _host_has_feature "$feature"; then
|
||||
"${features[$feature]}"
|
||||
fi
|
||||
done
|
||||
|
||||
for i in {0..127}; do
|
||||
dd if=/dev/zero of="${TESTDIR:?}/disk$i.img" bs=1M count=1
|
||||
|
Loading…
Reference in New Issue
Block a user