Skip to content

Commit

Permalink
Make virtual device ports persistent connection check platform specific
Browse files Browse the repository at this point in the history
Limit to Fedora until the change gets to RHEL.
On rhel8 the new behavior used to be present as a failure.
  • Loading branch information
rvykydal committed Jun 23, 2024
1 parent 8b2c651 commit 57c0915
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 44 deletions.
14 changes: 11 additions & 3 deletions bindtomac-bond-vlan-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions bindtomac-bond2-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions bindtomac-bond2-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions bindtomac-bridge-2devs-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions bindtomac-bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion bindtomac-bridge-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
14 changes: 11 additions & 3 deletions bond-vlan-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
14 changes: 11 additions & 3 deletions bond-vlan-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions bond2-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 15 additions & 5 deletions bond2-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions bridge-2devs-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions bridge-2devs.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions bridge-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 57c0915

Please sign in to comment.