Change in vdsm[master]: netinfoTests: no need to import each and every netinfo function
osvoboda at redhat.com
osvoboda at redhat.com
Tue Feb 10 22:55:02 UTC 2015
Ondřej Svoboda has uploaded a new change for review.
Change subject: netinfoTests: no need to import each and every netinfo function
......................................................................
netinfoTests: no need to import each and every netinfo function
The list of imports from netinfo uncontrollably grew with netinfo members
that were used only once or a small number of times.
Change-Id: If5a7897e69d02da44d74c1a9f51faa7dde540cc8
Signed-off-by: Ondřej Svoboda <osvoboda at redhat.com>
---
M tests/netinfoTests.py
1 file changed, 10 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/37681/1
diff --git a/tests/netinfoTests.py b/tests/netinfoTests.py
index 368f779..9f3afa7 100644
--- a/tests/netinfoTests.py
+++ b/tests/netinfoTests.py
@@ -27,8 +27,7 @@
from vdsm import ipwrapper
from vdsm import netinfo
-from vdsm.netinfo import (_get_dhclient_ifaces, BONDING_MASTERS, BONDING_OPT,
- _getBondingOptions, OPERSTATE_UP)
+from vdsm.netinfo import OPERSTATE_UP
from vdsm.netlink import addr as nl_addr
from vdsm.utils import random_iface_name
@@ -268,7 +267,8 @@
now=now
))
- dhcpv4_ifaces, dhcpv6_ifaces = _get_dhclient_ifaces([lease_file])
+ dhcpv4_ifaces, dhcpv6_ifaces = \
+ netinfo._get_dhclient_ifaces([lease_file])
self.assertIn('valid', dhcpv4_ifaces)
self.assertIn('valid2', dhcpv4_ifaces)
@@ -286,20 +286,21 @@
INTERVAL = '12345'
bondName = random_iface_name()
- with open(BONDING_MASTERS, 'w') as bonds:
+ 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(
- _getBondingOptions(bondName), {}, "This test fails when "
- "a new bonding option is added to the kernel. Please run "
- "`vdsm-tool dump-bonding-defaults` and retest.")
+ 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(BONDING_OPT % (bondName, 'miimon'), 'w') as opt:
+ with open(netinfo.BONDING_OPT % (bondName, 'miimon'),
+ 'w') as opt:
opt.write(INTERVAL)
- self.assertEqual(_getBondingOptions(bondName),
+ self.assertEqual(netinfo._getBondingOptions(bondName),
{'miimon': INTERVAL})
finally:
--
To view, visit http://gerrit.ovirt.org/37681
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If5a7897e69d02da44d74c1a9f51faa7dde540cc8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
More information about the vdsm-patches
mailing list