Beispiel #1
0
    def testGetBondingOptions(self):
        INTERVAL = '12345'
        bondName = _randomIfaceName()

        with open(BONDING_MASTERS, 'w') as bonds:
            bonds.write('+' + bondName)
            bonds.flush()

            try:
                self.assertEqual(_getBondingOptions(bondName), {})

                with open(BONDING_OPT % (bondName, 'miimon'), 'w') as opt:
                    opt.write(INTERVAL)

                self.assertEqual(_getBondingOptions(bondName),
                                 {'miimon': [INTERVAL]})

            finally:
                bonds.write('-' + bondName)
Beispiel #2
0
    def testGetBondingOptions(self):
        INTERVAL = '12345'
        bondName = _randomIfaceName()

        with open(BONDING_MASTERS, 'w') as bonds:
            bonds.write('+' + bondName)
            bonds.flush()

            try:
                self.assertEqual(_getBondingOptions(bondName), {})

                with open(BONDING_OPT % (bondName, 'miimon'), 'w') as opt:
                    opt.write(INTERVAL)

                self.assertEqual(_getBondingOptions(bondName),
                                 {'miimon': INTERVAL})

            finally:
                bonds.write('-' + bondName)
Beispiel #3
0
    def testGetBondingOptions(self):
        INTERVAL = '12345'
        bondName = random_iface_name()

        with open(BONDING_MASTERS, 'w') as bonds:
            bonds.write('+' + bondName)
            bonds.flush()

            try:  # no error is anticipated but let's make sure we can clean up
                self.assertEqual(
                    _getBondingOptions(bondName), {}, "This test fails when "
                    "a new bonding option is added to the kernel. Please run "
                    "`vdsm-tool dump-bonding-defaults` and retest.")

                with open(BONDING_OPT % (bondName, 'miimon'), 'w') as opt:
                    opt.write(INTERVAL)

                self.assertEqual(_getBondingOptions(bondName),
                                 {'miimon': INTERVAL})

            finally:
                bonds.write('-' + bondName)
Beispiel #4
0
    def testGetBondingOptions(self):
        INTERVAL = '12345'
        bondName = random_iface_name()

        with open(netinfo.BONDING_MASTERS, 'w') as bonds:
            bonds.write('+' + bondName)
            bonds.flush()

            try:  # no error is anticipated but let's make sure we can clean up
                self.assertEqual(
                    netinfo._getBondingOptions(bondName), {}, "This test fails"
                    " when a new bonding option is added to the kernel. Please"
                    " run vdsm-tool dump-bonding-defaults` and retest.")

                with open(netinfo.BONDING_OPT % (bondName, 'miimon'),
                          'w') as opt:
                    opt.write(INTERVAL)

                self.assertEqual(netinfo._getBondingOptions(bondName),
                                 {'miimon': INTERVAL})

            finally:
                bonds.write('-' + bondName)