[PATCH v2] recipes: Changing the 'machine' attr to 'host'
by Radek Pazdera
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>
---
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>
--
1.8.3.1
10 years, 1 month
[PATCH] XmlParser: Incorrect execption handling
by Radek Pazdera
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>
---
lnst/Common/XmlParser.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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
--
1.8.3.1
10 years, 1 month
[PATCH] smoke-tests: Fixing a message
by Radek Pazdera
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>
---
recipes/smoke/generate-recipes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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"))
--
1.8.3.1
10 years, 1 month
[PATCH] setup.py: Fixing website
by Radek Pazdera
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 3bb74bd..a655a16 100755
--- a/setup.py
+++ b/setup.py
@@ -158,7 +158,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"],
--
1.8.3.1
10 years, 1 month
[PATCH] recipes: Changing the 'machine' attr to 'host'
by Radek Pazdera
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>
---
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 f34d47d..22e5df8 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="3"/>
- <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>
\ No newline at end of file
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 a5012d9..81507cc 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,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_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>
--
1.8.3.1
10 years, 1 month
[PATCH v2] install: Adding bash completion scripts
by Radek Pazdera
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>
---
install/lnst-ctl.bash | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
install/lnst-slave.bash | 38 +++++++++++++++++++++
setup.py | 7 +++-
3 files changed, 133 insertions(+), 1 deletion(-)
create mode 100644 install/lnst-ctl.bash
create mode 100644 install/lnst-slave.bash
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",
--
1.8.3.1
10 years, 1 month
[lnst] Fix missing attribute from when running test tools in task
by Jiří Pírko
commit 690a1e8c90e1a8d272eac60f347ac0e907917211
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Tue Oct 8 15:06:28 2013 +0200
Fix missing attribute from when running test tools in task
We forgot to copy the "from" attribute when passing command to slave
machine for execution. This results in "command not found" since the
slave machine tries to execute the command without changing to test tool
directory.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestController.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index d0a53ae..bf241c1 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -319,6 +319,7 @@ class NetTestController:
tool = cmd_data["from"]
if tool in self._resource_table["tools"]:
cmd["command"] = cmd_data["command"]
+ cmd["from"] = cmd_data["from"]
else:
msg = "Tool '%s' not found on the controller" % tool
raise RecipeError(msg, cmd_data)
10 years, 1 month
[lnst] team recipes: bug fixes
by Jiří Pírko
commit 9fe2cd5c570a2aadaab9f0c704c3b6902038d92b
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Mon Oct 7 16:48:41 2013 +0200
team recipes: bug fixes
This patch fixes a few bugs that prevented some team recipes from
working.
The labels in "interfaces-team_lb.xml" are obvious- other files used
different ones.
I increased the wait time for "sequence_iperf.xml" because it sometimes
took longer for the iperf server to bind to the address.
I moved the information about the "testifc" in the "sequence_pktgen.xml"
to be the last one, because for some reason the pktgen won't work
properly if that interface is not the last one added for some recipes.
There were a few other problems that I've encountered but they were all
related to weird race conditions that were probably caused by the fact
that I'm using virtual machines. I'm leaving those unchanged, because
there isn't really any valid solution for them.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/team/interfaces-team_lb.xml | 6 +++---
recipes/team/sequence_iperf.xml | 4 ++--
recipes/team/sequence_pktgen.xml | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/recipes/team/interfaces-team_lb.xml b/recipes/team/interfaces-team_lb.xml
index a2c6407..79e9024 100644
--- a/recipes/team/interfaces-team_lb.xml
+++ b/recipes/team/interfaces-team_lb.xml
@@ -1,7 +1,7 @@
<interfaces>
- <eth id="1" label="1"/>
- <eth id="2" label="2"/>
- <eth id="3" label="3"/>
+ <eth id="1" label="net1"/>
+ <eth id="2" label="net2"/>
+ <eth id="3" label="net3"/>
<team id="testiface">
<options>
<option name="teamd_config">
diff --git a/recipes/team/sequence_iperf.xml b/recipes/team/sequence_iperf.xml
index f34d47d..e45f307 100644
--- a/recipes/team/sequence_iperf.xml
+++ b/recipes/team/sequence_iperf.xml
@@ -6,7 +6,7 @@
<option name="bind" value="{ip(2,testiface)}"/>
</options>
</run>
- <ctl_wait seconds="3"/>
+ <ctl_wait seconds="5"/>
<run machine="1" module="Iperf">
<options>
<option name="role" value="client"/>
@@ -15,4 +15,4 @@
</options>
</run>
<kill bg_id="1" machine="2"/>
-</task>
\ No newline at end of file
+</task>
diff --git a/recipes/team/sequence_pktgen.xml b/recipes/team/sequence_pktgen.xml
index a5012d9..e09c89c 100644
--- a/recipes/team/sequence_pktgen.xml
+++ b/recipes/team/sequence_pktgen.xml
@@ -12,10 +12,10 @@
<option name="pktgen_option" value="dst {ip(1,testiface)}"/>
<option name="pktgen_option" value="dst_mac 00:11:22:33:44:55"/>
<option name="pktgen_option" value="src_min {ip(2,testiface)}"/>
- <option name="netdev_name" value="{devname(2,testiface)}"/>
<option name="netdev_name" value="{devname(2,2)}"/>
<option name="netdev_name" value="{devname(2,3)}"/>
+ <option name="netdev_name" value="{devname(2,testiface)}"/>
</options>
</run>
<intr bg_id="1" machine="1"/>
-</task>
\ No newline at end of file
+</task>
10 years, 1 month
[PATCH] Fix missing attribute from when running test tools in task
by Jan Tluka
We forgot to copy the "from" attribute when passing command to slave
machine for execution. This results in "command not found" since the
slave machine tries to execute the command without changing to test tool
directory.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Controller/NetTestController.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index d0a53ae..bf241c1 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -319,6 +319,7 @@ class NetTestController:
tool = cmd_data["from"]
if tool in self._resource_table["tools"]:
cmd["command"] = cmd_data["command"]
+ cmd["from"] = cmd_data["from"]
else:
msg = "Tool '%s' not found on the controller" % tool
raise RecipeError(msg, cmd_data)
--
1.8.1.4
10 years, 1 month
[PATCH] install: Adding bash completion scripts
by Radek Pazdera
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>
---
install/lnst-ctl.bash | 89 +++++++++++++++++++++++++++++++++++++++++++++++++
install/lnst-slave.bash | 38 +++++++++++++++++++++
setup.py | 11 ++++--
3 files changed, 135 insertions(+), 3 deletions(-)
create mode 100644 install/lnst-ctl.bash
create mode 100644 install/lnst-slave.bash
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..d671048 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,18 +148,22 @@ 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",
+ version="1",
description="Linux Network Stack Test",
author="LNST Team",
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"],
--
1.8.3.1
10 years, 1 month