diff --git a/fixtures/customize/dest.bu b/fixtures/customize/dest.bu index 1e17035c9..139ee4c1b 100644 --- a/fixtures/customize/dest.bu +++ b/fixtures/customize/dest.bu @@ -9,10 +9,10 @@ systemd: Description=Dest Ignition Applied Before=multi-user.target ConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth1.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth2.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth1.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth2.nmconnection ConditionKernelCommandLine=install-config-karg-1 ConditionKernelCommandLine=install-config-karg-2 ConditionKernelCommandLine=dest-karg @@ -23,7 +23,7 @@ systemd: [Service] Type=oneshot RemainAfterExit=true - ExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/grub.cfg + ExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/console.cfg ExecStart=/bin/echo @applied-dest-ign@ StandardOutput=tty diff --git a/fixtures/customize/dest.ign b/fixtures/customize/dest.ign index fa60b6a83..2f8f45852 100644 --- a/fixtures/customize/dest.ign +++ b/fixtures/customize/dest.ign @@ -5,7 +5,7 @@ "systemd": { "units": [ { - "contents": "[Unit]\nDescription=Dest Ignition Applied\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection\nConditionKernelCommandLine=install-config-karg-1\nConditionKernelCommandLine=install-config-karg-2\nConditionKernelCommandLine=dest-karg\nConditionKernelCommandLine=!ignition.platform.id=metal\nConditionKernelCommandLine=ignition.platform.id=qemu\nConditionKernelCommandLine=console=ttyS0,115200n8\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/grub.cfg\nExecStart=/bin/echo @applied-dest-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=multi-user.target\n", + "contents": "[Unit]\nDescription=Dest Ignition Applied\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth2.nmconnection\nConditionKernelCommandLine=install-config-karg-1\nConditionKernelCommandLine=install-config-karg-2\nConditionKernelCommandLine=dest-karg\nConditionKernelCommandLine=!ignition.platform.id=metal\nConditionKernelCommandLine=ignition.platform.id=qemu\nConditionKernelCommandLine=console=ttyS0,115200n8\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/grep -qz 'serial --unit=0 --speed=115200 --word=8 --parity=no.terminal_input serial.terminal_output serial.#' /boot/grub2/console.cfg\nExecStart=/bin/echo @applied-dest-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=multi-user.target\n", "enabled": true, "name": "dest-ignition-applied.service" } diff --git a/fixtures/customize/installer-test-nmstate-json.json b/fixtures/customize/installer-test-nmstate-json.json index a0bd86bcc..94dbc13f6 100644 --- a/fixtures/customize/installer-test-nmstate-json.json +++ b/fixtures/customize/installer-test-nmstate-json.json @@ -1,7 +1,7 @@ { "interfaces": [ { - "name": "nmstate-json-eth1", + "name": "nmstate-js-eth1", "type": "ethernet", "state": "up", "ipv4": { @@ -10,7 +10,7 @@ } }, { - "name": "nmstate-json-eth2", + "name": "nmstate-js-eth2", "type": "ethernet", "state": "up", "ipv4": { diff --git a/fixtures/customize/installer-test-nmstate-yaml.yaml b/fixtures/customize/installer-test-nmstate-yaml.yaml index d993d26d5..ffb29f3df 100644 --- a/fixtures/customize/installer-test-nmstate-yaml.yaml +++ b/fixtures/customize/installer-test-nmstate-yaml.yaml @@ -1,11 +1,11 @@ interfaces: - - name: nmstate-yaml-eth1 + - name: nmstate-yl-eth1 type: ethernet state: up ipv4: enabled: true dhcp: true - - name: nmstate-yaml-eth2 + - name: nmstate-yl-eth2 type: ethernet state: up ipv4: diff --git a/fixtures/customize/live.bu b/fixtures/customize/live.bu index 1845f7406..253d4c216 100644 --- a/fixtures/customize/live.bu +++ b/fixtures/customize/live.bu @@ -10,10 +10,10 @@ systemd: Before=coreos-installer.target Before=multi-user.target ConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection - ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth1.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth2.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth1.nmconnection + ConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth2.nmconnection [Service] Type=oneshot diff --git a/fixtures/customize/live.ign b/fixtures/customize/live.ign index 57905ff74..d813129c1 100644 --- a/fixtures/customize/live.ign +++ b/fixtures/customize/live.ign @@ -5,7 +5,7 @@ "systemd": { "units": [ { - "contents": "[Unit]\nDescription=Live Ignition Applied\nBefore=coreos-installer.target\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-json-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yaml-eth2.nmconnection\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/echo @applied-live-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=coreos-installer.target\nRequiredBy=multi-user.target\n", + "contents": "[Unit]\nDescription=Live Ignition Applied\nBefore=coreos-installer.target\nBefore=multi-user.target\nConditionPathExists=/etc/NetworkManager/system-connections/installer-test.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-js-eth2.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth1.nmconnection\nConditionPathExists=/etc/NetworkManager/system-connections/nmstate-yl-eth2.nmconnection\n\n[Service]\nType=oneshot\nRemainAfterExit=true\nExecStart=/bin/echo @applied-live-ign@\nStandardOutput=tty\n\n[Install]\nRequiredBy=coreos-installer.target\nRequiredBy=multi-user.target\n", "enabled": true, "name": "live-ignition-applied.service" }, diff --git a/fixtures/customize/nmstate-json-eth1.nmconnection b/fixtures/customize/nmstate-js-eth1.nmconnection similarity index 100% rename from fixtures/customize/nmstate-json-eth1.nmconnection rename to fixtures/customize/nmstate-js-eth1.nmconnection diff --git a/fixtures/customize/nmstate-json-eth2.nmconnection b/fixtures/customize/nmstate-js-eth2.nmconnection similarity index 69% rename from fixtures/customize/nmstate-json-eth2.nmconnection rename to fixtures/customize/nmstate-js-eth2.nmconnection index f2fcda14b..822f79270 100644 --- a/fixtures/customize/nmstate-json-eth2.nmconnection +++ b/fixtures/customize/nmstate-js-eth2.nmconnection @@ -1,5 +1,5 @@ [connection] -id=nmstate-json-eth2 +id=nmstate-js-eth2 type=ethernet [ipv4] diff --git a/fixtures/customize/nmstate-yaml-eth1.nmconnection b/fixtures/customize/nmstate-yl-eth1.nmconnection similarity index 69% rename from fixtures/customize/nmstate-yaml-eth1.nmconnection rename to fixtures/customize/nmstate-yl-eth1.nmconnection index b08878065..7f6c4128b 100644 --- a/fixtures/customize/nmstate-yaml-eth1.nmconnection +++ b/fixtures/customize/nmstate-yl-eth1.nmconnection @@ -1,5 +1,5 @@ [connection] -id=nmstate-yaml-eth1 +id=nmstate-yl-eth1 type=ethernet [ipv4] diff --git a/fixtures/customize/nmstate-yaml-eth2.nmconnection b/fixtures/customize/nmstate-yl-eth2.nmconnection similarity index 69% rename from fixtures/customize/nmstate-yaml-eth2.nmconnection rename to fixtures/customize/nmstate-yl-eth2.nmconnection index b3d472b06..63387cf75 100644 --- a/fixtures/customize/nmstate-yaml-eth2.nmconnection +++ b/fixtures/customize/nmstate-yl-eth2.nmconnection @@ -1,5 +1,5 @@ [connection] -id=nmstate-yaml-eth2 +id=nmstate-yl-eth2 type=ethernet [ipv4] diff --git a/tests/images/customize.sh b/tests/images/customize.sh index 61dc15be9..d03309184 100755 --- a/tests/images/customize.sh +++ b/tests/images/customize.sh @@ -145,28 +145,44 @@ qemu_disk() { } assert() { - grep -Fq "$1" log + if grep -Fq "$1" log; then + echo "Assertion passed: '$1' found in log" + return 0 + else + echo "Assertion failed: '$1' not found in log" + return 1 + fi +} + +assert_not() { + if grep -Fq "$1" log; then + echo "Assertion failed: '$1' found in log" + return 1 + else + echo "Assertion passed: '$1' not found in log" + return 0 + fi } check_live_noinstall() { assert @applied-live-ign@ assert @applied-live-2-ign@ - ! assert @applied-dest-ign@ - ! assert @applied-dest-2-ign@ + assert_not @applied-dest-ign@ + assert_not @applied-dest-2-ign@ assert @did-not-install@ - ! assert @preinst-1@ - ! assert @preinst-2@ - ! assert @postinst-1@ - ! assert @postinst-2@ + assert_not @preinst-1@ + assert_not @preinst-2@ + assert_not @postinst-1@ + assert_not @postinst-2@ assert 'Adding "coreos-installer test certificate" to list of CAs' } check_live_install() { assert @applied-live-ign@ assert @applied-live-2-ign@ - ! assert @applied-dest-ign@ - ! assert @applied-dest-2-ign@ - ! assert @did-not-install@ + assert_not @applied-dest-ign@ + assert_not @applied-dest-2-ign@ + assert_not @did-not-install@ assert @preinst-1@ assert @preinst-2@ assert @postinst-1@ @@ -175,14 +191,14 @@ check_live_install() { } check_dest() { - ! assert @applied-live-ign@ - ! assert @applied-live-2-ign@ + assert_not @applied-live-ign@ + assert_not @applied-live-2-ign@ assert @applied-dest-ign@ assert @applied-dest-2-ign@ - ! assert @preinst-1@ - ! assert @preinst-2@ - ! assert @postinst-1@ - ! assert @postinst-2@ + assert_not @preinst-1@ + assert_not @preinst-2@ + assert_not @postinst-1@ + assert_not @postinst-2@ assert 'Adding "coreos-installer test certificate" to list of CAs' } @@ -278,19 +294,19 @@ coreos-installer pxe customize src-initrd -o initrd --network-keyfile "${fixtures}/installer-test.nmconnection" 2>&1 ||:) | grepq "already specifies keyfile" (iso_customize \ - --network-keyfile "${fixtures}/nmstate-json-eth1.nmconnection" \ + --network-keyfile "${fixtures}/nmstate-js-eth1.nmconnection" \ --network-nmstate "${fixtures}/installer-test-nmstate-json.json" 2>&1 ||:) | grepq "already specifies keyfile" (iso_customize \ - --network-keyfile "${fixtures}/nmstate-json-eth2.nmconnection" \ + --network-keyfile "${fixtures}/nmstate-js-eth2.nmconnection" \ --network-nmstate "${fixtures}/installer-test-nmstate-json.json" 2>&1 ||:) | grepq "already specifies keyfile" (iso_customize \ - --network-keyfile "${fixtures}/nmstate-yaml-eth1.nmconnection" \ + --network-keyfile "${fixtures}/nmstate-yl-eth1.nmconnection" \ --network-nmstate "${fixtures}/installer-test-nmstate-yaml.yaml" 2>&1 ||:) | grepq "already specifies keyfile" (iso_customize \ - --network-keyfile "${fixtures}/nmstate-yaml-eth2.nmconnection" \ + --network-keyfile "${fixtures}/nmstate-yl-eth2.nmconnection" \ --network-nmstate "${fixtures}/installer-test-nmstate-yaml.yaml" 2>&1 ||:) | grepq "already specifies keyfile" (iso_customize \