From 7468faf8d3780f4bc4789703f4bd8d7466438f98 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 6 Mar 2009 18:56:28 +0000 Subject: xm-test: Identifying the network env specified in xend config fails, if an additional parameter is given for the network-bridge (e.g. netdev=eth1) The patch splits the network command into the command name and its parameters to determine the netenv (bridge, route, nat) Signed-off-by: juergen.gross@fujitsu-siemens.com --- tools/xm-test/lib/XmTestLib/NetConfig.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools/xm-test') diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py index 0c39969806..857a9a5cca 100644 --- a/tools/xm-test/lib/XmTestLib/NetConfig.py +++ b/tools/xm-test/lib/XmTestLib/NetConfig.py @@ -57,11 +57,13 @@ def getXendNetConfig(): while val[0] != 'network-script': val = pin.get_val() - if val[1] == "network-bridge": + # split network command into script name and its parameters + sub_val = val[1].split() + if sub_val[0] == "network-bridge": netenv = "bridge" - elif val[1] == "network-route": + elif sub_val[0] == "network-route": netenv = "route" - elif val[1] == "network-nat": + elif sub_val[0] == "network-nat": netenv = "nat" else: raise NetworkError("Failed to get network env from xend config") -- cgit v1.2.3