Change in vdsm[master]: network: tests: fix funtional ovs tests with getProxy
phoracek at redhat.com
phoracek at redhat.com
Tue Feb 9 13:31:03 UTC 2016
Petr Horáček has uploaded a new change for review.
Change subject: network: tests: fix funtional ovs tests with getProxy
......................................................................
network: tests: fix funtional ovs tests with getProxy
We have to change proxy handling to match new behavior using
getProxy() function introduced in https://gerrit.ovirt.org/#/c/48356/4
Change-Id: I172ae5bfcf34f58e35c04961f1f99d988b495e1a
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M tests/functional/networkTestsOVS.py
1 file changed, 18 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/53129/1
diff --git a/tests/functional/networkTestsOVS.py b/tests/functional/networkTestsOVS.py
index ed8dcaa..db7aaa8 100644
--- a/tests/functional/networkTestsOVS.py
+++ b/tests/functional/networkTestsOVS.py
@@ -32,7 +32,7 @@
_get_source_route, dnsmasqDhcp, NETWORK_NAME,
IP_ADDRESS, IP_MASK, IP_CIDR, IP_GATEWAY,
IPv6_ADDRESS, IPv6_CIDR, VLAN_ID, NOCHK, SUCCESS)
-from utils import VdsProxy
+from utils import _VdsProxy
import dhcp
# WARNING: because of this module changes networkTests module, we cannot run
@@ -148,7 +148,7 @@
networkTests._waitForKnownOperstate = _fakeWaitForKnownOperstate
-class OVSVdsProxy(VdsProxy):
+class OVSVdsProxy(_VdsProxy):
def setupNetworks(self, networks, bonds, options):
if options.pop('ovs', True):
@@ -179,6 +179,21 @@
return super(OVSVdsProxy, self).setupNetworks(networks, bonds, options)
+_instance = _VdsProxy()
+
+
+def getProxy():
+ """
+ We used to connect when a proxy was created but now
+ we want to connect only when the proxy is needed.
+ It is used in functional test context so we do not
+ care about concurrent calls of this function.
+ """
+ if not _instance._is_connected():
+ _instance._connect()
+ return _instance
+
+
@expandPermutations
class OVSNetworkTest(NetworkTest):
__test__ = True
@@ -198,7 +213,7 @@
return wrapper
def setUp(self):
- self.vdsm_net = OVSVdsProxy()
+ self.vdsm_net = getProxy()
def setupNetworks(self, *args, **kwargs):
# Do not run test_kernel_config
--
To view, visit https://gerrit.ovirt.org/53129
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I172ae5bfcf34f58e35c04961f1f99d988b495e1a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the vdsm-patches
mailing list