Skip to content

Commit

Permalink
fix(dracut.sh): make omit-drivers option do exact match for names
Browse files Browse the repository at this point in the history
Modify the basic test case to use --omit-drivers and make it fail
without the PR and make it pass with the PR.

The test would fail with the following error without the PR:
FATAL: iscsiroot requested but kernel/initrd does not support iscsi
  • Loading branch information
LaszloGombos authored and johannbg committed Oct 24, 2022
1 parent cc1c0ff commit 444944a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ omit_drivers_corrected=""
for d in $omit_drivers; do
[[ " $drivers $add_drivers " == *\ $d\ * ]] && continue
[[ " $drivers $force_drivers " == *\ $d\ * ]] && continue
omit_drivers_corrected+="$d|"
omit_drivers_corrected+="^$d$|"
done
omit_drivers="${omit_drivers_corrected%|}"
unset omit_drivers_corrected
Expand Down
3 changes: 3 additions & 0 deletions test/TEST-01-BASIC/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ test_setup() {
inst_hook shutdown-emergency 000 ./hard-off.sh
inst_hook emergency 000 ./hard-off.sh
)

# make sure --omit-drivers does not filter out drivers using regexp to test for an earlier regression (assuming there is no one letter linux kernel module needed to run the test)
"$basedir"/dracut.sh -l -i "$TESTDIR"/overlay / \
-a "debug watchdog" \
-d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \
--omit-drivers 'a b c d e f g h i j k l m n o p q r s t u v w x y z' \
--no-hostonly-cmdline -N \
-f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
}
Expand Down

0 comments on commit 444944a

Please sign in to comment.