Petr Horáček has uploaded a new change for review.
Change subject: net: test_setupNetworks_bond_with_custom_option with ifcfg persistence ......................................................................
net: test_setupNetworks_bond_with_custom_option with ifcfg persistence
This test asserts bonding options in running configuration, but it is not available with ifcfg persistence.
When ifcfg persistence is enabled, check bonding options in ifcfg file.
Change-Id: I178383e2c0125a1a661108ca9bbb28da74b1a11a Signed-off-by: Petr Horáček phoracek@redhat.com --- M tests/functional/networkTests.py 1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/43467/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index 5752c7e..d64b533 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -2468,8 +2468,16 @@ NOCHK, test_kernel_config=False) self.assertEqual(status, SUCCESS, msg) self.assertBondExists(BONDING_NAME, nics) - opts = self.vdsm_net.config.bonds.get(BONDING_NAME).get('options') - self.assertEquals(opts, 'mode=balance-rr') + if vdsm.config.config.get('vars', 'net_persistence') == 'unified': + opts = self.vdsm_net.config.bonds.get( + BONDING_NAME).get('options') + self.assertEquals(opts, 'mode=balance-rr') + else: # ifcfg persistence + with open(NET_CONF_PREF + BONDING_NAME) as f: + for l in f: + if l.startswith('BONDING_OPTS='): + self.assertIn('mode=balance-rr', l) + self.assertNotIn('custom=foo', l)
status, msg = self.setupNetworks( {}, {BONDING_NAME: {'remove': True}}, NOCHK)