WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Have xm-test wait for the network device

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Have xm-test wait for the network device to detach. This is an asynchronous
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Mar 2007 13:30:18 -0700
Delivery-date: Tue, 20 Mar 2007 13:31:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174409553 0
# Node ID bea7ff5ebd608160d8258bc7b1cd911aac0d7f62
# Parent  fc918d15c981bb310c524674e2cd1f18320475d5
Have xm-test wait for the network device to detach.  This is an asynchronous
process, so xm-test needs to poll.

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/xm-test/tests/network-attach/network_utils.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)

diff -r fc918d15c981 -r bea7ff5ebd60 
tools/xm-test/tests/network-attach/network_utils.py
--- a/tools/xm-test/tests/network-attach/network_utils.py       Tue Mar 20 
15:15:37 2007 +0000
+++ b/tools/xm-test/tests/network-attach/network_utils.py       Tue Mar 20 
16:52:33 2007 +0000
@@ -11,6 +11,18 @@ def count_eth(console):
     except ConsoleError, e:
         FAIL(str(e))
     return len(run['output'].splitlines())
+
+def get_state(domain_name, number):
+    s, o = traceCommand("xm network-list %s | awk '/^%d/ {print $5}'" %
+                        (domain_name, number))
+    print o
+    
+    if s != 0:
+        FAIL("network-list failed")
+    if o == "":
+        return 0
+    else:
+        return int(o)
 
 def network_attach(domain_name, console):
     eths_before = count_eth(console)
@@ -30,6 +42,13 @@ def network_detach(domain_name, console,
     if status != 0:
         return -1, "xm network-detach returned invalid %i != 0" % status
 
+    for i in range(10):
+        if get_state(domain_name, num) == 0:
+            break
+        time.sleep(1)
+    else:
+        FAIL("network-detach failed: device did not disappear")
+
     eths_after = count_eth(console)
     if eths_after != (eths_before-1):
        return -2, "Network device was not actually disconnected from domU"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Have xm-test wait for the network device to detach. This is an asynchronous, Xen patchbot-unstable <=