Change in vdsm[master]: fixing according to review:
ibarkan at redhat.com
ibarkan at redhat.com
Sun Oct 5 07:29:55 UTC 2014
Ido Barkan has uploaded a new change for review.
Change subject: fixing according to review:
......................................................................
fixing according to review:
removed wait_for_predicate() because we use the blocking mode
of DHCP and also because it re-implemented retry()
Change-Id: I26f30516a94bfca9338b03540b4a2f57bfb7015b
Signed-off-by: ibarkan <ibarkan at redhat.com>
---
M tests/functional/networkTests.py
M tests/functional/utils.py
2 files changed, 6 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/98/33798/1
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 5b67766..597c4ff 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1931,36 +1931,33 @@
self.assertIn(NETWORK_NAME, devs)
self.assertEqual(devs[NETWORK_NAME]['cfg']['BOOTPROTO'],
'dhcp')
- route_rule_dev = NETWORK_NAME
+ device_name = NETWORK_NAME
else:
devs = self.vdsm_net.netinfo.nics
self.assertIn(right, devs)
self.assertEqual(devs[right]['cfg']['BOOTPROTO'], 'dhcp')
- route_rule_dev = right
+ device_name = right
device_ip_addr = netaddr.IPAddress(net['addr'])
routing_table = str(device_ip_addr.value)
rule1 = Rule(table=routing_table,
destination=IP_NETWORK_AND_CIDR,
- srcDevice=NETWORK_NAME)
+ srcDevice=str(device_name))
rule2 = Rule(table=routing_table,
source=IP_NETWORK_AND_CIDR)
# DHCP source routing configuration is async hence we wait
# patiently
- # rules_exist = lambda: (
- # ruleExists(rule1) and ruleExists(rule2))
- # wait_for_predicate(rules_exist, 10)
self.assertTrue(ruleExists(rule1))
self.assertTrue(ruleExists(rule2))
routes = [Route.fromText(r)
for r in routeShowTable(routing_table)]
default_route = Route('0.0.0.0/0', via=IP_GATEWAY,
- device=str(route_rule_dev))
+ device=str(device_name))
specific_route = Route(IP_NETWORK_AND_CIDR,
via=str(device_ip_addr),
- device=str(route_rule_dev))
+ device=str(device_name))
self.assertIn(default_route, routes)
self.assertIn(specific_route, routes)
diff --git a/tests/functional/utils.py b/tests/functional/utils.py
index 394b61f..eed8f28 100644
--- a/tests/functional/utils.py
+++ b/tests/functional/utils.py
@@ -226,14 +226,4 @@
def updateVmPolicy(self, vmId, vcpuLimit):
result = self.vdscli.updateVmPolicy([vmId, vcpuLimit])
- return result['status']['code'], result['status']['message']
-
-
-def wait_for_predicate(predicate, timeout, poll_period=1):
- absolute_timeout = time.time() + timeout
- while time.time() <= absolute_timeout:
- res = predicate()
- if res:
- return res
- time.sleep(poll_period)
- return False
+ return result['status']['code'], result['status']['message']
\ No newline at end of file
--
To view, visit http://gerrit.ovirt.org/33798
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26f30516a94bfca9338b03540b4a2f57bfb7015b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
More information about the vdsm-patches
mailing list