From 57c09150666cbde20a0e4c9efceace8074af2d26 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Sat, 22 Jun 2024 11:28:56 +0200 Subject: [PATCH] Make virtual device ports persistent connection check platform specific Limit to Fedora until the change gets to RHEL. On rhel8 the new behavior used to be present as a failure. --- bindtomac-bond-vlan-httpks.ks.in | 14 +++++++++++--- bindtomac-bond2-httpks.ks.in | 20 +++++++++++++++----- bindtomac-bond2-pre.ks.in | 20 +++++++++++++++----- bindtomac-bridge-2devs-httpks.ks.in | 14 +++++++++++--- bindtomac-bridge-2devs-pre.ks.in | 16 ++++++++++++++-- bindtomac-bridge-httpks.ks.in | 6 +++++- bond-vlan-httpks.ks.in | 14 +++++++++++--- bond-vlan-pre.ks.in | 14 +++++++++++--- bond2-httpks.ks.in | 20 +++++++++++++++----- bond2-pre.ks.in | 20 +++++++++++++++----- bridge-2devs-httpks.ks.in | 16 +++++++++++++--- bridge-2devs-pre.ks.in | 11 +++++++++-- bridge-2devs.ks.in | 11 +++++++++-- bridge-httpks.ks.in | 8 ++++++-- 14 files changed, 160 insertions(+), 44 deletions(-) diff --git a/bindtomac-bond-vlan-httpks.ks.in b/bindtomac-bond-vlan-httpks.ks.in index 7b85ab70..c400e208 100644 --- a/bindtomac-bond-vlan-httpks.ks.in +++ b/bindtomac-bond-vlan-httpks.ks.in @@ -28,6 +28,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ bond %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_config_value bond0.222 ONBOOT no connection autoconnect false check_device_config_value bond0 ONBOOT no connection autoconnect false @@ -46,9 +48,15 @@ check_device_config_bound_to_mac bond0_slave_2 # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bindtomac-bond2-httpks.ks.in b/bindtomac-bond2-httpks.ks.in index d3157031..9bf32251 100644 --- a/bindtomac-bond2-httpks.ks.in +++ b/bindtomac-bond2-httpks.ks.in @@ -31,6 +31,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST %post @KSINCLUDE@ post-lib-network.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" +@KSINCLUDE@ post-nochroot-lib-network.sh check_device_config_value bond0 ONBOOT no connection autoconnect false check_device_config_value bond0_slave_1 ONBOOT no connection autoconnect false @@ -49,11 +51,19 @@ check_device_connected bond1 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no -check_config_exists @KSTEST_NETDEV4@ no -check_config_exists @KSTEST_NETDEV5@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes + check_config_exists @KSTEST_NETDEV4@ yes + check_config_exists @KSTEST_NETDEV5@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no + check_config_exists @KSTEST_NETDEV4@ no + check_config_exists @KSTEST_NETDEV5@ no +fi check_device_config_bound_to_mac bond0_slave_1 check_device_config_bound_to_mac bond0_slave_2 diff --git a/bindtomac-bond2-pre.ks.in b/bindtomac-bond2-pre.ks.in index 23489139..063b76a3 100644 --- a/bindtomac-bond2-pre.ks.in +++ b/bindtomac-bond2-pre.ks.in @@ -33,6 +33,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST %post @KSINCLUDE@ post-lib-network.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" +@KSINCLUDE@ post-nochroot-lib-network.sh check_device_config_value bond0 ONBOOT no connection autoconnect false @@ -65,11 +67,19 @@ check_device_connected bond1 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no -check_config_exists @KSTEST_NETDEV4@ no -check_config_exists @KSTEST_NETDEV5@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes + check_config_exists @KSTEST_NETDEV4@ yes + check_config_exists @KSTEST_NETDEV5@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no + check_config_exists @KSTEST_NETDEV4@ no + check_config_exists @KSTEST_NETDEV5@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bindtomac-bridge-2devs-httpks.ks.in b/bindtomac-bridge-2devs-httpks.ks.in index 368ac07e..b2efe0d7 100644 --- a/bindtomac-bridge-2devs-httpks.ks.in +++ b/bindtomac-bridge-2devs-httpks.ks.in @@ -79,9 +79,17 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE # Configuration from boot options -check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no +if [ "${platform}" != "rhel8" ]; then + check_config_exists @KSTEST_NETDEV1@ yes +fi + +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no +fi check_device_config_bound_to_mac bridge0_slave_1 check_device_config_bound_to_mac bridge1_slave_1 diff --git a/bindtomac-bridge-2devs-pre.ks.in b/bindtomac-bridge-2devs-pre.ks.in index 85905cc2..20dd68e7 100644 --- a/bindtomac-bridge-2devs-pre.ks.in +++ b/bindtomac-bridge-2devs-pre.ks.in @@ -37,6 +37,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1 %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" # bridge0 @@ -75,8 +77,18 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no +# Configuration from boot options +if [ "${platform}" != "rhel8" ]; then + check_config_exists @KSTEST_NETDEV1@ yes +fi + +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no +fi check_device_config_bound_to_mac bridge0_slave_1 check_device_config_bound_to_mac bridge1_slave_1 diff --git a/bindtomac-bridge-httpks.ks.in b/bindtomac-bridge-httpks.ks.in index edf50064..4351a67e 100644 --- a/bindtomac-bridge-httpks.ks.in +++ b/bindtomac-bridge-httpks.ks.in @@ -38,6 +38,8 @@ fi %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_connected bridge0 yes check_device_connected @KSTEST_NETDEV1@ yes @@ -53,7 +55,9 @@ check_device_has_ipv4_address @KSTEST_NETDEV1@ no check_device_config_value bridge0 ONBOOT no connection autoconnect false check_device_config_value bridge0_slave_1 ONBOOT no connection autoconnect false # Configuration from boot options -check_config_exists @KSTEST_NETDEV1@ yes +if [ "${platform}" != "rhel8" ]; then + check_config_exists @KSTEST_NETDEV1@ yes +fi check_device_config_bound_to_mac bridge0_slave_1 diff --git a/bond-vlan-httpks.ks.in b/bond-vlan-httpks.ks.in index 75686f61..d281be48 100644 --- a/bond-vlan-httpks.ks.in +++ b/bond-vlan-httpks.ks.in @@ -28,6 +28,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ bond %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_config_value bond0.222 ONBOOT no connection autoconnect false check_device_config_value bond0 ONBOOT no connection autoconnect false @@ -43,9 +45,15 @@ check_device_has_ipv4_address bond0 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bond-vlan-pre.ks.in b/bond-vlan-pre.ks.in index e73148cd..c585060b 100644 --- a/bond-vlan-pre.ks.in +++ b/bond-vlan-pre.ks.in @@ -32,6 +32,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ bond %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_config_value bond0.222 ONBOOT no connection autoconnect false check_device_config_value bond0 ONBOOT no connection autoconnect false @@ -47,9 +49,15 @@ check_device_has_ipv4_address bond0 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bond2-httpks.ks.in b/bond2-httpks.ks.in index 4e1f7471..b0d6df71 100644 --- a/bond2-httpks.ks.in +++ b/bond2-httpks.ks.in @@ -31,6 +31,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_config_value bond0 ONBOOT no connection autoconnect false check_device_config_value bond0_slave_1 ONBOOT no connection autoconnect false @@ -49,11 +51,19 @@ check_device_connected bond1 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no -check_config_exists @KSTEST_NETDEV4@ no -check_config_exists @KSTEST_NETDEV5@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes + check_config_exists @KSTEST_NETDEV4@ yes + check_config_exists @KSTEST_NETDEV5@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no + check_config_exists @KSTEST_NETDEV4@ no + check_config_exists @KSTEST_NETDEV5@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bond2-pre.ks.in b/bond2-pre.ks.in index b817ee28..68b385c3 100644 --- a/bond2-pre.ks.in +++ b/bond2-pre.ks.in @@ -33,6 +33,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KST %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_config_value bond0 ONBOOT no connection autoconnect false @@ -60,11 +62,19 @@ check_device_connected bond1 no # Configuration from boot options check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no -check_config_exists @KSTEST_NETDEV3@ no -check_config_exists @KSTEST_NETDEV4@ no -check_config_exists @KSTEST_NETDEV5@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes + check_config_exists @KSTEST_NETDEV3@ yes + check_config_exists @KSTEST_NETDEV4@ yes + check_config_exists @KSTEST_NETDEV5@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no + check_config_exists @KSTEST_NETDEV3@ no + check_config_exists @KSTEST_NETDEV4@ no + check_config_exists @KSTEST_NETDEV5@ no +fi # No error was written to /root/RESULT file, everything is OK if [[ ! -e /root/RESULT ]]; then diff --git a/bridge-2devs-httpks.ks.in b/bridge-2devs-httpks.ks.in index c9a64ed4..3d74b84b 100644 --- a/bridge-2devs-httpks.ks.in +++ b/bridge-2devs-httpks.ks.in @@ -35,6 +35,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1 %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" # bridge0 @@ -77,9 +79,17 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE # Configuration from boot options -check_config_exists @KSTEST_NETDEV1@ yes -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no +if [ "${platform}" != "rhel8" ]; then + check_config_exists @KSTEST_NETDEV1@ yes +fi + +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no +fi # WARNING: this depends on assumption of running %post scripts in order they # are defined here diff --git a/bridge-2devs-pre.ks.in b/bridge-2devs-pre.ks.in index 063e9c29..6b75298c 100644 --- a/bridge-2devs-pre.ks.in +++ b/bridge-2devs-pre.ks.in @@ -37,6 +37,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1 %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" # bridge0 @@ -75,8 +77,13 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no +fi # WARNING: this depends on assumption of running %post scripts in order they # are defined here diff --git a/bridge-2devs.ks.in b/bridge-2devs.ks.in index d1afd4f2..4b35b5ef 100644 --- a/bridge-2devs.ks.in +++ b/bridge-2devs.ks.in @@ -35,6 +35,8 @@ check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1 %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" # bridge0 @@ -74,8 +76,13 @@ check_device_config_value bridge1 ONBOOT yes connection autoconnect __NONE check_device_config_value bridge1_slave_1 ONBOOT yes connection autoconnect __NONE -# Since RHEL-38451 don't create default persistent connection for ports/slaves -check_config_exists @KSTEST_NETDEV2@ no +if [ "${platform}" == "rhel9" ] || [ "${platform}" == "rhel10" ]; then + check_config_exists @KSTEST_NETDEV2@ yes +else + # RHEL-8-FAILURE: anaconda does not create default config file for enslaved device in RHEL8 + # Since RHEL-38451 don't create default persistent connection for ports/slaves + check_config_exists @KSTEST_NETDEV2@ no +fi # WARNING: this depends on assumption of running %post scripts in order they # are defined here diff --git a/bridge-httpks.ks.in b/bridge-httpks.ks.in index f4a77f56..b530f763 100644 --- a/bridge-httpks.ks.in +++ b/bridge-httpks.ks.in @@ -39,6 +39,8 @@ fi %post @KSINCLUDE@ post-lib-network.sh +@KSINCLUDE@ scripts-lib.sh +platform="$(get_platform @KSTEST_OS_NAME@ @KSTEST_OS_VERSION@)" check_device_connected bridge0 yes check_device_connected @KSTEST_NETDEV1@ yes @@ -53,9 +55,11 @@ check_device_has_ipv4_address @KSTEST_NETDEV1@ no check_device_config_value bridge0 ONBOOT no connection autoconnect false check_device_config_value bridge0_slave_1 ONBOOT no connection autoconnect false -# Configuration from boot options -check_config_exists @KSTEST_NETDEV1@ yes +# Configuration from boot options +if [ "${platform}" != "rhel8" ]; then + check_config_exists @KSTEST_NETDEV1@ yes +fi # WARNING: this depends on assumption of running %post scripts in order they # are defined here