Always generate network ifcfg files with label
During dual-stack (IPv4 and IPv6) network testing, it was observed that traffic on the primary address family (e.g., IPv4) was interrupted when the secondary address pool (e.g., IPv6) was configured in Linux. This issue stemmed from how StarlingX manipulated ifcfg files. When an interface configuration file contained only one address family, the final file used lacked a label. However, for dual-stack configurations, a separate labeled file was generated for the same interface. This behavior caused problems when apply_network_config.h script executed. It compares the contents of /etc/network/interface.d/ with the configuration provided by Puppet. Since the files differed due to the missing label in the single-address case, the script triggered an unnecessary ifdown operation on the entire interface, not just the labels, leading to traffic interruption. PXE boot interfaces are an exception to the labeling requirement as MTCE relies on the filename during boot to extract information. Therefore, when a PXE boot interface is the only network configured on an interface, no label is generated. This is acceptable because PXE boot typically uses IPv4 (single-stack) and doesn't encounter the dual-stack labeling issue. Test Plan [PASS] Install AIO-SX in single-stack and then add dual-stack config for OAM network in runtime and observe that there is no traffic interruption as the secondary address is added [PASS] Install AIO-DX in single-stack with the following variants: - ethernet port with {mgmt, cluster-host, pxeboot} networks - ethernet port with pxeboot and vlan with {mgmt, cluster-host} networks - bonding port with {mgmt, cluster-host, pxeboot} networks - bonding port with pxeboot and vlan with {mgmt, cluster-host} networks Story: 2011027 Task: 50054 Change-Id: I8df423a428c7a853b65f7b448f4c0740f7e72321 Signed-off-by: Andre Kantek <andrefernandozanella.kantek@windriver.com>
This commit is contained in:
parent
dba272121f
commit
cf53d1c3e7
|
@ -1547,7 +1547,9 @@ def process_interface_labels(config, context):
|
|||
#
|
||||
# Rules for label adjustment:
|
||||
# 1) if the interface have just one label:
|
||||
# - move the content of label to interface
|
||||
# - keep the label as it can receive dual-stack configuration later
|
||||
# - if part of pxeboot network, move the content of label to interface,
|
||||
# keeping compatibility with MTCE operation (pxeboot is single-stack only)
|
||||
# 2) if the interface have more that one label
|
||||
# - if the family is inet
|
||||
# - just keep the labeling
|
||||
|
@ -1585,10 +1587,14 @@ def process_interface_labels(config, context):
|
|||
|
||||
if len(label_map[intf]) == 1:
|
||||
label = next(iter(label_map[intf]))
|
||||
merge_interface_operations(config, intf, label)
|
||||
# replace the base interface with the labeled one
|
||||
config[NETWORK_CONFIG_RESOURCE][intf] = config[NETWORK_CONFIG_RESOURCE][label]
|
||||
del config[NETWORK_CONFIG_RESOURCE][label]
|
||||
if 'options' in config[NETWORK_CONFIG_RESOURCE][label].keys():
|
||||
options = config[NETWORK_CONFIG_RESOURCE][label]['options']
|
||||
if ('stx-description' in options.keys()):
|
||||
if (f"net:{constants.NETWORK_TYPE_PXEBOOT}" in options['stx-description']):
|
||||
merge_interface_operations(config, intf, label)
|
||||
# replace the base interface with the labeled one
|
||||
config[NETWORK_CONFIG_RESOURCE][intf] = config[NETWORK_CONFIG_RESOURCE][label]
|
||||
del config[NETWORK_CONFIG_RESOURCE][label]
|
||||
|
||||
elif len(label_map[intf]) > 1:
|
||||
|
||||
|
|
|
@ -2293,6 +2293,7 @@ class InterfaceHostTestCase(InterfaceTestCaseMixin, dbbase.BaseHostTestCase):
|
|||
def test_generate_interface_config_ifupdown(self):
|
||||
hieradata_directory = self._create_hieradata_directory()
|
||||
config_filename = self._get_config_filename(hieradata_directory)
|
||||
print(config_filename)
|
||||
with open(config_filename, 'w') as config_file:
|
||||
config = self.operator.interface.get_host_config(self.host) # pylint: disable=no-member
|
||||
self.assertIsNotNone(config)
|
||||
|
@ -2301,6 +2302,7 @@ class InterfaceHostTestCase(InterfaceTestCaseMixin, dbbase.BaseHostTestCase):
|
|||
def test_interface_config_yaml_data_validation(self):
|
||||
hieradata_directory = self._create_hieradata_directory()
|
||||
config_filename = self._get_config_filename(hieradata_directory)
|
||||
print(config_filename)
|
||||
with open(config_filename, 'w') as config_file:
|
||||
config = self.operator.interface.get_host_config(self.host) # pylint: disable=no-member
|
||||
self.assertIsNotNone(config)
|
||||
|
@ -2464,7 +2466,10 @@ class InterfaceControllerEthernet(InterfaceHostTestCase):
|
|||
self.expected_bmc_interface = 'mgmt'
|
||||
self.expected_platform_interfaces = ['oam', 'mgmt', 'cluster-host']
|
||||
self.exp_yaml_config = {
|
||||
"eth0": {'family': 'inet', 'method': 'static',
|
||||
"eth0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam,net:{None}',
|
||||
'tc': False},
|
||||
"eth0:3-11": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:oam,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2475,7 +2480,11 @@ class InterfaceControllerEthernet(InterfaceHostTestCase):
|
|||
"eth1:2-7": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"eth2": {'family': 'inet', 'method': 'static',
|
||||
"eth2": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': 'ifname:cluster-host,'
|
||||
f'net:{None}',
|
||||
'tc': False},
|
||||
"eth2:4-15": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': 'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -2508,7 +2517,10 @@ class InterfaceControllerEthernetCfg2(InterfaceHostTestCase):
|
|||
self.expected_bmc_interface = 'mgmt0'
|
||||
self.expected_platform_interfaces = ['oam0', 'mgmt0']
|
||||
self.exp_yaml_config = {
|
||||
"eth0": {'family': 'inet', 'method': 'static',
|
||||
"eth0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam0,net:{None}',
|
||||
'tc': False},
|
||||
"eth0:3-11": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:oam0,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2553,7 +2565,10 @@ class InterfaceControllerEthernetCfg3(InterfaceHostTestCase):
|
|||
self.expected_bmc_interface = 'mgmt0'
|
||||
self.expected_platform_interfaces = ['oam0', 'mgmt0']
|
||||
self.exp_yaml_config = {
|
||||
"eth0": {'family': 'inet', 'method': 'static',
|
||||
"eth0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam0,net:{None}',
|
||||
'tc': False},
|
||||
"eth0:3-11": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:oam0,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2617,7 +2632,10 @@ class InterfaceControllerBond(InterfaceHostTestCase):
|
|||
'stx-description': f'ifname:eth6,net:{None}', 'tc': False},
|
||||
"eth5": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:eth7,net:{None}', 'tc': False},
|
||||
"oam0": {'family': 'inet', 'method': 'static',
|
||||
"oam0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam0,net:{None}',
|
||||
'tc': False},
|
||||
"oam0:3-11": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:oam0,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"mgmt0": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2628,7 +2646,11 @@ class InterfaceControllerBond(InterfaceHostTestCase):
|
|||
"mgmt0:2-7": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt0,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"cluster-host0": {'family': 'inet', 'method': 'static',
|
||||
"cluster-host0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': 'ifname:cluster-host0,'
|
||||
f'net:{None}',
|
||||
'tc': False},
|
||||
"cluster-host0:4-15": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': 'ifname:cluster-host0,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -2675,13 +2697,22 @@ class InterfaceControllerVlanOverBond(InterfaceHostTestCase):
|
|||
"pxeboot0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:pxeboot0,net:{constants.NETWORK_TYPE_PXEBOOT}',
|
||||
'tc': False},
|
||||
"vlan1": {'family': 'inet', 'method': 'static',
|
||||
"vlan1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam0,net:{None}',
|
||||
'tc': False},
|
||||
"vlan1:3-11": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:oam0,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"vlan2": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt0,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
"vlan2": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:mgmt0,net:{None}',
|
||||
'tc': True},
|
||||
"vlan3": {'family': 'inet', 'method': 'static',
|
||||
"vlan2:2-7": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt0,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"vlan3": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host0,net:{None}',
|
||||
'tc': False},
|
||||
"vlan3:4-15": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': 'ifname:cluster-host0,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -2774,7 +2805,10 @@ class InterfaceComputeEthernet(InterfaceHostTestCase):
|
|||
"eth0:2-37": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'static',
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{None}', 'tc': False},
|
||||
"eth1:4-38": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}', 'tc': False},
|
||||
"eth3": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2844,7 +2878,10 @@ class InterfaceComputeEthernetCfg2(InterfaceHostTestCase):
|
|||
"eth0:2-37": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'static',
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{None}', 'tc': False},
|
||||
"eth1:4-38": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}', 'tc': False},
|
||||
"eth3": {'family': 'inet', 'method': 'manual',
|
||||
|
@ -2906,9 +2943,12 @@ class InterfaceComputeEthernetCfg3(InterfaceHostTestCase):
|
|||
self.expected_slave_interfaces = []
|
||||
self.expected_mlx_interfaces = ['mlx5']
|
||||
self.exp_yaml_config = {
|
||||
"eth0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
"eth0": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:mgmt,net:{None}',
|
||||
'tc': True},
|
||||
"eth0:2-37": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,net:{None}', 'tc': False},
|
||||
"eth1:1": {'family': 'inet', 'method': 'dhcp',
|
||||
|
@ -2964,10 +3004,17 @@ class InterfaceComputeVlanOverEthernet(InterfaceHostTestCase):
|
|||
'tc': False},
|
||||
"eth1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:eth2,net:{None}', 'tc': False},
|
||||
"vlan2": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
"vlan2": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:mgmt,net:{None}',
|
||||
'tc': True},
|
||||
"vlan3": {'family': 'inet', 'method': 'static',
|
||||
"vlan2:2-0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"vlan3": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{None}',
|
||||
'tc': False},
|
||||
"vlan3:4-0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -3124,7 +3171,11 @@ class InterfaceComputeBond(InterfaceHostTestCase):
|
|||
'stx-description': f'ifname:eth3,net:{None}', 'tc': False},
|
||||
"eth3": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:eth4,net:{None}', 'tc': False},
|
||||
"cluster-host": {'family': 'inet', 'method': 'static',
|
||||
"cluster-host": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{None}',
|
||||
'tc': False},
|
||||
"cluster-host:4-38": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -3180,13 +3231,23 @@ class InterfaceComputeVlanOverBond(InterfaceHostTestCase):
|
|||
"pxeboot": {'family': 'inet', 'method': 'dhcp',
|
||||
'stx-description': f'ifname:pxeboot,net:{constants.NETWORK_TYPE_PXEBOOT}',
|
||||
'tc': False},
|
||||
"vlan1": {'family': 'inet', 'method': 'dhcp',
|
||||
"vlan1": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:oam,net:{None}',
|
||||
'tc': False},
|
||||
"vlan1:3-0": {'family': 'inet', 'method': 'dhcp',
|
||||
'stx-description': f'ifname:oam,net:{constants.NETWORK_TYPE_OAM}',
|
||||
'tc': False},
|
||||
"vlan2": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
"vlan2": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:mgmt,net:{None}',
|
||||
'tc': True},
|
||||
"vlan3": {'family': 'inet', 'method': 'static',
|
||||
"vlan2:2-0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:mgmt,net:{constants.NETWORK_TYPE_MGMT}',
|
||||
'tc': False},
|
||||
"vlan3": {'family': 'inet', 'method': 'manual',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{None}',
|
||||
'tc': False},
|
||||
"vlan3:4-0": {'family': 'inet', 'method': 'static',
|
||||
'stx-description': f'ifname:cluster-host,'
|
||||
f'net:{constants.NETWORK_TYPE_CLUSTER_HOST}',
|
||||
'tc': False},
|
||||
|
@ -4036,8 +4097,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
self._add_ethernet('oam0', constants.INTERFACE_CLASS_PLATFORM, constants.NETWORK_TYPE_OAM)
|
||||
expected = {
|
||||
'oam0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4, DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_OAM, FAMILY: INET, METHOD: STATIC,
|
||||
|
@ -4070,9 +4130,8 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
|
@ -4081,7 +4140,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
|
@ -4195,14 +4254,13 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {ALLOW: True, 'bond-master': True, PRE_UP: [PROMISC_ON, IPV6_CFG]}}],
|
||||
'mgmt0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_TC, SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG, SET_TC]}},
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
|
@ -4210,20 +4268,19 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG, SET_TC]}},
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_TC, SET_MTU, IPV6_CFG]}},
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG, SET_TC]}},
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
|
@ -4231,7 +4288,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG, SET_TC]}},
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True, PRE_UP: [VLAN_MOD],
|
||||
|
@ -4261,18 +4318,17 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {PRE_UP: [DIS_DAD], POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {PRE_UP: [DIS_DAD], POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, PRE_UP: [DIS_DAD], POST_UP: [IPV6_CFG]}},
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, PRE_UP: [DIS_DAD], POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
|
@ -4295,8 +4351,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{NET: constants.NETWORK_TYPE_PXEBOOT, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}}],
|
||||
'mgmt0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {'bond-lacp-rate': 'fast', 'bond-miimon': '100',
|
||||
'bond-mode': '802.3ad', 'bond-slaves': True,
|
||||
'bond-xmit-hash-policy': 'layer2', 'hwaddress': True,
|
||||
|
@ -4307,7 +4362,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
OPTIONS: {GATEWAY: True, 'bond-lacp-rate': 'fast', 'bond-miimon': '100',
|
||||
'bond-mode': '802.3ad', 'bond-slaves': True,
|
||||
'bond-xmit-hash-policy': 'layer2', 'hwaddress': True,
|
||||
PRE_UP: [BOND_SETUP, DIS_DAD], POST_UP: [IPV6_CFG, SET_TC],
|
||||
POST_UP: [IPV6_CFG],
|
||||
UP: [SLEEP]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET, METHOD: STATIC,
|
||||
|
@ -4320,7 +4375,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
OPTIONS: {GATEWAY: True, 'bond-lacp-rate': 'fast', 'bond-miimon': '100',
|
||||
'bond-mode': '802.3ad', 'bond-slaves': True,
|
||||
'bond-xmit-hash-policy': 'layer2', 'hwaddress': True,
|
||||
PRE_UP: [BOND_SETUP, DIS_DAD], POST_UP: [IPV6_CFG, SET_TC],
|
||||
POST_UP: [IPV6_CFG],
|
||||
UP: [SLEEP]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
|
@ -4336,16 +4391,15 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {ALLOW: True, 'bond-master': True, PRE_UP: [PROMISC_ON, IPV6_CFG]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {'vlan-raw-device': True,
|
||||
PRE_UP: [VLAN_MOD, VLAN_ADD, DIS_DAD], POST_UP: [SET_MTU, IPV6_CFG],
|
||||
POST_DOWN: [VLAN_DEL]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True,
|
||||
PRE_UP: [VLAN_MOD, VLAN_ADD, DIS_DAD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG], POST_DOWN: [VLAN_DEL]}},
|
||||
PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True,
|
||||
|
@ -4353,8 +4407,8 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True,
|
||||
PRE_UP: [VLAN_MOD, VLAN_ADD, DIS_DAD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG], POST_DOWN: [VLAN_DEL]}},
|
||||
PRE_UP: [VLAN_MOD],
|
||||
POST_UP: [SET_MTU, IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, 'vlan-raw-device': True,
|
||||
|
@ -4382,8 +4436,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
|
@ -4420,8 +4473,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_CLUSTER_HOST, FAMILY: INET, METHOD: STATIC,
|
||||
|
@ -4446,24 +4498,23 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
self._add_ethernet('none')
|
||||
expected = {
|
||||
'mgmt0': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, SET_TC]}},
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, SET_TC]}},
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: constants.NETWORK_TYPE_MGMT, FAMILY: INET6, METHOD: STATIC,
|
||||
OPTIONS: {GATEWAY: True, POST_UP: [IPV6_CFG, UNDEPR]}}],
|
||||
'clhost0': [
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [SET_TC, IPV6_CFG]}},
|
||||
OPTIONS: {POST_UP: [IPV6_CFG]}},
|
||||
{NET: constants.NETWORK_TYPE_PXEBOOT, FAMILY: INET, METHOD: DHCP,
|
||||
OPTIONS: {POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4, DS_IPV4, DS_IPV6],
|
||||
|
@ -4548,8 +4599,7 @@ class InterfaceConfigTestMixin(InterfaceTestCaseMixin):
|
|||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [IPV6_CFG]}}],
|
||||
'data3': [
|
||||
{MODES: [DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
{NET: None, FAMILY: INET, METHOD: MANUAL,
|
||||
OPTIONS: {POST_UP: [IPV6_CFG]}},
|
||||
{MODES: [SS_IPV4, DS_IPV4, DS_IPV6],
|
||||
NET: None, FAMILY: INET, METHOD: STATIC,
|
||||
|
|
Loading…
Reference in New Issue