[PATCH] smoke tests: add task with exec from command
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
We didn't have a smoke test for the exec from functionality, so this
patch fixes that. The task uses the tcp_conn test tool which we have in
our repository.
You need to re-generate the smoke tests for this to take effect, use the
generate-recipes.py script for that.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
recipes/smoke/lib/task-exec-from.xml | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 recipes/smoke/lib/task-exec-from.xml
diff --git a/recipes/smoke/lib/task-exec-from.xml b/recipes/smoke/lib/task-exec-from.xml
new file mode 100644
index 0000000..2151411
--- /dev/null
+++ b/recipes/smoke/lib/task-exec-from.xml
@@ -0,0 +1,12 @@
+<task>
+ <define>
+ <alias name="my_range" value="10000-10030"/>
+ </define>
+
+ <run bg_id="1" command="./tcp_listen -p {$my_range} -a {ip(2,testiface)} -d" from="tcp_conn" host="2"/>
+ <ctl_wait seconds="5"/>
+ <run bg_id="2" command="./tcp_connect -p {$my_range} -a {ip(2,testiface)} -d" from="tcp_conn" host="1"/>
+ <ctl_wait seconds="10"/>
+ <intr bg_id="2" host="1"/>
+ <intr bg_id="1" host="2"/>
+</task>
--
1.8.3.1
10 years, 1 month
[PATCH] update pyrout2 use
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The new version of pyroute2 has a new feature that was added partially
on my request- the IPRSocket. This commit updates the code where we use
pyroute2 to use this feature.
This feature is available from pyroute2 version 0.1.11 which already is
available as a package in Fedora 19.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/ConnectionHandler.py | 11 ++++-------
lnst/Common/NetUtils.py | 11 +++--------
lnst/Slave/NetTestSlave.py | 25 +++----------------------
3 files changed, 10 insertions(+), 37 deletions(-)
diff --git a/lnst/Common/ConnectionHandler.py b/lnst/Common/ConnectionHandler.py
index b44f159..c0a43fa 100644
--- a/lnst/Common/ConnectionHandler.py
+++ b/lnst/Common/ConnectionHandler.py
@@ -15,8 +15,7 @@ import select
import cPickle
import socket
from _multiprocessing import Connection
-from pyroute2.netlink import NetlinkSocket
-from pyroute2.netlink.iproute import MarshalRtnl
+from pyroute2 import IPRSocket
def send_data(s, data):
try:
@@ -35,11 +34,9 @@ def send_data(s, data):
return True
def recv_data(s):
- if isinstance(s, NetlinkSocket):
- marshaller = MarshalRtnl()
- msg = s.recv(16384)
- decoded_msg = marshaller.parse(msg)
- data = {"type": "netlink", "data": decoded_msg}
+ if isinstance(s, IPRSocket):
+ msg = s.get()
+ data = {"type": "netlink", "data": msg}
elif isinstance(s, socket.SocketType):
length = ""
while True:
diff --git a/lnst/Common/NetUtils.py b/lnst/Common/NetUtils.py
index efa14f5..b649483 100644
--- a/lnst/Common/NetUtils.py
+++ b/lnst/Common/NetUtils.py
@@ -15,14 +15,11 @@ import os
import re
import socket
import subprocess
-from resource import getpagesize
-from pyroute2.netlink import NetlinkSocket
+from pyroute2 import IPRSocket
from pyroute2.netlink import NLM_F_REQUEST
from pyroute2.netlink import NLM_F_DUMP
from pyroute2.netlink import NLMSG_DONE
from pyroute2.netlink import NLMSG_ERROR
-from pyroute2.netlink.generic import NETLINK_ROUTE
-from pyroute2.netlink.iproute import MarshalRtnl
from pyroute2.netlink.iproute import RTM_GETLINK
from pyroute2.netlink.iproute import RTM_NEWLINK
from pyroute2.netlink.rtnl.ifinfmsg import ifinfmsg
@@ -32,7 +29,7 @@ def normalize_hwaddr(hwaddr):
def scan_netdevs():
scan = []
- nl_socket = NetlinkSocket(family=NETLINK_ROUTE)
+ nl_socket = IPRSocket()
msg = ifinfmsg()
msg["family"] = socket.AF_UNSPEC
msg["header"]["type"] = RTM_GETLINK
@@ -44,10 +41,8 @@ def scan_netdevs():
nl_socket.sendto(msg.buf.getvalue(), (0,0))
finished = False
- marshal = MarshalRtnl()
while not finished:
- response = nl_socket.recv(getpagesize())
- parts = marshal.parse(response)
+ parts = nl_socket.get()
for part in parts:
if part["header"]["type"] in [NLMSG_DONE, NLMSG_ERROR]:
finished = True
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index 76359d5..f8dad2b 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -37,26 +37,7 @@ from lnst.Common.ConnectionHandler import recv_data, send_data
from lnst.Common.ConnectionHandler import ConnectionHandler
from lnst.Common.Config import lnst_config
from lnst.Common.NetTestCommand import NetTestCommandConfig
-
-#TODO this is temporary, until python-pyroute2 package is updated
-from pyroute2.netlink import NetlinkSocket
-from pyroute2.netlink.generic import NETLINK_ROUTE
-
-RTNLGRP_LINK = 0x1
-RTNLGRP_NEIGH = 0x4
-RTNLGRP_TC = 0x8
-RTNLGRP_IPV4_IFADDR = 0x10
-RTNLGRP_IPV4_ROUTE = 0x40
-RTNLGRP_IPV6_IFADDR = 0x100
-RTNLGRP_IPV6_ROUTE = 0x400
-
-RTNL_GROUPS = RTNLGRP_IPV4_IFADDR |\
- RTNLGRP_IPV6_IFADDR |\
- RTNLGRP_IPV4_ROUTE |\
- RTNLGRP_IPV6_ROUTE |\
- RTNLGRP_NEIGH |\
- RTNLGRP_LINK |\
- RTNLGRP_TC
+from pyroute2 import IPRSocket
DefaultRPCPort = 9999
@@ -455,8 +436,8 @@ class NetTestSlave:
self._log_ctl = log_ctl
- self._nl_socket = NetlinkSocket(family=NETLINK_ROUTE)
- self._nl_socket.bind(RTNL_GROUPS)
+ self._nl_socket = IPRSocket()
+ self._nl_socket.bind()
self._server_handler.add_connection('netlink', self._nl_socket)
def run(self):
--
1.8.3.1
10 years, 1 month
[PATCH] schema-recipe: task can't be empty
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The scheme allowed the existence of empty tasks, which would later cause
an expcetion during the recipe execution.
This patch fixes the schema so that there is always at least one command
in the schema. The solution isn't perfect since now the error reported
is something like "expected element <run>" which isn't entirely true
(for e.g. <config> can be found as well), but it will do for now.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
schema-recipe.rng | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/schema-recipe.rng b/schema-recipe.rng
index c211b11..bd0a8df 100644
--- a/schema-recipe.rng
+++ b/schema-recipe.rng
@@ -65,30 +65,18 @@
</attribute>
</optional>
- <interleave>
- <optional>
- <ref name="define"/>
- </optional>
-
- <zeroOrMore>
- <ref name="config"/>
- </zeroOrMore>
- <zeroOrMore>
+ <oneOrMore>
+ <choice>
<ref name="run"/>
- </zeroOrMore>
- <zeroOrMore>
+ <ref name="config"/>
<ref name="wait"/>
- </zeroOrMore>
- <zeroOrMore>
<ref name="intr"/>
- </zeroOrMore>
- <zeroOrMore>
<ref name="kill"/>
- </zeroOrMore>
- <zeroOrMore>
<ref name="ctl_wait"/>
- </zeroOrMore>
- </interleave>
+
+ <ref name="define"/>
+ </choice>
+ </oneOrMore>
</element>
</define>
--
1.8.3.1
10 years, 1 month
[lnst] Created tag v1
by Jiří Pírko
The lightweight tag 'v1' was created pointing to:
9fb63a4... 1 release
10 years, 1 month
[lnst] 1 release
by Jiří Pírko
commit 9fb63a42bcf1601e0ea11f8baa60fd7a1b994b48
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Thu Oct 10 10:41:07 2013 +0200
1 release
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index 0a0c2e7..d841e58 100755
--- a/setup.py
+++ b/setup.py
@@ -157,7 +157,7 @@ DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + \
SCHEMAS + BASH_COMP
setup(name="lnst",
- version="git",
+ version="1",
description="Linux Network Stack Test",
author="LNST Team",
author_email="lnst-developers(a)lists.fedorahosted.org",
10 years, 1 month
[lnst] recipes: Changing the 'machine' attr to 'host'
by Jiří Pírko
commit ab6e6610ca651b4f465a61b0bb810d5d1e84fe13
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Oct 9 14:29:20 2013 +0200
recipes: Changing the 'machine' attr to 'host'
The machines tag were recently changed to <network> and with that, we
also renamed machines to hosts. This patch changes the attributes of
commands in tasks to match these changes.
The 'machine' attribute was changed to 'host' for the <config>,
<run>, and the signal tags (<wait>, <intr>, <kill>).
The commit also contains the same changes for the python task API.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/NetTestCommand.py | 2 +-
lnst/Controller/RecipeParser.py | 6 +-
lnst/Controller/Task.py | 54 ++++++++++----------
recipes/examples/quick_guides/ping_check.xml | 2 +-
recipes/multicast/cmd_sequences/block_source.xml | 22 ++++----
recipes/multicast/cmd_sequences/if.xml | 20 ++++----
recipes/multicast/cmd_sequences/loop.xml | 18 +++---
recipes/multicast/cmd_sequences/max_groups.xml | 6 +-
recipes/multicast/cmd_sequences/membership.xml | 12 ++--
recipes/multicast/cmd_sequences/simple.xml | 10 ++--
.../multicast/cmd_sequences/source_membership.xml | 22 ++++----
recipes/multicast/cmd_sequences/ttl.xml | 28 +++++-----
recipes/smoke/lib/task-bg.xml | 4 +-
recipes/smoke/lib/task-config.xml | 2 +-
recipes/smoke/lib/task-exec.xml | 2 +-
recipes/smoke/lib/task-ping.xml | 2 +-
recipes/team/sequence_iperf.xml | 6 +-
recipes/team/sequence_ping_simple.xml | 4 +-
recipes/team/sequence_pktgen.xml | 6 +-
recipes/team/sequence_pktgen_flows.xml | 4 +-
recipes/team/sequence_pktgen_hashes.xml | 2 +-
recipes/team/sequence_pktgen_lacp.xml | 6 +-
recipes/team/sequence_queue_mapping.xml | 24 ++++----
schema-recipe.rng | 6 +-
24 files changed, 135 insertions(+), 135 deletions(-)
---
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py
index abd7400..64bd432 100644
--- a/lnst/Common/NetTestCommand.py
+++ b/lnst/Common/NetTestCommand.py
@@ -25,7 +25,7 @@ def str_command(command):
attrs = ["type(%s)" % command["type"]]
if command["type"] == "test":
attrs.append("module(%s)" % command["module"])
- attrs.append("machine(%s)" % command["machine"])
+ attrs.append("host(%s)" % command["machine"])
if "bg_id" in command:
attrs.append("bg_id(%s)" % command["bg_id"])
diff --git a/lnst/Controller/RecipeParser.py b/lnst/Controller/RecipeParser.py
index 405c87b..7833e7f 100644
--- a/lnst/Controller/RecipeParser.py
+++ b/lnst/Controller/RecipeParser.py
@@ -176,7 +176,7 @@ class RecipeParser(XmlParser):
def _process_run_cmd(self, cmd_tag):
cmd = XmlData(cmd_tag)
- cmd["machine"] = self._get_attribute(cmd_tag, "machine")
+ cmd["machine"] = self._get_attribute(cmd_tag, "host")
has_module = self._has_attribute(cmd_tag, "module")
has_command = self._has_attribute(cmd_tag, "command")
@@ -216,7 +216,7 @@ class RecipeParser(XmlParser):
def _process_config_cmd(self, cmd_tag):
cmd = XmlData(cmd_tag)
cmd["type"] = "config"
- cmd["machine"] = self._get_attribute(cmd_tag, "machine")
+ cmd["machine"] = self._get_attribute(cmd_tag, "host")
if self._has_attribute(cmd_tag, "persistent"):
cmd["persistent"] = self._get_attribute(cmd_tag, "persistent")
@@ -251,6 +251,6 @@ class RecipeParser(XmlParser):
def _process_signal_cmd(self, cmd_tag):
cmd = XmlData(cmd_tag)
cmd["type"] = cmd_tag.tag
- cmd["machine"] = self._get_attribute(cmd_tag, "machine")
+ cmd["machine"] = self._get_attribute(cmd_tag, "host")
cmd["bg_id"] = self._get_attribute(cmd_tag, "bg_id")
return cmd
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py
index d42c47c..c933cfb 100644
--- a/lnst/Controller/Task.py
+++ b/lnst/Controller/Task.py
@@ -18,9 +18,9 @@ class TaskError(Exception): pass
class ControllerAPI(object):
""" An API class representing the controller. """
- def __init__(self, ctl, machines):
+ def __init__(self, ctl, hosts):
self._ctl = ctl
- self._machines = machines
+ self._hosts = hosts
self._result = True
def _run_command(self, command):
@@ -34,28 +34,28 @@ class ControllerAPI(object):
self._result = self._result and res["passed"]
return res
- def get_machine(self, machine_id):
+ def get_host(self, host_id):
"""
- Get an API handle for the machine from the recipe spec with
+ Get an API handle for the host from the recipe spec with
a specific id.
- :param machine_id: id of the machine as defined in the recipe
- :type machine_id: string
+ :param host_id: id of the host as defined in the recipe
+ :type host_id: string
- :return: The machine handle.
- :rtype: MachineAPI
+ :return: The host handle.
+ :rtype: HostAPI
- :raises TaskError: If there is no machine with such id.
+ :raises TaskError: If there is no host with such id.
"""
- if machine_id not in self._machines:
- raise TaskError("Machine '%s' not found." % machine_id)
+ if host_id not in self._hosts:
+ raise TaskError("Host '%s' not found." % host_id)
- machine = self._machines[machine_id]
- return MachineAPI(self, machine_id, machine)
+ host = self._hosts[host_id]
+ return HostAPI(self, host_id, host)
def get_module(self, name, **kwargs):
"""
- Initialize a module to be run on a machine.
+ Initialize a module to be run on a host.
:param name: name of the module
:type name: string
@@ -78,19 +78,19 @@ class ControllerAPI(object):
cmd = {"type": "ctl_wait", "seconds": int(seconds)}
return self._ctl._run_command(cmd)
-class MachineAPI(object):
- """ An API class representing a machine. """
+class HostAPI(object):
+ """ An API class representing a host machine. """
- def __init__(self, ctl, machine_id, machine):
+ def __init__(self, ctl, host_id, host):
self._ctl = ctl
- self._id = machine_id
- self._m = machine
+ self._id = host_id
+ self._m = host
self._bg_id_seq = 0
def config(self, option, value, persistent=False):
"""
- Configure an option in /sys or /proc on the machine.
+ Configure an option in /sys or /proc on the host.
:param option: A path within /sys or /proc.
:type option: string
@@ -110,9 +110,9 @@ class MachineAPI(object):
def run(self, what, **kwargs):
"""
- Configure an option in /sys or /proc on the machine.
+ Configure an option in /sys or /proc on the host.
- :param what: What should be run on the machine.
+ :param what: What should be run on the host.
:type what: str or ModuleAPI
:param bg: Run in background flag.
@@ -247,9 +247,9 @@ class ModuleAPI(object):
class ProcessAPI(object):
""" An API class representing either a running or finished process. """
- def __init__(self, ctl, m_id, cmd_res, bg_id):
+ def __init__(self, ctl, h_id, cmd_res, bg_id):
self._ctl = ctl
- self._machine = m_id
+ self._host = h_id
self._cmd_res = cmd_res
self._bg_id = bg_id
@@ -274,7 +274,7 @@ class ProcessAPI(object):
def wait(self):
""" Blocking wait until the command returns. """
if self._bg_id:
- cmd = {"machine": self._machine,
+ cmd = {"machine": self._host,
"type": "wait",
"proc_id": self._bg_id}
self._res = self._ctl._run_command(cmd)
@@ -282,7 +282,7 @@ class ProcessAPI(object):
def intr(self):
""" Interrupt the command. """
if self._bg_id:
- cmd = {"machine": self._machine,
+ cmd = {"machine": self._host,
"type": "intr",
"proc_id": self._bg_id}
self._res = self._ctl._run_command(cmd)
@@ -296,7 +296,7 @@ class ProcessAPI(object):
to keep the results, use 'intr' instead.
"""
if self._bg_id:
- cmd = {"machine": self._machine,
+ cmd = {"machine": self._host,
"type": "kill",
"proc_id": self._bg_id}
self._res = self._ctl._run_command(cmd)
diff --git a/recipes/examples/quick_guides/ping_check.xml b/recipes/examples/quick_guides/ping_check.xml
index 25f3c4a..7111d50 100644
--- a/recipes/examples/quick_guides/ping_check.xml
+++ b/recipes/examples/quick_guides/ping_check.xml
@@ -27,7 +27,7 @@ This is a recipe from a quick guide that is available on LNST wiki page:
</network>
<task>
- <run machine="testmachine1" module="IcmpPing">
+ <run host="testmachine1" module="IcmpPing">
<options>
<option name="addr" value="{ip(testmachine2,testifc2)}"/>
<option name="count" value="3"/>
diff --git a/recipes/multicast/cmd_sequences/block_source.xml b/recipes/multicast/cmd_sequences/block_source.xml
index dc16789..0026f5e 100644
--- a/recipes/multicast/cmd_sequences/block_source.xml
+++ b/recipes/multicast/cmd_sequences/block_source.xml
@@ -5,7 +5,7 @@
configured to forward igmp traffic through the bridge -->
<task>
<!-- IP_BLOCK/UNBLOCK_SOURCE sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_block_source"/>
<option name="condition" value="status == 'pass'"/>
@@ -13,10 +13,10 @@
</run>
<!-- Block source in the middle of ongoing communication -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="238.0.0.1"/>
@@ -28,7 +28,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_block_source"/>
<option name="address" value="238.0.0.1"/>
@@ -41,13 +41,13 @@
<option name="condition" value="packets_received_while_blocking == 0"/>
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- Nonexistent source -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="238.0.0.1"/>
@@ -59,7 +59,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_block_source"/>
<option name="address" value="238.0.0.1"/>
@@ -72,6 +72,6 @@
<option name="condition" value="packets_received_while_blocking > 0"/>
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/if.xml b/recipes/multicast/cmd_sequences/if.xml
index 6a4392a..968ea57 100644
--- a/recipes/multicast/cmd_sequences/if.xml
+++ b/recipes/multicast/cmd_sequences/if.xml
@@ -5,7 +5,7 @@
- -->
<task>
<!-- IP_MULTICAST_IF sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_if"/>
@@ -16,10 +16,10 @@
</run>
<!-- IP_MULTICAST_IF correct interfaces set -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -31,7 +31,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -43,12 +43,12 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- IP_MULTICAST_IF incorrect interfaces set -->
- <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" host="1"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -60,7 +60,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -72,5 +72,5 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/loop.xml b/recipes/multicast/cmd_sequences/loop.xml
index f3ac139..6c32dd8 100644
--- a/recipes/multicast/cmd_sequences/loop.xml
+++ b/recipes/multicast/cmd_sequences/loop.xml
@@ -2,7 +2,7 @@
<!-- Requires: 1 hosts with at least two interfaces -->
<task>
<!-- IP_MULTICAST_LOOP sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_loop"/>
<option name="condition" value="status == 'pass'"/>
@@ -10,9 +10,9 @@
</run>
<!-- IP_MULTICAST_LOOP enabled -->
- <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" host="1"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -24,7 +24,7 @@
</options>
</run>
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -36,12 +36,12 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- IP_MULTICAST_LOOP disabled -->
- <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" host="1"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -53,7 +53,7 @@
</options>
</run>
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -65,5 +65,5 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/max_groups.xml b/recipes/multicast/cmd_sequences/max_groups.xml
index 0be1ed4..ff887da 100644
--- a/recipes/multicast/cmd_sequences/max_groups.xml
+++ b/recipes/multicast/cmd_sequences/max_groups.xml
@@ -2,7 +2,7 @@
<!-- Requires: 1 host with one interface -->
<task>
<!-- With a specific interface -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="max_groups"/>
<option name="interface" value="{ip(1,testiface)}"/>
@@ -11,8 +11,8 @@
</run>
<!-- Change default max_memberhsips -->
- <config machine="1" option="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
- <run machine="1" module="Multicast" timeout="30">
+ <config host="1" option="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="max_groups"/>
<option name="interface" value="{ip(1,testiface)}"/>
diff --git a/recipes/multicast/cmd_sequences/membership.xml b/recipes/multicast/cmd_sequences/membership.xml
index 21b12d6..72508a8 100644
--- a/recipes/multicast/cmd_sequences/membership.xml
+++ b/recipes/multicast/cmd_sequences/membership.xml
@@ -5,7 +5,7 @@
- -->
<task>
<!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_membership"/>
<option name="condition" value="status == 'pass'"/>
@@ -15,10 +15,10 @@
<!-- This simple test case verifies that if one side leaves multicast group
- in the middle of ongoing communication, no further packets are delivered
- to the process. -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -30,7 +30,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -43,5 +43,5 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/simple.xml b/recipes/multicast/cmd_sequences/simple.xml
index ccfa22e..9d1cdea 100644
--- a/recipes/multicast/cmd_sequences/simple.xml
+++ b/recipes/multicast/cmd_sequences/simple.xml
@@ -1,9 +1,9 @@
<!-- Requires: 2 hosts with at least one interface -->
<task>
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -14,7 +14,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -26,5 +26,5 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/source_membership.xml b/recipes/multicast/cmd_sequences/source_membership.xml
index 5b598e0..37b0d6f 100644
--- a/recipes/multicast/cmd_sequences/source_membership.xml
+++ b/recipes/multicast/cmd_sequences/source_membership.xml
@@ -7,7 +7,7 @@
configured to forward igmp traffic through the bridge -->
<task>
<!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_source_membership"/>
<option name="condition" value="status == 'pass'"/>
@@ -17,10 +17,10 @@
<!-- This simple test case verifies that if one side leaves multicast group
- in the middle of ongoing communication, no further packets are delivered
- to the process. -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -32,7 +32,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_source_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -45,13 +45,13 @@
<option name="condition" value="packets_received_after_drop == 0"/>
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- Nonexistent source -->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -63,7 +63,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_source_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -76,6 +76,6 @@
<option name="condition" value="packets_received_after_drop == 0"/>
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/multicast/cmd_sequences/ttl.xml b/recipes/multicast/cmd_sequences/ttl.xml
index 6390f31..1ad5b5d 100644
--- a/recipes/multicast/cmd_sequences/ttl.xml
+++ b/recipes/multicast/cmd_sequences/ttl.xml
@@ -5,7 +5,7 @@
- -->
<task>
<!-- IP_MULTICAST_TTL sockopt conformance test -->
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_ttl"/>
<option name="condition" value="status == 'pass'"/>
@@ -13,9 +13,9 @@
</run>
<!-- IP_MULTICAST_TTL = 0, looped on one host -->
- <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" host="1"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -28,7 +28,7 @@
</options>
</run>
- <run machine="1" module="Multicast" timeout="30">
+ <run host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -40,7 +40,7 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- IP_MULTICAST_TTL = 0 between 2 hosts -->
<!-- KNOWN BUG: according to the specs, packets
@@ -51,10 +51,10 @@
http://www.spinics.net/lists/netdev/msg183704.html
-->
- <run command="sleep 1" machine="1"/>
- <run command="sleep 1" machine="2"/>
+ <run command="sleep 1" host="1"/>
+ <run command="sleep 1" host="2"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -66,7 +66,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -78,12 +78,12 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
<!-- IP_MULTICAST_TTL = 1 between 2 hosts -->
- <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" host="1"/>
- <run bg_id="1" machine="1" module="Multicast" timeout="30">
+ <run bg_id="1" host="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -95,7 +95,7 @@
</options>
</run>
- <run machine="2" module="Multicast" timeout="30">
+ <run host="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -107,5 +107,5 @@
</options>
</run>
- <wait bg_id="1" machine="1"/>
+ <wait bg_id="1" host="1"/>
</task>
diff --git a/recipes/smoke/lib/task-bg.xml b/recipes/smoke/lib/task-bg.xml
index 3f08743..54b4d9e 100644
--- a/recipes/smoke/lib/task-bg.xml
+++ b/recipes/smoke/lib/task-bg.xml
@@ -1,5 +1,5 @@
<task>
- <run bg_id="1" expect="#icmp_result#" machine="1" module="IcmpPing" timeout="30">
+ <run bg_id="1" expect="#icmp_result#" host="1" module="IcmpPing" timeout="30">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="40"/>
@@ -8,5 +8,5 @@
</options>
</run>
<ctl_wait seconds="5"/>
- <intr bg_id="1" machine="1"/>
+ <intr bg_id="1" host="1"/>
</task>
diff --git a/recipes/smoke/lib/task-config.xml b/recipes/smoke/lib/task-config.xml
index 25a0a6a..264d9b3 100644
--- a/recipes/smoke/lib/task-config.xml
+++ b/recipes/smoke/lib/task-config.xml
@@ -1,5 +1,5 @@
<task>
- <config machine="1">
+ <config host="1">
<options>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="6"/>
diff --git a/recipes/smoke/lib/task-exec.xml b/recipes/smoke/lib/task-exec.xml
index 9fae49f..40b75bf 100644
--- a/recipes/smoke/lib/task-exec.xml
+++ b/recipes/smoke/lib/task-exec.xml
@@ -1,5 +1,5 @@
<task>
- <run command="[ `ip -o link | grep {devname(1,testiface)} | wc -l` -gt 0 ]" machine="1" timeout="30"/>
+ <run command="[ `ip -o link | grep {devname(1,testiface)} | wc -l` -gt 0 ]" host="1" timeout="30"/>
<!-- This does not yet work for non-eth devices -->
<!--<command machine_id="1" timeout="30" type="exec"
value="[ `ip -o link | grep {hwaddr(1,testiface)} | wc -l` -gt 0 ]"/>-->
diff --git a/recipes/smoke/lib/task-ping.xml b/recipes/smoke/lib/task-ping.xml
index 1c275f7..87284fa 100644
--- a/recipes/smoke/lib/task-ping.xml
+++ b/recipes/smoke/lib/task-ping.xml
@@ -1,5 +1,5 @@
<task>
- <run expect="#icmp_result#" machine="1" module="IcmpPing" timeout="30">
+ <run expect="#icmp_result#" host="1" module="IcmpPing" timeout="30">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="40"/>
diff --git a/recipes/team/sequence_iperf.xml b/recipes/team/sequence_iperf.xml
index e45f307..9e0b2d0 100644
--- a/recipes/team/sequence_iperf.xml
+++ b/recipes/team/sequence_iperf.xml
@@ -1,18 +1,18 @@
<task>
<ctl_wait seconds="3"/>
- <run bg_id="1" machine="2" module="Iperf">
+ <run bg_id="1" host="2" module="Iperf">
<options>
<option name="role" value="server"/>
<option name="bind" value="{ip(2,testiface)}"/>
</options>
</run>
<ctl_wait seconds="5"/>
- <run machine="1" module="Iperf">
+ <run host="1" module="Iperf">
<options>
<option name="role" value="client"/>
<option name="duration" value="15"/>
<option name="iperf_server" value="{ip(2,testiface)}"/>
</options>
</run>
- <kill bg_id="1" machine="2"/>
+ <kill bg_id="1" host="2"/>
</task>
diff --git a/recipes/team/sequence_ping_simple.xml b/recipes/team/sequence_ping_simple.xml
index 853cceb..adb15d0 100644
--- a/recipes/team/sequence_ping_simple.xml
+++ b/recipes/team/sequence_ping_simple.xml
@@ -1,6 +1,6 @@
<task>
<ctl_wait seconds="4"/>
- <run machine="1" module="IcmpPing" timeout="60">
+ <run host="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="2000"/>
@@ -8,7 +8,7 @@
<option name="limit_rate" value="95"/>
</options>
</run>
- <run machine="1" module="Icmp6Ping" timeout="60">
+ <run host="1" module="Icmp6Ping" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,1)}"/>
<option name="count" value="2000"/>
diff --git a/recipes/team/sequence_pktgen.xml b/recipes/team/sequence_pktgen.xml
index e09c89c..5807b42 100644
--- a/recipes/team/sequence_pktgen.xml
+++ b/recipes/team/sequence_pktgen.xml
@@ -1,13 +1,13 @@
<task>
<ctl_wait seconds="4"/>
- <run bg_id="1" machine="1" module="PktCounter">
+ <run bg_id="1" host="1" module="PktCounter">
<options>
<option name="input_netdev_name" value="{devname(1,testiface)}"/>
<option name="proto" value="udp"/>
<option name="dport" value="9"/>
</options>
</run>
- <run machine="2" module="PktgenTx" timeout="200">
+ <run host="2" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="dst {ip(1,testiface)}"/>
<option name="pktgen_option" value="dst_mac 00:11:22:33:44:55"/>
@@ -17,5 +17,5 @@
<option name="netdev_name" value="{devname(2,testiface)}"/>
</options>
</run>
- <intr bg_id="1" machine="1"/>
+ <intr bg_id="1" host="1"/>
</task>
diff --git a/recipes/team/sequence_pktgen_flows.xml b/recipes/team/sequence_pktgen_flows.xml
index 729f3cd..c9d58ee 100644
--- a/recipes/team/sequence_pktgen_flows.xml
+++ b/recipes/team/sequence_pktgen_flows.xml
@@ -1,6 +1,6 @@
<task>
<ctl_wait seconds="4"/>
- <run bg_id="1" machine="1" module="PktgenTx">
+ <run bg_id="1" host="1" module="PktgenTx">
<options>
<option name="pktgen_option" value="count 0"/>
<option name="pktgen_option" value="clone_skb 0"/>
@@ -18,5 +18,5 @@
</options>
</run>
<ctl_wait seconds="400"/>
- <intr bg_id="1" machine="1"/>
+ <intr bg_id="1" host="1"/>
</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_pktgen_hashes.xml b/recipes/team/sequence_pktgen_hashes.xml
index 6d5c046..c8212b6 100644
--- a/recipes/team/sequence_pktgen_hashes.xml
+++ b/recipes/team/sequence_pktgen_hashes.xml
@@ -1,6 +1,6 @@
<task>
<ctl_wait seconds="4"/>
- <run machine="1" module="PktgenTx" timeout="200">
+ <run host="1" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="count 10000"/>
<option name="pktgen_option" value="clone_skb 0"/>
diff --git a/recipes/team/sequence_pktgen_lacp.xml b/recipes/team/sequence_pktgen_lacp.xml
index 0c469a8..e93fcdb 100644
--- a/recipes/team/sequence_pktgen_lacp.xml
+++ b/recipes/team/sequence_pktgen_lacp.xml
@@ -1,13 +1,13 @@
<task>
<ctl_wait seconds="4"/>
- <run bg_id="1" machine="1" module="PktCounter">
+ <run bg_id="1" host="1" module="PktCounter">
<options>
<option name="input_netdev_name" value="{devname(1,testiface)}"/>
<option name="proto" value="udp"/>
<option name="dport" value="9"/>
</options>
</run>
- <run machine="2" module="PktgenTx" timeout="200">
+ <run host="2" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="dst {ip(1,testiface)}"/>
<option name="pktgen_option" value="dst_mac 00:11:22:33:44:55"/>
@@ -17,5 +17,5 @@
<option name="netdev_name" value="{devname(2,3)}"/>
</options>
</run>
- <intr bg_id="1" machine="1"/>
+ <intr bg_id="1" host="1"/>
</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_queue_mapping.xml b/recipes/team/sequence_queue_mapping.xml
index ede0499..04446b5 100644
--- a/recipes/team/sequence_queue_mapping.xml
+++ b/recipes/team/sequence_queue_mapping.xml
@@ -1,10 +1,10 @@
<task>
<ctl_wait seconds="4"/>
- <run command="tc qdisc add dev {devname(1,testiface)} handle 1 root multiq" machine="1"/>
- <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,0)} action skbedit queue_mapping 1" machine="1"/>
- <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,1)} action skbedit queue_mapping 2" machine="1"/>
- <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,2)} action skbedit queue_mapping 3" machine="1"/>
- <run bg_id="1" machine="1" module="IcmpPing" timeout="60">
+ <run command="tc qdisc add dev {devname(1,testiface)} handle 1 root multiq" host="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,0)} action skbedit queue_mapping 1" host="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,1)} action skbedit queue_mapping 2" host="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,2)} action skbedit queue_mapping 3" host="1"/>
+ <run bg_id="1" host="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,0)}"/>
<option name="count" value="100"/>
@@ -12,7 +12,7 @@
<option name="limit_rate" value="95"/>
</options>
</run>
- <run bg_id="2" machine="1" module="IcmpPing" timeout="60">
+ <run bg_id="2" host="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,1)}"/>
<option name="count" value="100"/>
@@ -20,7 +20,7 @@
<option name="limit_rate" value="95"/>
</options>
</run>
- <run bg_id="3" machine="1" module="IcmpPing" timeout="60">
+ <run bg_id="3" host="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,2)}"/>
<option name="count" value="100"/>
@@ -28,7 +28,7 @@
<option name="limit_rate" value="95"/>
</options>
</run>
- <run bg_id="4" machine="1" module="IcmpPing" timeout="60">
+ <run bg_id="4" host="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,3)}"/>
<option name="count" value="100"/>
@@ -36,8 +36,8 @@
<option name="limit_rate" value="95"/>
</options>
</run>
- <wait bg_id="1" machine="1"/>
- <wait bg_id="2" machine="1"/>
- <wait bg_id="3" machine="1"/>
- <wait bg_id="4" machine="1"/>
+ <wait bg_id="1" host="1"/>
+ <wait bg_id="2" host="1"/>
+ <wait bg_id="3" host="1"/>
+ <wait bg_id="4" host="1"/>
</task>
\ No newline at end of file
diff --git a/schema-recipe.rng b/schema-recipe.rng
index fba15db..c211b11 100644
--- a/schema-recipe.rng
+++ b/schema-recipe.rng
@@ -282,7 +282,7 @@
<define name="config">
<element name="config">
- <attribute name="machine"/>
+ <attribute name="host"/>
<optional>
<attribute name="option"/>
@@ -321,7 +321,7 @@
<define name="run">
<element name="run">
- <attribute name="machine"/>
+ <attribute name="host"/>
<choice>
<attribute name="module"/>
@@ -383,7 +383,7 @@
</define>
<define name="signal_command">
- <attribute name="machine"/>
+ <attribute name="host"/>
<attribute name="bg_id"/>
</define>
10 years, 1 month
[lnst] XmlParser: Incorrect execption handling
by Jiří Pírko
commit c8d387e64851a48d077b933b80687a8afa9e2a7e
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Oct 9 11:53:36 2013 +0200
XmlParser: Incorrect execption handling
Different exception is raised when an included file didn't exist. In
that case, controller would crash with an exception.
This commit adds an additional branch to handle generic exceptions too.
Issue #46
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/XmlParser.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/XmlParser.py b/lnst/Common/XmlParser.py
index c60b410..4cde0b4 100644
--- a/lnst/Common/XmlParser.py
+++ b/lnst/Common/XmlParser.py
@@ -81,7 +81,7 @@ class XmlParser(object):
def _parse(self, path):
try:
doc = etree.parse(path)
- except Exception as err:
+ except etree.LxmlError as err:
# A workaround for cases when lxml (quite strangely)
# sets the filename to <string>.
if err.error_log[0].filename == "<string>":
@@ -94,6 +94,13 @@ class XmlParser(object):
exc = XmlProcessingError(err.error_log[0].message)
exc.set_loc(loc)
raise exc
+ except Exception as err:
+ loc = {"file": os.path.basename(self._path),
+ "line": None,
+ "col": None}
+ exc = XmlProcessingError(str(err))
+ exc.set_loc(loc)
+ raise exc
return doc
10 years, 1 month
[lnst] smoke-tests: Fixing a message
by Jiří Pírko
commit b0b62cd5d4abd7b2c9cf7cbba937246ce31b0b1d
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Oct 9 11:05:48 2013 +0200
smoke-tests: Fixing a message
The action now goes before the arguments. This patch just changes this
in a message that is printed by the smoke tests generator.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/smoke/generate-recipes.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/recipes/smoke/generate-recipes.py b/recipes/smoke/generate-recipes.py
index 2361aab..bed434b 100755
--- a/recipes/smoke/generate-recipes.py
+++ b/recipes/smoke/generate-recipes.py
@@ -31,7 +31,7 @@ def print_test_usage():
print " +-----------+ +-----------+"
print "\nYou can execute the set using the following command:"
- print " ./lnst-ctl -d recipes/smoke/tests/ run"
+ print " ./lnst-ctl -d run recipes/smoke/tests/"
def replace_variables(recipe, name1, name2, variables):
vars = dict(variables.items("defaults"))
10 years, 1 month
[lnst] setup.py: Fixing website
by Jiří Pírko
commit e450e4df8256eb519d17041ee018976a51bdd12b
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Oct 9 10:27:04 2013 +0200
setup.py: Fixing website
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index a54b056..0a0c2e7 100755
--- a/setup.py
+++ b/setup.py
@@ -163,7 +163,7 @@ setup(name="lnst",
author_email="lnst-developers(a)lists.fedorahosted.org",
maintainer="Radek Pazdera",
maintainer_email="rpazdera(a)redhat.com",
- url="https://fedorahosted.org/lnst/",
+ url="http://lnst-project.org",
long_description=LONG_DESC,
platforms=["linux"],
license=["GNU GPLv2"],
10 years, 1 month
[lnst] install: Adding bash completion scripts
by Jiří Pírko
commit 2cebe137e01e949d592039847f9dfbf40b70aa99
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Oct 9 10:19:29 2013 +0200
install: Adding bash completion scripts
This commit adds bash completion scripts for both lnst-ctl and
lnst-slave. These scripts have to be installed to
/etc/bash_completion.d/
in order to work. These procedure was included into the setup.py
installation script that is a part of the package.
Issue #7: https://github.com/jpirko/lnst/issues/7
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
install/lnst-ctl.bash | 89 +++++++++++++++++++++++++++++++++++++++++++++++
install/lnst-slave.bash | 38 ++++++++++++++++++++
setup.py | 7 +++-
3 files changed, 133 insertions(+), 1 deletions(-)
---
diff --git a/install/lnst-ctl.bash b/install/lnst-ctl.bash
new file mode 100644
index 0000000..05a9b6d
--- /dev/null
+++ b/install/lnst-ctl.bash
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Bash completion script for lnst-ctl command
+# Author: Radek Pazdera <rpazdera(a)redhat.com>
+
+_list_has_item()
+{
+ for entry in $1; do
+ [ "$entry" == "$2" ] && return 0
+ done
+
+ return 1
+}
+
+_lnst_ctl()
+{
+ local SHORT_OPTS="-a -A -c -d -h -m -o -p -x"
+ local LONG_OPTS="--define-alias --override-alias --config --debug \
+ --help --no-colours --disable-pool-checks \
+ --packet-capture --result"
+ local REQUIRE_ARG="-a --define-alias \
+ -A --override-alias \
+ -c --config \
+ -x --result"
+ local ACTIONS="config_only match_setup run"
+
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ # Look for option arguments first
+ case "$prev" in
+ -a|--define-alias) return 0 ;;
+ -A|--override-alias) return 0 ;;
+ -c|--config)
+ _filedir
+ return 0
+ ;;
+ -x|--result)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ # Complete long and shor options
+ if [[ "$cur" == --* ]]; then
+ COMPREPLY=( $(compgen -W "$LONG_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s "$COMPREPLY" " ")
+ return 0
+ elif [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W "$SHORT_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s "$COMPREPLY" " ")
+ return 0
+ fi
+
+ # Check if the action positional argument has
+ # already been specified somewhere
+ for (( n=1; n < $COMP_CWORD; n++ )); do
+ local word=${COMP_WORDS[n]}
+ local prev_word=${COMP_WORDS[n-1]}
+
+ # Is it an option?
+ if [[ "$word" == --* ]] || [[ "$word" == -* ]]; then
+ continue
+ else
+ # Is the previous word an option that requires and argument?
+ _list_has_item "$REQUIRE_ARG" "$prev_word"
+ if [ $? -eq 0 ]; then
+ continue
+ else
+ # Is the positional argument an action?
+ _list_has_item "$ACTIONS" "$word"
+ if [ $? -eq 0 ]; then
+ # Action positional argument was found.
+ # Therefore, we will suggest files.
+ _filedir
+ return 0
+ fi
+ fi
+ fi
+ done
+
+ # No action defined yet, we will suggest actions.
+ COMPREPLY=( $(compgen -W "$ACTIONS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s "$COMPREPLY" " ")
+
+ return 0
+}
+
+complete -o nospace -F _lnst_ctl lnst-ctl
diff --git a/install/lnst-slave.bash b/install/lnst-slave.bash
new file mode 100644
index 0000000..d939d7a
--- /dev/null
+++ b/install/lnst-slave.bash
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Bash completion script for lnst-slave command
+# Author: Radek Pazdera <rpazdera(a)redhat.com>
+
+_lnst_slave()
+{
+ local SHORT_OPTS="-d -e -h -i -m -p"
+ local LONG_OPTS="--debug --daemonize --help --pidfile --no-colours --port"
+ local REQUIRE_ARG="-i --pidfile -p --port"
+
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ # Look for option arguments first
+ case "$prev" in
+ -i|--pidfile)
+ _filedir
+ return 0
+ ;;
+ -p|--port) return 0 ;;
+ esac
+
+ # Complete long and shor options
+ if [[ "$cur" == --* ]]; then
+ COMPREPLY=( $(compgen -W "$LONG_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s "$COMPREPLY" " ")
+ return 0
+ elif [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W "$SHORT_OPTS" -- $cur) )
+ [ ${#COMPREPLY[@]} = 1 ] && COMPREPLY=$(printf %q%s "$COMPREPLY" " ")
+ return 0
+ fi
+
+ return 0
+}
+
+complete -o nospace -F _lnst_slave lnst-slave
diff --git a/setup.py b/setup.py
index 3bb74bd..a54b056 100755
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,7 @@ def gzip_file(path):
# Various paths
CONF_DIR = "/etc/"
+BASH_COMP_DIR = CONF_DIR + "bash_completion.d/"
MAN_DIR = "/usr/share/man/man1/"
CTL_MODULES_LOCATIONS = "/usr/share/lnst/test_modules/"
@@ -147,9 +148,13 @@ MAN_PAGES = [(MAN_DIR, ["install/lnst-ctl.1.gz", "install/lnst-slave.1.gz"])]
CONFIG = [(CONF_DIR, ["install/lnst-ctl.conf", "install/lnst-slave.conf"])]
+BASH_COMP = [(BASH_COMP_DIR, ["install/lnst-ctl.bash",
+ "install/lnst-slave.bash"])]
+
SCHEMAS = [(CTL_RESOURCE_DIR, ["schema-recipe.rng", "schema-sm.rng"])]
-DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + SCHEMAS
+DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + \
+ SCHEMAS + BASH_COMP
setup(name="lnst",
version="git",
10 years, 1 month