def test_detach_used_bond_from_bridge(self, switch):
        with dummy_device() as nic:
            NETCREATE = {
                NETWORK1_NAME: {'bonding': BOND_NAME, 'switch': switch},
                NETWORK2_NAME: {
                    'bonding': BOND_NAME,
                    'vlan': VLAN2,
                    'switch': switch,
                },
            }
            BONDCREATE = {BOND_NAME: {'nics': [nic], 'switch': switch}}

            with adapter.setupNetworks(NETCREATE, BONDCREATE, NOCHK):
                NETEDIT = {
                    NETWORK1_NAME: {
                        'bonding': BOND_NAME,
                        'vlan': VLAN1,
                        'switch': switch,
                    }
                }
                adapter.setupNetworks(NETEDIT, {}, NOCHK)

                # For the legacy bridge, add an explicit ifdown/up step.
                if switch == 'legacy':
                    ifdown(BOND_NAME)
                    ifup(BOND_NAME)
                    # netinfo must be updated explicitly after non-API changes
                    adapter.update_netinfo()

                    adapter.assertBond(BOND_NAME, BONDCREATE[BOND_NAME])
示例#2
0
    def test_detach_used_bond_from_bridge(self, adapter, switch, nic0):
        NETCREATE = {
            NETWORK1_NAME: {
                'bonding': BOND_NAME,
                'switch': switch
            },
            NETWORK2_NAME: {
                'bonding': BOND_NAME,
                'vlan': VLAN2,
                'switch': switch,
            },
        }
        BONDCREATE = {BOND_NAME: {'nics': [nic0], 'switch': switch}}

        with adapter.setupNetworks(NETCREATE, BONDCREATE, NOCHK):
            NETEDIT = {
                NETWORK1_NAME: {
                    'bonding': BOND_NAME,
                    'vlan': VLAN1,
                    'switch': switch,
                }
            }
            adapter.setupNetworks(NETEDIT, {}, NOCHK)

            if switch == 'legacy' and not nftestlib.is_nmstate_backend():
                # For ifcfg backend, make sure ifcfg content is good.
                # https://bugzilla.redhat.com/1372798
                ifdown(BOND_NAME)
                ifup(BOND_NAME)
                # netinfo must be updated explicitly after non-API changes
                adapter.update_netinfo()

            adapter.assertBond(BOND_NAME, BONDCREATE[BOND_NAME])
示例#3
0
    def test_detach_used_bond_from_bridge(self, switch):
        with dummy_device() as nic:
            NETCREATE = {
                NETWORK1_NAME: {'bonding': BOND_NAME, 'switch': switch},
                NETWORK2_NAME: {'bonding': BOND_NAME, 'vlan': VLAN2,
                                'switch': switch}}
            BONDCREATE = {BOND_NAME: {'nics': [nic], 'switch': switch}}

            with adapter.setupNetworks(NETCREATE, BONDCREATE, NOCHK):
                NETEDIT = {
                    NETWORK1_NAME: {'bonding': BOND_NAME, 'vlan': VLAN1,
                                    'switch': switch}}
                adapter.setupNetworks(NETEDIT, {}, NOCHK)

                # For the legacy bridge, add an explicit ifdown/up step.
                if switch == 'legacy':
                    ifdown(BOND_NAME)
                    ifup(BOND_NAME)
                    # netinfo must be updated explicitly after non-API changes
                    adapter.update_netinfo()

                    adapter.assertBond(BOND_NAME, BONDCREATE[BOND_NAME])
示例#4
0
 def test_detach_used_bond_from_bridge(self):
     with self._test_detach_used_bond_from_bridge():
         ifdown(BOND_NAME)
         ifup(BOND_NAME)
         # netinfo must be updated explicitly after non-API changes
         self.update_netinfo()
示例#5
0
 def test_detach_used_bond_from_bridge(self):
     with self._test_detach_used_bond_from_bridge():
         ifdown(BOND_NAME)
         ifup(BOND_NAME)
         # netinfo must be updated explicitly after non-API changes
         self.update_netinfo()