Skip to content

Commit

Permalink
network: use detection of autoconnections instead of os name
Browse files Browse the repository at this point in the history
  • Loading branch information
rvykydal committed Aug 30, 2019
1 parent 6f5eff3 commit b3fe6b7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
7 changes: 5 additions & 2 deletions bindtomac-bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ shutdown

@KSINCLUDE@ post-nochroot-lib-network.sh

pass_autoconnections_info_to_chroot

check_bridge_has_slave_nochroot bridge0 @KSTEST_NETDEV1@ yes
check_bridge_has_slave_nochroot bridge1 @KSTEST_NETDEV2@ yes
check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1
Expand Down Expand Up @@ -58,11 +60,12 @@ check_device_ifcfg_value bridge0_slave_1 ONBOOT no

check_device_connected bridge1 no

if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_connected @KSTEST_NETDEV2@ no
check_device_has_ipv4_address @KSTEST_NETDEV2@ no
else
# On Fedora NM automatically activates devices without ifcfgs with default connection
check_device_connected @KSTEST_NETDEV2@ yes
fi

Expand Down
7 changes: 5 additions & 2 deletions bridge-2devs-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ shutdown

@KSINCLUDE@ post-nochroot-lib-network.sh

pass_autoconnections_info_to_chroot

check_bridge_has_slave_nochroot bridge0 @KSTEST_NETDEV1@ yes
check_bridge_has_slave_nochroot bridge1 @KSTEST_NETDEV2@ yes
check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ bridge0 bridge1
Expand Down Expand Up @@ -58,11 +60,12 @@ check_device_ifcfg_value bridge0_slave_1 ONBOOT no

check_device_connected bridge1 no

if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_connected @KSTEST_NETDEV2@ no
check_device_has_ipv4_address @KSTEST_NETDEV2@ no
else
# On Fedora NM automatically activates devices without ifcfgs with default connection
check_device_connected @KSTEST_NETDEV2@ yes
fi

Expand Down
9 changes: 7 additions & 2 deletions network-missing-ifcfg-httpks.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ shutdown

@KSINCLUDE@ post-nochroot-lib-network.sh

pass_autoconnections_info_to_chroot

check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@

%end
Expand All @@ -34,12 +36,15 @@ check_device_ifcfg_value @KSTEST_NETDEV1@ ONBOOT yes
check_ifcfg_key_exists @KSTEST_NETDEV1@ HWADDR no
check_device_connected @KSTEST_NETDEV1@ yes

# @KSTEST_NETDEV2@ is configured neigher via boot options nor via kickstart so anaconda
# @KSTEST_NETDEV2@ is configured neither via boot options nor via kickstart so anaconda
# creates default ifcfg file (rhel) or dumps it from default connection created
# by NM on Fedora
check_device_ifcfg_value @KSTEST_NETDEV2@ DEVICE @KSTEST_NETDEV2@
check_ifcfg_key_exists @KSTEST_NETDEV2@ HWADDR no
if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then

detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_ifcfg_value @KSTEST_NETDEV2@ ONBOOT no
check_device_connected @KSTEST_NETDEV2@ no
else
Expand Down
6 changes: 5 additions & 1 deletion network-static-2-pre.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ shutdown

@KSINCLUDE@ post-nochroot-lib-network.sh

pass_autoconnections_info_to_chroot

check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@ @KSTEST_NETDEV4@ @KSTEST_NETDEV5@

%end
Expand All @@ -56,7 +58,9 @@ check_device_connected @KSTEST_NETDEV4@ yes
check_device_ipv4_address @KSTEST_NETDEV4@ @KSTEST_STATIC_IP3@

check_device_ifcfg_value @KSTEST_NETDEV5@ IPADDR @KSTEST_STATIC_IP4@
if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_connected @KSTEST_NETDEV5@ no
else
# Fedora autoactivates default connections (Wired Connection 2)
Expand Down
6 changes: 5 additions & 1 deletion onboot-activate.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ shutdown

@KSINCLUDE@ post-nochroot-lib-network.sh

pass_autoconnections_info_to_chroot

check_gui_configurations @KSTEST_NETDEV1@ @KSTEST_NETDEV2@ @KSTEST_NETDEV3@

%end
Expand All @@ -35,7 +37,9 @@ check_device_ifcfg_value @KSTEST_NETDEV1@ ONBOOT no
check_device_ifcfg_value @KSTEST_NETDEV2@ ONBOOT yes
check_device_ifcfg_value @KSTEST_NETDEV3@ ONBOOT no

if [[ "@KSTEST_OS_NAME@" == "rhel" ]]; then
detect_nm_has_autoconnections_off
nm_has_autoconnections_off=$?
if [[ $nm_has_autoconnections_off -eq 0 ]]; then
check_device_connected @KSTEST_NETDEV2@ no
else
# On Fedora, default autoconnection "Wired connection 1" is activated
Expand Down

0 comments on commit b3fe6b7

Please sign in to comment.