bf7a6c9580
- Rebase to 24.4 [RHEL-66254] - Resolves: RHEL-66254 ([RHEL-10] Rebase cloud-init to 24.4 version)
773 lines
27 KiB
Diff
773 lines
27 KiB
Diff
From aa64b67f0d62c78f7a879df4a09124fd82fc60ac Mon Sep 17 00:00:00 2001
|
|
From: Ani Sinha <anisinha@redhat.com>
|
|
Date: Wed, 13 Dec 2023 11:55:16 +0530
|
|
Subject: [PATCH] downstream: Setting autoconnect priority setting for
|
|
network-scripts
|
|
|
|
Changes for 24.1.2 (c10s):
|
|
- Fixed additional unit tests.
|
|
|
|
Changes for 23.4 (c9s):
|
|
|
|
Squashed the following three downstream only commits from RHEL 9.3:
|
|
|
|
Commit 1:
|
|
|
|
Setting highest autoconnect priority for network-scripts
|
|
|
|
RH-Author: Eduardo Otubo <otubo@redhat.com>
|
|
RH-MergeRequest: 22: Setting highest autoconnect priority for network-scripts
|
|
RH-Commit: [1/1] 34f1d62f8934a983a124df95b861a1e448681d3b (otubo/cloud-init-src)
|
|
RH-Bugzilla: 2036060
|
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
|
|
|
Set the highest autoconnect priority for network-scripts which is
|
|
loaded by NetworkManager ifcfg-rh plugin. Note that keyfile is the only
|
|
and default existing plugin on RHEL9, by setting the highest autoconnect
|
|
priority for network-scripts, NetworkManager will activate
|
|
network-scripts but keyfile. Network-scripts path:
|
|
|
|
Since this is a blocking issue, we decided to have this one-liner
|
|
downstream-only patch so we can move forward and have a better
|
|
NetworkManager support later on the release.
|
|
|
|
rhbz: 2036060
|
|
x-downstream-only: yes
|
|
|
|
Commit 2:
|
|
|
|
net/sysconfig: do not use the highest autoconnect priority
|
|
|
|
Using the highest priority is a very big hammer that we may not want to use. We
|
|
may want users to override the cloud init generated ifcfg files for custom
|
|
configuration of interfaces. If cloud init uses the highest priority, nothing
|
|
can beat it. Hence lower the priority to 120 allowing values from 121 to 999
|
|
to be used by users if they want to use a custom interface nm keyfile.
|
|
|
|
X-downstream-only: true
|
|
|
|
Suggested-by: thaller@redhat.com
|
|
fixes: c589da20eb92231 ("Setting highest autoconnect priority for network-scripts")
|
|
|
|
Commit 3:
|
|
|
|
test fixes: update tests to reflect AUTOCONNECT_PRIORITY setting
|
|
|
|
X-downstream-only: true
|
|
fixes: 0a2c6b6118ff ("net/sysconfig: do not use the highest autoconnect priority")
|
|
fixes: c589da20eb92 ("Setting highest autoconnect priority for network-scripts")
|
|
|
|
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
|
(cherry picked from commit 8a2fcbbcfdfc1df6f6c18f96588154f40083a239)
|
|
(cherry picked from commit 67e8d963161e5487b1bfcd775fde9f957d6488ea)
|
|
Signed-off-by: Cathy Avery <cavery@redhat.com>
|
|
---
|
|
cloudinit/net/sysconfig.py | 1 +
|
|
tests/unittests/cmd/devel/test_net_convert.py | 1 +
|
|
tests/unittests/distros/test_netconfig.py | 8 +++
|
|
tests/unittests/net/network_configs.py | 57 +++++++++++++++++++
|
|
tests/unittests/test_net.py | 18 ++++++
|
|
5 files changed, 85 insertions(+)
|
|
|
|
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
|
|
index d75012d26..2151db3ab 100644
|
|
--- a/cloudinit/net/sysconfig.py
|
|
+++ b/cloudinit/net/sysconfig.py
|
|
@@ -318,6 +318,7 @@ class Renderer(renderer.Renderer):
|
|
"ONBOOT": True,
|
|
"USERCTL": False,
|
|
"BOOTPROTO": "none",
|
|
+ "AUTOCONNECT_PRIORITY": 120,
|
|
},
|
|
"suse": {"BOOTPROTO": "static", "STARTMODE": "auto"},
|
|
}
|
|
diff --git a/tests/unittests/cmd/devel/test_net_convert.py b/tests/unittests/cmd/devel/test_net_convert.py
|
|
index 39e049227..ed970e413 100644
|
|
--- a/tests/unittests/cmd/devel/test_net_convert.py
|
|
+++ b/tests/unittests/cmd/devel/test_net_convert.py
|
|
@@ -60,6 +60,7 @@ DHCP=ipv4
|
|
SAMPLE_SYSCONFIG_CONTENT = """\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth0
|
|
ONBOOT=yes
|
|
diff --git a/tests/unittests/distros/test_netconfig.py b/tests/unittests/distros/test_netconfig.py
|
|
index b447757be..3768623f2 100644
|
|
--- a/tests/unittests/distros/test_netconfig.py
|
|
+++ b/tests/unittests/distros/test_netconfig.py
|
|
@@ -711,6 +711,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
expected_cfgs = {
|
|
self.ifcfg_path("eth0"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -724,6 +725,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
),
|
|
self.ifcfg_path("eth1"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth1
|
|
ONBOOT=yes
|
|
@@ -748,6 +750,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
expected_cfgs = {
|
|
self.ifcfg_path("eth0"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -763,6 +766,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
),
|
|
self.ifcfg_path("eth1"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth1
|
|
ONBOOT=yes
|
|
@@ -806,6 +810,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
expected_cfgs = {
|
|
self.ifcfg_path("eth0"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
HWADDR=00:16:3e:60:7c:df
|
|
@@ -818,6 +823,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
),
|
|
self.ifcfg_path("infra0"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=infra0
|
|
IPADDR=10.0.1.2
|
|
@@ -853,6 +859,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
expected_cfgs = {
|
|
self.ifcfg_path("eth0"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
IPADDR=192.10.1.2
|
|
@@ -864,6 +871,7 @@ class TestNetCfgDistroRedhat(TestNetCfgDistroBase):
|
|
),
|
|
self.ifcfg_path("eth0.1001"): dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0.1001
|
|
IPADDR=10.0.1.2
|
|
diff --git a/tests/unittests/net/network_configs.py b/tests/unittests/net/network_configs.py
|
|
index 6e870f6ed..dd0bf73d2 100644
|
|
--- a/tests/unittests/net/network_configs.py
|
|
+++ b/tests/unittests/net/network_configs.py
|
|
@@ -184,6 +184,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth1
|
|
HWADDR=cf:d6:af:48:e8:80
|
|
@@ -193,6 +194,7 @@ NETWORK_CONFIGS = {
|
|
),
|
|
"ifcfg-eth99": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEFROUTE=yes
|
|
DEVICE=eth99
|
|
@@ -357,6 +359,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth1
|
|
HWADDR=cf:d6:af:48:e8:80
|
|
@@ -366,6 +369,7 @@ NETWORK_CONFIGS = {
|
|
),
|
|
"ifcfg-eth99": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEFROUTE=yes
|
|
DEVICE=eth99
|
|
@@ -622,6 +626,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
IPADDR=192.168.14.2
|
|
@@ -738,6 +743,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
IPADDR=192.168.14.2
|
|
@@ -893,6 +899,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
DHCPV6C=yes
|
|
@@ -982,6 +989,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
DHCPV6C=yes
|
|
@@ -1057,6 +1065,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
DHCPV6C=yes
|
|
@@ -1123,6 +1132,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
IPV6_AUTOCONF=yes
|
|
@@ -1188,6 +1198,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
IPV6ADDR=2001:1::1/64
|
|
@@ -1246,6 +1257,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
DHCPV6C=yes
|
|
@@ -1332,6 +1344,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=iface0
|
|
DHCPV6C=yes
|
|
@@ -1378,6 +1391,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=iface0
|
|
ONBOOT=yes
|
|
@@ -1453,6 +1467,7 @@ NETWORK_CONFIGS = {
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-iface0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=iface0
|
|
ETHTOOL_OPTS="wol g"
|
|
@@ -1788,6 +1803,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-bond0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BONDING_OPTS="mode=active-backup """
|
|
"""xmit_hash_policy=layer3+4 """
|
|
@@ -1805,6 +1821,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-bond0.200": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=bond0.200
|
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
|
@@ -1816,6 +1833,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
"ifcfg-br0": textwrap.dedent(
|
|
"""\
|
|
AGEING=250
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=br0
|
|
@@ -1835,6 +1853,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
HWADDR=c0:d6:9f:2c:e8:80
|
|
@@ -1844,6 +1863,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth0.101": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0.101
|
|
@@ -1863,6 +1883,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth1
|
|
HWADDR=aa:d6:9f:2c:e8:80
|
|
@@ -1874,6 +1895,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth2": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth2
|
|
HWADDR=c0:bb:9f:2c:e8:80
|
|
@@ -1885,6 +1907,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth3": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth3
|
|
@@ -1895,6 +1918,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth4": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth4
|
|
@@ -1905,6 +1929,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth5": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth5
|
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
|
@@ -1915,6 +1940,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-ib0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=ib0
|
|
HWADDR=a0:00:02:20:fe:80:00:00:00:00:00:00:ec:0d:9a:03:00:15:e2:c1
|
|
@@ -2575,6 +2601,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
HWADDR=c0:d6:9f:2c:e8:80
|
|
@@ -2584,6 +2611,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth0.101": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0.101
|
|
@@ -2603,6 +2631,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth1
|
|
HWADDR=aa:d6:9f:2c:e8:80
|
|
@@ -2614,6 +2643,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth2": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth2
|
|
HWADDR=c0:bb:9f:2c:e8:80
|
|
@@ -2625,6 +2655,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth3": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth3
|
|
@@ -2635,6 +2666,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth4": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth4
|
|
@@ -2645,6 +2677,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-eth5": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth5
|
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
|
@@ -2655,6 +2688,7 @@ pre-down route del -net 10.0.0.0/8 gw 11.0.0.1 metric 3 || true
|
|
),
|
|
"ifcfg-ib0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=ib0
|
|
HWADDR=a0:00:02:20:fe:80:00:00:00:00:00:00:ec:0d:9a:03:00:15:e2:c1
|
|
@@ -3232,6 +3266,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-bond0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BONDING_OPTS="mode=active-backup miimon=100 """
|
|
"""downdelay=10 updelay=20 primary=bond0s0"
|
|
@@ -3258,6 +3293,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-bond0s0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=bond0s0
|
|
HWADDR=aa:bb:cc:dd:e8:00
|
|
@@ -3285,6 +3321,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-bond0s1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=bond0s1
|
|
HWADDR=aa:bb:cc:dd:e8:01
|
|
@@ -3585,6 +3622,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-bond0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BONDING_OPTS="mode=active-backup xmit_hash_policy=layer3+4 """
|
|
"""miimon=100 num_grat_arp=5 """
|
|
@@ -3615,6 +3653,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-bond0s0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=bond0s0
|
|
HWADDR=aa:bb:cc:dd:e8:00
|
|
@@ -3642,6 +3681,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-bond0s1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=bond0s1
|
|
HWADDR=aa:bb:cc:dd:e8:01
|
|
@@ -3789,6 +3829,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-en0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=en0
|
|
HWADDR=aa:bb:cc:dd:e8:00
|
|
@@ -3798,6 +3839,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-en0.99": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=en0.99
|
|
@@ -3924,6 +3966,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-en0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=en0
|
|
HWADDR=aa:bb:cc:dd:e8:00
|
|
@@ -3933,6 +3976,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-en0.99": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=en0.99
|
|
@@ -4098,6 +4142,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-br0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=br0
|
|
IPADDR=192.168.2.2
|
|
@@ -4111,6 +4156,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-eth0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth0
|
|
@@ -4126,6 +4172,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=br0
|
|
DEVICE=eth1
|
|
@@ -4313,6 +4360,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-eth0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
HWADDR=52:54:00:12:34:00
|
|
@@ -4325,6 +4373,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-eth1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth1
|
|
HWADDR=52:54:00:12:34:aa
|
|
@@ -4336,6 +4385,7 @@ iface bond0 inet6 static
|
|
),
|
|
"ifcfg-eth2": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth2
|
|
HWADDR=52:54:00:12:34:ff
|
|
@@ -4505,6 +4555,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=interface0
|
|
@@ -4583,6 +4634,7 @@ iface bond0 inet6 static
|
|
"expected_sysconfig_rhel": {
|
|
"ifcfg-eth0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
HWADDR=cf:d6:af:48:e8:80
|
|
@@ -4734,6 +4786,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eth0
|
|
DNS1=8.8.8.8
|
|
@@ -4945,6 +4998,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=baremetal
|
|
IPV6ADDR=fc00:1:1::2/64
|
|
@@ -4960,6 +5014,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=baremetal
|
|
DEVICE=baremetal0
|
|
@@ -4973,6 +5028,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=provisioning
|
|
IPV6ADDR=fc00:1:2::2/64
|
|
@@ -4988,6 +5044,7 @@ iface bond0 inet6 static
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
BRIDGE=provisioning
|
|
DEVICE=provisioning0
|
|
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
|
|
index 531302f70..d95ee2979 100644
|
|
--- a/tests/unittests/test_net.py
|
|
+++ b/tests/unittests/test_net.py
|
|
@@ -612,6 +612,7 @@ dns = none
|
|
"""
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -777,6 +778,7 @@ dns = none
|
|
"""
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -951,6 +953,7 @@ dns = none
|
|
"""
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -1074,6 +1077,7 @@ dns = none
|
|
"""
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -1266,6 +1270,7 @@ dns = none
|
|
"""
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -1934,6 +1939,7 @@ class TestRhelSysConfigRendering:
|
|
expected_content = """
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth1000
|
|
DHCPV6C=yes
|
|
@@ -2143,6 +2149,7 @@ USERCTL=no
|
|
expected = """\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=interface0
|
|
@@ -2172,6 +2179,7 @@ USERCTL=no
|
|
expected_i1 = """\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|
|
@@ -2188,6 +2196,7 @@ USERCTL=no
|
|
expected_i2 = """\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth1
|
|
DHCLIENT_SET_DEFAULT_ROUTE=no
|
|
@@ -2215,6 +2224,7 @@ USERCTL=no
|
|
expected = """\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eth0
|
|
ONBOOT=yes
|
|
@@ -2396,6 +2406,7 @@ USERCTL=no
|
|
"expected_sysconfig": {
|
|
"ifcfg-ens3": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=ens3
|
|
@@ -2442,6 +2453,7 @@ USERCTL=no
|
|
expected = {
|
|
"ifcfg-eno1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eno1
|
|
ONBOOT=yes
|
|
@@ -2451,6 +2463,7 @@ USERCTL=no
|
|
),
|
|
"ifcfg-eno1.1000": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEVICE=eno1.1000
|
|
IPADDR=192.6.1.9
|
|
@@ -2483,6 +2496,7 @@ USERCTL=no
|
|
expected = {
|
|
"ifcfg-bond0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BONDING_SLAVE0=enp0s0
|
|
BONDING_SLAVE1=enp0s1
|
|
@@ -2498,6 +2512,7 @@ USERCTL=no
|
|
),
|
|
"ifcfg-enp0s0": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BOOTPROTO=none
|
|
DEVICE=enp0s0
|
|
@@ -2510,6 +2525,7 @@ USERCTL=no
|
|
),
|
|
"ifcfg-enp0s1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BONDING_MASTER=yes
|
|
BOOTPROTO=none
|
|
DEVICE=enp0s1
|
|
@@ -2541,6 +2557,7 @@ USERCTL=no
|
|
expected = {
|
|
"ifcfg-eno1": textwrap.dedent(
|
|
"""\
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=dhcp
|
|
DEVICE=eno1
|
|
HWADDR=07-1c-c6-75-a4-be
|
|
@@ -2621,6 +2638,7 @@ USERCTL=no
|
|
"""\
|
|
# Created by cloud-init automatically, do not edit.
|
|
#
|
|
+ AUTOCONNECT_PRIORITY=120
|
|
BOOTPROTO=none
|
|
DEFROUTE=yes
|
|
DEVICE=eth0
|