Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-17 Thread osvoboda
Ondřej Svoboda has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 6:

(3 comments)

https://gerrit.ovirt.org/#/c/56983/6/tests/network/nettestlib.py
File tests/network/nettestlib.py:

PS6, Line 419: address
> ip or ipaddress
I went for "ip".


PS6, Line 419: families=(6,), wait_for_scopes=None
> There is problem when introducing multiple families.
For now, I simplified this to only one IP family. But I think a general 
approach is still possible if a distinction is made between the addresses 
obtained ('event' contains a 'family': 'inet' field for IPv4 addresses) in 
addition to the scope.


Line 420: """
Line 421: Wait for the iface to get IP addresses of a specified family with 
netlink
Line 422: Monitor.
Line 423: """
Line 424: event_types = ['ipv{}-ifaddr'.format(family) for family in 
families]
> tuple([...])
Noted, in case we want to implement waiting for scope+family combinations in 
the future.
Line 425: if not wait_for_scopes:
Line 426: wait_for_scopes = ['global', 'link']
Line 427: try:
Line 428: with monitor.Monitor(groups=event_types, timeout=timeout) as 
mon:


-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-17 Thread edwardh
Edward Haas has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 6: Code-Review-1

(3 comments)

https://gerrit.ovirt.org/#/c/56983/6/tests/network/nettestlib.py
File tests/network/nettestlib.py:

PS6, Line 419: families=(6,), wait_for_scopes=None
There is problem when introducing multiple families.
It cannot proper correspond to the scopes... it may return randomly when both 
addresses (ipv4 and ipv6) are created.

I would suggest allowing only a single family to per specified.


PS6, Line 419: address
ip or ipaddress


Line 420: """
Line 421: Wait for the iface to get IP addresses of a specified family with 
netlink
Line 422: Monitor.
Line 423: """
Line 424: event_types = ['ipv{}-ifaddr'.format(family) for family in 
families]
tuple([...])
Line 425: if not wait_for_scopes:
Line 426: wait_for_scopes = ['global', 'link']
Line 427: try:
Line 428: with monitor.Monitor(groups=event_types, timeout=timeout) as 
mon:


-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-16 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 6:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6'])

-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-11 Thread osvoboda
Ondřej Svoboda has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 5: Verified+1

-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda 
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-08 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 2:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6'])

-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Edward Haas 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horáček 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-03 Thread osvoboda
Ondřej Svoboda has uploaded a new change for review.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..

tests: generalize wait_for_ipv6() into wait_for_address()

Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Signed-off-by: Ondřej Svoboda 
---
M tests/network/netinfo_test.py
M tests/network/nettestlib.py
2 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/56983/1

diff --git a/tests/network/netinfo_test.py b/tests/network/netinfo_test.py
index ea65bb3..b96effc 100644
--- a/tests/network/netinfo_test.py
+++ b/tests/network/netinfo_test.py
@@ -36,7 +36,7 @@
 from .ipwrapper_test import _fakeTypeDetection
 from modprobe import RequireBondingMod
 from monkeypatch import MonkeyPatch, MonkeyPatchScope
-from .nettestlib import dnsmasq_run, dummy_device, veth_pair, wait_for_ipv6
+from .nettestlib import dnsmasq_run, dummy_device, veth_pair, wait_for_address
 from testlib import VdsmTestCase as TestCaseBase, namedTemporaryDir
 from testValidation import ValidateRunningAsRoot
 from testValidation import brokentest
@@ -412,7 +412,7 @@
 with veth_pair() as (server, client):
 with dnsmasq_run([server],
  ipv6_slaac_prefix=IPV6_NETADDRESS + '::'):
-with wait_for_ipv6(client):
+with wait_for_address(client):
 ipwrapper.linkSet(client, ['up'])
 ipwrapper.linkSet(server, ['up'])
 ipwrapper.addrAdd(server, IPV6_NETADDRESS + '::1',
diff --git a/tests/network/nettestlib.py b/tests/network/nettestlib.py
index b1a026c..465c354 100644
--- a/tests/network/nettestlib.py
+++ b/tests/network/nettestlib.py
@@ -415,12 +415,16 @@
 
 
 @contextmanager
-def wait_for_ipv6(iface, wait_for_scopes=None):
-"""Wait for iface to get their IPv6 addresses with netlink Monitor"""
+def wait_for_address(iface, families=(6,), wait_for_scopes=None, timeout=20):
+"""
+Wait for the iface to get IP addresses of a specified family with netlink
+Monitor.
+"""
+event_types = ['ipv{}-ifaddr'.format(family) for family in families]
 if not wait_for_scopes:
 wait_for_scopes = ['global', 'link']
 try:
-with monitor.Monitor(groups=('ipv6-ifaddr',), timeout=20) as mon:
+with monitor.Monitor(groups=event_types, timeout=timeout) as mon:
 yield
 for event in mon:
 dev_name = event.get('label')
@@ -434,7 +438,8 @@
 
 except monitor.MonitorError as e:
 if e[0] == monitor.E_TIMEOUT:
-raise Exception('IPv6 addresses has not been caught within the '
-'given timeout.\n')
+raise Exception('IPv{} addresses have not been caught within the '
+'given timeout.\n'.format(
+'/'.join(str(family) for family in families)))
 else:
 raise


-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: tests: generalize wait_for_ipv6() into wait_for_address()

2016-05-03 Thread automation
gerrit-hooks has posted comments on this change.

Change subject: tests: generalize wait_for_ipv6() into wait_for_address()
..


Patch Set 1:

* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' 
and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6'])

-- 
To view, visit https://gerrit.ovirt.org/56983
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefe2632973e13db07309bdedde20227de06bd17a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches