-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coreos-teardown-initramfs: account for BOOTIF kernel argument
`nm-initrd-generator` will take into account the `BOOTIF=` kernel argument. Let's account for that in our `propagate_initramfs_networking()` code so don't propagate networking config if `BOOTIF` is the only networking config. Fixes coreos/fedora-coreos-tracker#1048
- Loading branch information
Showing
4 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/kola/networking/no-default-initramfs-net-propagation/bootif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# kola: { "platforms": "qemu", "appendFirstbootKernelArgs": "BOOTIF=52:54:00:12:34:56" } | ||
# | ||
# In addition to the pure network defaults case we should also make | ||
# sure that when BOOTIF= or rd.bootif= are provided on the kernel | ||
# command line (typically from PXE servers) that we don't propagate | ||
# networking configs either. See https://github.com/coreos/fedora-coreos-tracker/issues/1048 | ||
# | ||
# - platforms: qemu | ||
# - This test should pass everywhere if it passes anywhere. | ||
# - appendFirstbootKernelArgs: "BOOTIF=52:54:00:12:34:56" | ||
# - Append BOOTIF kernel argument so we can test how nm-initrd-generator | ||
# and the coreos-teardown-initramfs interact. The MAC address is from: | ||
# https://github.com/coreos/coreos-assembler/blob/d5f1623aad6d133b2c7c00e784c04ab6828450c1/mantle/platform/metal.go#L468 | ||
|
||
|
||
set -xeuo pipefail | ||
|
||
. $KOLA_EXT_DATA/commonlib.sh | ||
|
||
# Run the test bits (sets the $fail var) | ||
. $KOLA_EXT_DATA/test-net-propagation.sh | ||
|
||
if [ -z "${fail:-}" ]; then | ||
ok "success: no initramfs network propagation for default configuration with BOOTIF" | ||
else | ||
fatal "fail: no initramfs network propagation for default configuration with BOOTIF" | ||
fi |
12 changes: 12 additions & 0 deletions
12
tests/kola/networking/no-default-initramfs-net-propagation/data/test-net-propagation.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# common pieces of each of the no-default-initramfs-net-propagation tests | ||
if ! journalctl -t coreos-teardown-initramfs | \ | ||
grep 'info: skipping propagation of default networking configs'; then | ||
echo "no log message claiming to skip initramfs network propagation" >&2 | ||
fail=1 | ||
fi | ||
|
||
if [ -n "$(ls -A /etc/NetworkManager/system-connections/)" ]; then | ||
echo "configs exist in /etc/NetworkManager/system-connections/, but shouldn't" >&2 | ||
fail=1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters