[lnst] Ticket #4: bg_id from int to string
by Jiří Pírko
commit 3a89a368245f391598e0d50c7b0e14a69178ffe1
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Aug 22 15:19:18 2012 +0200
Ticket #4: bg_id from int to string
Background ids are now treated as strings as well.
Changes were made to parsing of the attribute, and to formatting strings
where it is later used.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
NetTest/NetTestCommand.py | 16 ++++++++--------
NetTest/NetTestParse.py | 8 ++++----
2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/NetTest/NetTestCommand.py b/NetTest/NetTestCommand.py
index 5403621..e89f606 100644
--- a/NetTest/NetTestCommand.py
+++ b/NetTest/NetTestCommand.py
@@ -24,7 +24,7 @@ def str_command(command):
if "timeout" in command:
out += ", timeout (%d)" % command["timeout"]
if "bg_id" in command:
- out += ", bg_id (%d)" % command["bg_id"]
+ out += ", bg_id (%s)" % command["bg_id"]
if "desc" in command:
out += ", desc (%s)" % command["desc"]
return out
@@ -176,9 +176,9 @@ class NetTestCommandSystemConfig(NetTestCommandGeneric):
class NetTestCommandWait(NetTestCommandGeneric):
def run(self):
- bg_id = int(self._command["value"])
+ bg_id = self._command["value"]
pid = bg_processes.get_pid(bg_id)
- logging.debug("Waiting for background id \"%d\", pid \"%d\"" % (bg_id, pid))
+ logging.debug("Waiting for background id \"%s\", pid \"%d\"" % (bg_id, pid))
os.waitpid(pid, 0)
result = bg_processes.get_bg_process_result(bg_id)
bg_processes.remove(bg_id)
@@ -186,9 +186,9 @@ class NetTestCommandWait(NetTestCommandGeneric):
class NetTestCommandIntr(NetTestCommandGeneric):
def run(self):
- bg_id = int(self._command["value"])
+ bg_id = self._command["value"]
pid = bg_processes.get_pid(bg_id)
- logging.debug("Interrupting background id \"%d\", pid \"%d\"" % (bg_id, pid))
+ logging.debug("Interrupting background id \"%s\", pid \"%d\"" % (bg_id, pid))
os.killpg(os.getpgid(pid), signal.SIGINT)
os.waitpid(pid, 0)
result = bg_processes.get_bg_process_result(bg_id)
@@ -197,9 +197,9 @@ class NetTestCommandIntr(NetTestCommandGeneric):
class NetTestCommandKill(NetTestCommandGeneric):
def run(self):
- bg_id = int(self._command["value"])
+ bg_id = self._command["value"]
pid = bg_processes.get_pid(bg_id)
- logging.debug("Killing background id \"%d\", pid \"%d\"" % (bg_id, pid))
+ logging.debug("Killing background id \"%s\", pid \"%d\"" % (bg_id, pid))
os.killpg(os.getpgid(pid), signal.SIGKILL)
bg_processes.remove(bg_id)
self.set_result({"passed": True})
@@ -236,7 +236,7 @@ class NetTestCommand:
if pid:
os.close(write_pipe)
logging.debug("Running in background with"
- " id \"%d\", pid \"%d\"" % (bg_id, pid))
+ " id \"%s\", pid \"%d\"" % (bg_id, pid))
bg_processes.add(bg_id, pid, read_pipe)
return {"passed": True}
os.close(read_pipe)
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 542f820..21bfdd5 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -356,7 +356,7 @@ class CommandSequenceParse(RecipeParser):
cmd_type = command["type"]
if cmd_type in ["wait", "intr", "kill"]:
- bg_id = int(command["value"])
+ bg_id = command["value"]
if bg_id in bg_ids[machine_id]:
bg_ids[machine_id].remove(bg_id)
else:
@@ -370,14 +370,14 @@ class CommandSequenceParse(RecipeParser):
if not bg_id in bg_ids[machine_id]:
bg_ids[machine_id].add(bg_id)
else:
- logging.error("Command \"%d\" uses bg_id \"%d\" on machine "
+ logging.error("Command \"%d\" uses bg_id \"%s\" on machine "
"\"%s\" which is already used",
i, bg_id, machine_id)
err = True
for machine_id in bg_ids:
for bg_id in bg_ids[machine_id]:
- logging.error("bg_id \"%d\" on machine \"%s\" has no kill/wait "
+ logging.error("bg_id \"%s\" on machine \"%s\" has no kill/wait "
"command to it", bg_id, machine_id)
err = True
if err:
@@ -416,7 +416,7 @@ class CommandParse(RecipeParser):
command["timeout"] = self._get_attribute(node, "timeout", int)
if self._has_attribute(node, "bg_id"):
- command["bg_id"] = self._get_attribute(node, "bg_id", int)
+ command["bg_id"] = self._get_attribute(node, "bg_id")
if self._has_attribute(node, "desc"):
command["desc"] = self._get_attribute(node, "desc")
11 years, 3 months
[lnst] Ticket #4: interface_id from int to string
by Jiří Pírko
commit 0d841cd0dd1c083c1fc7fc516330bca2e551d959
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Aug 22 15:19:17 2012 +0200
Ticket #4: interface_id from int to string
Interface ids in tags <interface id=''> and <slave id=''> are
no longer converted to integers and are used as strings.
Introducing these changes requires a number of changes in formatted
strings where integers were required.
Interface id is also used as the second parameter in template functions
so these had to be changed as well.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Common/XmlTemplates.py | 8 ++++----
NetConfig/NetConfigDevNames.py | 2 +-
NetTest/NetTestController.py | 2 +-
NetTest/NetTestParse.py | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/Common/XmlTemplates.py b/Common/XmlTemplates.py
index 3b6c663..6afcc05 100644
--- a/Common/XmlTemplates.py
+++ b/Common/XmlTemplates.py
@@ -220,7 +220,7 @@ class XmlTemplates:
recipe = self._get_recipe_data("ip")
m_id = params[0]
- if_id = int(params[1])
+ if_id = params[1]
ip_id = int(params[2]) if len(params) == 3 else 0
if 'machines' not in recipe or m_id not in recipe['machines']:
@@ -247,7 +247,7 @@ class XmlTemplates:
self._validate_func_params("hwaddr", params, 2, 0)
recipe = self._get_recipe_data("hwaddr")
m_id = params[0]
- if_id = int(params[1])
+ if_id = params[1]
if 'machines' not in recipe or m_id not in recipe['machines']:
msg = "First parameter of function hwaddr() is invalid: "\
@@ -268,7 +268,7 @@ class XmlTemplates:
self._validate_func_params("devname", params, 2, 0)
recipe = self._get_recipe_data("devname")
m_id = params[0]
- if_id = int(params[1])
+ if_id = params[1]
if 'machines' not in recipe or m_id not in recipe['machines']:
msg = "First parameter of function devname() is invalid: "\
@@ -295,7 +295,7 @@ class XmlTemplates:
err = "Function %s takes %d arguments, %d passed" \
% (name, mandatory, num_params)
raise XmlTemplateError(err)
- for param in params[1:]:
+ for param in params[2:]:
try:
int(param)
except ValueError:
diff --git a/NetConfig/NetConfigDevNames.py b/NetConfig/NetConfigDevNames.py
index 0f246d9..581f9b8 100644
--- a/NetConfig/NetConfigDevNames.py
+++ b/NetConfig/NetConfigDevNames.py
@@ -33,7 +33,7 @@ class NetConfigDevNames:
if hwaddr == entry["hwaddr"]:
netdev["name"] = entry["name"]
if not "name" in netdev:
- logging.error("Name for addr \"%s\" (netdevice id \"%d\") not found"
+ logging.error("Name for addr \"%s\" (netdevice id \"%s\") not found"
% (hwaddr, dev_id))
raise Exception
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 9985523..c5a218c 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -172,7 +172,7 @@ class NetTestController:
def _prepare_interface(self, machine_id, netdev_config_id):
rpc = self._get_machinerpc(machine_id)
info = self._get_machineinfo(machine_id)
- logging.info("Configuring interface #%d on %s", netdev_config_id,
+ logging.info("Configuring interface %s on %s", netdev_config_id,
info["hostname"])
self._configure_interface(machine_id, netdev_config_id)
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 58e7b29..542f820 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -211,7 +211,7 @@ class NetConfigParse(RecipeParser):
netconfig = self._netconfig
devices = self._devices
- dev_id = self._get_attribute(node, "id", int)
+ dev_id = self._get_attribute(node, "id")
if not dev_id in netconfig:
netconfig[dev_id] = {}
else:
@@ -305,9 +305,9 @@ class NetConfigParse(RecipeParser):
def _slave(self, node, params):
if self._has_attribute(node, "id"):
- slave_id = self._get_attribute(node, "id", int)
+ slave_id = self._get_attribute(node, "id")
else:
- slave_id = self._get_text_content(node, int)
+ slave_id = self._get_text_content(node)
dev_id = params["dev_id"]
self._netconfig[dev_id]["slaves"].append(slave_id)
11 years, 3 months
[lnst] Ticket #4: phys_id from int to string
by Jiří Pírko
commit 08adb51f85c9d5ca011869cf9d8971708d05f63d
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Aug 22 15:19:16 2012 +0200
Ticket #4: phys_id from int to string
Physical id of devices is no longer converted to integer, and is used as
a string. Because of this a few formatted strings had to be changed to
expect strings and not integers.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
NetTest/NetTestController.py | 8 ++++----
NetTest/NetTestParse.py | 6 +++---
netconfig.py | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 2ff6a8a..9985523 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -131,7 +131,7 @@ class NetTestController:
br_name = brctl.get_name()
brctl.init()
- logging.info("Creating netdevice %d (%s) on machine %s",
+ logging.info("Creating netdevice %s (%s) on machine %s",
dev_id, dev["hwaddr"], machine_id)
domain_ctl = info["virt_domain_ctl"]
@@ -142,7 +142,7 @@ class NetTestController:
if not ready:
msg = "Netdevice initialization failed." \
- "Unable to create device %d (%s) on machine %s" \
+ "Unable to create device %s (%s) on machine %s" \
% (dev_id, dev["hwaddr"], machine_id)
raise NetTestError(msg)
@@ -154,7 +154,7 @@ class NetTestController:
if len(phys_devs) == 1:
pass
elif len(phys_devs) < 1:
- msg = "Device %d not found on machine %s" \
+ msg = "Device %s not found on machine %s" \
% (dev_id, machine_id)
raise NetTestError(msg)
elif len(phys_devs) > 1:
@@ -271,7 +271,7 @@ class NetTestController:
if "created_devices" not in info:
continue
for dev_id, dev in reversed(info["created_devices"]):
- logging.info("Removing netdevice %d (%s) from machine %s",
+ logging.info("Removing netdevice %s (%s) from machine %s",
dev_id, dev["hwaddr"], machine_id)
domain_ctl = info["virt_domain_ctl"]
domain_ctl.detach_interface(dev["hwaddr"])
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index b69eea3..58e7b29 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -160,7 +160,7 @@ class NetMachineConfigParse(RecipeParser):
def _netdevice(self, node, params):
machine = self._machine
- phys_id = self._get_attribute(node, "phys_id", int)
+ phys_id = self._get_attribute(node, "phys_id")
dev = machine["netdevices"][phys_id] = {}
dev["create"] = params["create"]
@@ -248,7 +248,7 @@ class NetConfigParse(RecipeParser):
devices = self._devices
if dev["type"] == "eth":
- phys_id = self._get_attribute(node, "phys_id", int)
+ phys_id = self._get_attribute(node, "phys_id")
self._check_phys_id(node, phys_id, netconfig)
dev["phys_id"] = phys_id
@@ -271,7 +271,7 @@ class NetConfigParse(RecipeParser):
if not "phys_id" in config[key]:
continue
if config[key]["phys_id"] == dev_pid:
- msg = "same phys_id \"%d\" used more than once" % dev_pid
+ msg = "same phys_id \"%s\" used more than once" % dev_pid
raise XmlProcessingError(msg, node)
def _addresses(self, node, params):
diff --git a/netconfig.py b/netconfig.py
index 9551ac6..c0baf97 100755
--- a/netconfig.py
+++ b/netconfig.py
@@ -91,7 +91,7 @@ def netmachineconfig_to_xml(machine_data):
devices = ""
for phys_id, netdev in machine_data["netdevices"].iteritems():
- pid = "phys_id=\"%d\" " % phys_id
+ pid = "phys_id=\"%s\" " % phys_id
dev_type = ""
name = ""
hwaddr = ""
11 years, 3 months
[lnst] Ticket #4: machine_id from int to string
by Jiří Pírko
commit 90a28e7e52523165116a613c0f8eba6a1f127dad
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Aug 22 15:19:15 2012 +0200
Ticket #4: machine_id from int to string
Machine ids in tags <machine id=''> and <command machine_id=''> are no
longer converted to integers and are used as strings.
Introducing these changes requires a number of changes in formatted
strings where integers were required.
Machine id is also used as the first parameter in template functions so
these had to be changed as well.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Common/XmlTemplates.py | 8 ++++----
NetTest/NetTestCommand.py | 2 +-
NetTest/NetTestController.py | 16 ++++++++--------
NetTest/NetTestParse.py | 12 ++++++------
4 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/Common/XmlTemplates.py b/Common/XmlTemplates.py
index a3be062..3b6c663 100644
--- a/Common/XmlTemplates.py
+++ b/Common/XmlTemplates.py
@@ -219,7 +219,7 @@ class XmlTemplates:
self._validate_func_params("ip", params, 2, 1)
recipe = self._get_recipe_data("ip")
- m_id = int(params[0])
+ m_id = params[0]
if_id = int(params[1])
ip_id = int(params[2]) if len(params) == 3 else 0
@@ -246,7 +246,7 @@ class XmlTemplates:
def _hwaddr_func(self, params):
self._validate_func_params("hwaddr", params, 2, 0)
recipe = self._get_recipe_data("hwaddr")
- m_id = int(params[0])
+ m_id = params[0]
if_id = int(params[1])
if 'machines' not in recipe or m_id not in recipe['machines']:
@@ -267,7 +267,7 @@ class XmlTemplates:
def _devname_func(self, params):
self._validate_func_params("devname", params, 2, 0)
recipe = self._get_recipe_data("devname")
- m_id = int(params[0])
+ m_id = params[0]
if_id = int(params[1])
if 'machines' not in recipe or m_id not in recipe['machines']:
@@ -295,7 +295,7 @@ class XmlTemplates:
err = "Function %s takes %d arguments, %d passed" \
% (name, mandatory, num_params)
raise XmlTemplateError(err)
- for param in params:
+ for param in params[1:]:
try:
int(param)
except ValueError:
diff --git a/NetTest/NetTestCommand.py b/NetTest/NetTestCommand.py
index ae1297f..5403621 100644
--- a/NetTest/NetTestCommand.py
+++ b/NetTest/NetTestCommand.py
@@ -19,7 +19,7 @@ import pickle, traceback
from Common.ExecCmd import exec_cmd, ExecCmdFail
def str_command(command):
- out = ("type (%s), machine_id (%d), value (%s)"
+ out = ("type (%s), machine_id (%s), value (%s)"
% (command["type"], command["machine_id"], command["value"]))
if "timeout" in command:
out += ", timeout (%d)" % command["timeout"]
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 1f86eba..2ff6a8a 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -103,7 +103,7 @@ class NetTestController:
if dev["create"] == "libvirt":
if not "virt_domain_ctl" in info:
msg = "Cannot create device. " \
- "Machine '%d' is not virtual." % (machine_id)
+ "Machine '%s' is not virtual." % (machine_id)
raise NetTestError(msg)
if "hwaddr" in dev:
@@ -131,7 +131,7 @@ class NetTestController:
br_name = brctl.get_name()
brctl.init()
- logging.info("Creating netdevice %d (%s) on machine %d",
+ logging.info("Creating netdevice %d (%s) on machine %s",
dev_id, dev["hwaddr"], machine_id)
domain_ctl = info["virt_domain_ctl"]
@@ -142,7 +142,7 @@ class NetTestController:
if not ready:
msg = "Netdevice initialization failed." \
- "Unable to create device %d (%s) on machine %d" \
+ "Unable to create device %d (%s) on machine %s" \
% (dev_id, dev["hwaddr"], machine_id)
raise NetTestError(msg)
@@ -154,11 +154,11 @@ class NetTestController:
if len(phys_devs) == 1:
pass
elif len(phys_devs) < 1:
- msg = "Device %d not found on machine %d" \
+ msg = "Device %d not found on machine %s" \
% (dev_id, machine_id)
raise NetTestError(msg)
elif len(phys_devs) > 1:
- msg = "Multiple netdevices with same address %s on machine %d" \
+ msg = "Multiple netdevices with same address %s on machine %s" \
% (dev["hwaddr"], machine_id)
raise NetTestError(msg)
@@ -196,7 +196,7 @@ class NetTestController:
rpc.deconfigure_interface(netdev_config_id)
def _prepare_slave(self, machine_id):
- logging.info("Preparing machine #%d", machine_id)
+ logging.info("Preparing machine %s", machine_id)
info = self._get_machineinfo(machine_id)
if "libvirt_domain" in info:
@@ -271,7 +271,7 @@ class NetTestController:
if "created_devices" not in info:
continue
for dev_id, dev in reversed(info["created_devices"]):
- logging.info("Removing netdevice %d (%s) from machine %d",
+ logging.info("Removing netdevice %d (%s) from machine %s",
dev_id, dev["hwaddr"], machine_id)
domain_ctl = info["virt_domain_ctl"]
domain_ctl.detach_interface(dev["hwaddr"])
@@ -309,7 +309,7 @@ class NetTestController:
except KeyError:
pass
- if machine_id == 0:
+ if machine_id == "0":
cmd_res = NetTestCommand(command).run()
else:
rpc = self._get_machinerpc(machine_id)
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 7af2084..b69eea3 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -86,7 +86,7 @@ class MachineParse(RecipeParser):
raise XmlProcessingError("Unknown machine type")
def parse(self, node):
- self._id = self._get_attribute(node, "id", int)
+ self._id = self._get_attribute(node, "id")
self._machine = {}
self._recipe[self._target][self._id] = self._machine
@@ -361,7 +361,7 @@ class CommandSequenceParse(RecipeParser):
bg_ids[machine_id].remove(bg_id)
else:
logging.error("Found command \"%s\" for bg_id \"%s\" on "
- "machine \"%d\" which was not previously "
+ "machine \"%s\" which was not previously "
"defined", cmd_type, bg_id, machine_id)
err = True
@@ -371,13 +371,13 @@ class CommandSequenceParse(RecipeParser):
bg_ids[machine_id].add(bg_id)
else:
logging.error("Command \"%d\" uses bg_id \"%d\" on machine "
- "\"%d\" which is already used",
+ "\"%s\" which is already used",
i, bg_id, machine_id)
err = True
for machine_id in bg_ids:
for bg_id in bg_ids[machine_id]:
- logging.error("bg_id \"%d\" on machine \"%d\" has no kill/wait "
+ logging.error("bg_id \"%d\" on machine \"%s\" has no kill/wait "
"command to it", bg_id, machine_id)
err = True
if err:
@@ -399,11 +399,11 @@ class CommandParse(RecipeParser):
self._cmd_num = len(recipe["sequences"][self._seq_num]["commands"]) - 1
if self._has_attribute(node, "machine_id"):
- machine_id = self._get_attribute(node, "machine_id", int)
+ machine_id = self._get_attribute(node, "machine_id")
if machine_id and not machine_id in recipe["machines"]:
raise XmlProcessingError("Invalid machine_id", node)
else:
- machine_id = 0 # controller id
+ machine_id = "0" # controller id
command["machine_id"] = machine_id
command["type"] = self._get_attribute(node, "type")
11 years, 3 months
[lnst] multicast: Move from example_recipes to recipes
by Jiří Pírko
commit b4c14c99b518ffa66f18db18effe4c6b4dc41d6e
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Aug 22 13:57:29 2012 +0200
multicast: Move from example_recipes to recipes
Multicast tests were moved from exmaples to more appropriate location
in the newly created recipes directory.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
.../multicast/cmd_sequences}/block_source.xml | 0
.../multicast/cmd_sequences}/if.xml | 0
.../multicast/cmd_sequences}/loop.xml | 0
.../multicast/cmd_sequences}/max_groups.xml | 0
.../multicast/cmd_sequences}/membership.xml | 0
.../multicast/cmd_sequences}/simple.xml | 0
.../multicast/cmd_sequences}/source_membership.xml | 0
.../multicast/cmd_sequences}/ttl.xml | 0
.../multicast/multicast-all.xml | 36 +++++++++++++++-----
9 files changed, 27 insertions(+), 9 deletions(-)
---
diff --git a/example_recipes/cmd_sequences/multicast/block_source.xml b/recipes/multicast/cmd_sequences/block_source.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/block_source.xml
rename to recipes/multicast/cmd_sequences/block_source.xml
diff --git a/example_recipes/cmd_sequences/multicast/if.xml b/recipes/multicast/cmd_sequences/if.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/if.xml
rename to recipes/multicast/cmd_sequences/if.xml
diff --git a/example_recipes/cmd_sequences/multicast/loop.xml b/recipes/multicast/cmd_sequences/loop.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/loop.xml
rename to recipes/multicast/cmd_sequences/loop.xml
diff --git a/example_recipes/cmd_sequences/multicast/max_groups.xml b/recipes/multicast/cmd_sequences/max_groups.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/max_groups.xml
rename to recipes/multicast/cmd_sequences/max_groups.xml
diff --git a/example_recipes/cmd_sequences/multicast/membership.xml b/recipes/multicast/cmd_sequences/membership.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/membership.xml
rename to recipes/multicast/cmd_sequences/membership.xml
diff --git a/example_recipes/cmd_sequences/multicast/simple.xml b/recipes/multicast/cmd_sequences/simple.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/simple.xml
rename to recipes/multicast/cmd_sequences/simple.xml
diff --git a/example_recipes/cmd_sequences/multicast/source_membership.xml b/recipes/multicast/cmd_sequences/source_membership.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/source_membership.xml
rename to recipes/multicast/cmd_sequences/source_membership.xml
diff --git a/example_recipes/cmd_sequences/multicast/ttl.xml b/recipes/multicast/cmd_sequences/ttl.xml
similarity index 100%
rename from example_recipes/cmd_sequences/multicast/ttl.xml
rename to recipes/multicast/cmd_sequences/ttl.xml
diff --git a/example_recipes/rpazdera-multicast.xml b/recipes/multicast/multicast-all.xml
similarity index 56%
rename from example_recipes/rpazdera-multicast.xml
rename to recipes/multicast/multicast-all.xml
index 9f1d68c..f4dc82c 100644
--- a/example_recipes/rpazdera-multicast.xml
+++ b/recipes/multicast/multicast-all.xml
@@ -1,34 +1,52 @@
-<!-- Example test scenario using multicast test tools -->
+<!-- Execute all tests for multicast -->
<nettestrecipe>
+ <!-- Change these parameters to match your test environment setup -->
+ <define>
+ <alias name="hostname1" value="192.168.122.11"/>
+ <alias name="virtdomain1" value="RHEL6"/>
+
+ <alias name="hostname2" value="192.168.122.10"/>
+ <alias name="virtdomain2" value="Fedora16-clone"/>
+ </define>
<machines>
<machine id="1">
<netmachineconfig>
- <info hostname="10.34.1.120" rootpass="redhat"/>
- <netdevice hwaddr="52:54:00:2E:D5:A8" id="1" phys_id="1" type="eth"/>
- <netdevice hwaddr="52:54:00:90:23:0B" id="2" phys_id="2" type="eth"/>
+ <info hostname="{$hostname1}" libvirt_domain="{$virtdomain1}"
+ rootpass="redhat"/>
+ <netdevices>
+ <libvirt_create>
+ <netdevice network="tnet" phys_id="1" type="eth"/>
+ <netdevice network="tnet" phys_id="2" type="eth"/>
+ </libvirt_create>
+ </netdevices>
</netmachineconfig>
<netconfig>
<interface id="1" phys_id="1" type="eth">
<addresses>
- <address value="192.168.122.225/24"/>
+ <address value="192.168.100.226/24"/>
</addresses>
</interface>
<interface id="2" phys_id="2" type="eth">
<addresses>
- <address value="192.168.122.239/24"/>
+ <address value="192.168.100.240/24"/>
</addresses>
</interface>
</netconfig>
</machine>
<machine id="2">
<netmachineconfig>
- <info hostname="10.34.1.171" rootpass="redhat"/>
- <netdevice hwaddr="52:54:00:12:DF:5A" id="1" phys_id="1" type="eth"/>
+ <info hostname="{$hostname2}" libvirt_domain="{$virtdomain2}"
+ rootpass="redhat"/>
+ <netdevices>
+ <libvirt_create>
+ <netdevice network="tnet" phys_id="1" type="eth"/>
+ </libvirt_create>
+ </netdevices>
</netmachineconfig>
<netconfig>
<interface id="1" phys_id="1" type="eth">
<addresses>
- <address value="192.168.122.200/24"/>
+ <address value="192.168.100.215/24"/>
</addresses>
</interface>
</netconfig>
11 years, 3 months
[lnst] NetTestController: Fix race in _prepare_device()
by Jiří Pírko
commit af16c5e000926d42222c0d5651f19db522c59153
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Aug 22 13:37:29 2012 +0200
NetTestController: Fix race in _prepare_device()
This commit fixes possible race condition in _prepare_device()
that can occur when dynamically attaching interfaces to a libvirt
domain.
In case the interface already exists the call of wait_for can return
prematurely and then the following device check will not fail.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestController.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index b39939e..1f86eba 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -106,8 +106,18 @@ class NetTestController:
"Machine '%d' is not virtual." % (machine_id)
raise NetTestError(msg)
- if not "hwaddr" in dev:
- dev["hwaddr"] = self._mac_pool.get_addr()
+ if "hwaddr" in dev:
+ query_result = rpc.get_devices_by_hwaddr(dev["hwaddr"])
+ if query_result:
+ msg = "Device with hwaddr %s already exists" \
+ % dev["hwaddr"]
+ raise NetTestError(msg)
+ else:
+ while True:
+ dev["hwaddr"] = self._mac_pool.get_addr()
+ query_result = rpc.get_devices_by_hwaddr(dev["hwaddr"])
+ if not len(query_result):
+ break
if "target_bridge" in dev:
brctl = BridgeCtl(dev["target_bridge"])
11 years, 3 months
[lnst] system_config: Config restore regression fix
by Jiří Pírko
commit 14095e8e11ff8beaf5fdbef0879d2cae21c92539
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Aug 22 12:39:39 2012 +0200
system_config: Config restore regression fix
This commit fixes a regression in config restoration on
command sequence termination.
The command sequence format has changed recently, which occured
in changing of _run_command_sequence() method. This method is used
in the system config restoration to avoid code duplication, because
it does all the necessary error checking.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestController.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index c70e252..b39939e 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -461,5 +461,6 @@ class NetTestController:
for option, values in system_config.iteritems():
command["options"][option] = [{"value": values["initial_val"]}]
- self._run_command_sequence([command])
+ seq = {"commands": [command], "quit_on_fail": "no"}
+ self._run_command_sequence(seq)
info["system_config"] = {}
11 years, 3 months
[PATCH] multicast: Move from example_recipes to recipes
by Radek Pazdera
Multicast tests were moved from exmaples to more appropriate location
in the newly created recipes directory.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
.../cmd_sequences/multicast/block_source.xml | 77 --------------
example_recipes/cmd_sequences/multicast/if.xml | 75 -------------
example_recipes/cmd_sequences/multicast/loop.xml | 69 ------------
.../cmd_sequences/multicast/max_groups.xml | 22 ----
.../cmd_sequences/multicast/membership.xml | 47 ---------
example_recipes/cmd_sequences/multicast/simple.xml | 31 ------
.../cmd_sequences/multicast/source_membership.xml | 82 ---------------
example_recipes/cmd_sequences/multicast/ttl.xml | 110 --------------------
example_recipes/rpazdera-multicast.xml | 54 ----------
recipes/multicast/cmd_sequences/block_source.xml | 77 ++++++++++++++
recipes/multicast/cmd_sequences/if.xml | 75 +++++++++++++
recipes/multicast/cmd_sequences/loop.xml | 69 ++++++++++++
recipes/multicast/cmd_sequences/max_groups.xml | 22 ++++
recipes/multicast/cmd_sequences/membership.xml | 47 +++++++++
recipes/multicast/cmd_sequences/simple.xml | 31 ++++++
.../multicast/cmd_sequences/source_membership.xml | 82 +++++++++++++++
recipes/multicast/cmd_sequences/ttl.xml | 110 ++++++++++++++++++++
recipes/multicast/multicast-all.xml | 72 +++++++++++++
18 files changed, 585 insertions(+), 567 deletions(-)
delete mode 100644 example_recipes/cmd_sequences/multicast/block_source.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/if.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/loop.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/max_groups.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/membership.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/simple.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/source_membership.xml
delete mode 100644 example_recipes/cmd_sequences/multicast/ttl.xml
delete mode 100644 example_recipes/rpazdera-multicast.xml
create mode 100644 recipes/multicast/cmd_sequences/block_source.xml
create mode 100644 recipes/multicast/cmd_sequences/if.xml
create mode 100644 recipes/multicast/cmd_sequences/loop.xml
create mode 100644 recipes/multicast/cmd_sequences/max_groups.xml
create mode 100644 recipes/multicast/cmd_sequences/membership.xml
create mode 100644 recipes/multicast/cmd_sequences/simple.xml
create mode 100644 recipes/multicast/cmd_sequences/source_membership.xml
create mode 100644 recipes/multicast/cmd_sequences/ttl.xml
create mode 100644 recipes/multicast/multicast-all.xml
diff --git a/example_recipes/cmd_sequences/multicast/block_source.xml b/example_recipes/cmd_sequences/multicast/block_source.xml
deleted file mode 100644
index f351a79..0000000
--- a/example_recipes/cmd_sequences/multicast/block_source.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<!-- IP_BLOCK/UNBLOCK_SOURCE test -->
-<!-- Requires: 2 hosts with one interface each -->
-<!-- NOTICE: IGMP packets must be forwarded through the network!
- In kvm/libvirt environment, iptables on host must be off or
- configured to forward igmp traffic through the bridge -->
-<command_sequence>
- <!-- IP_BLOCK/UNBLOCK_SOURCE sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_block_source"/>
- <option name="condition" value="status == 'pass'"/>
- </options>
- </command>
-
- <!-- Block source in the middle of ongoing communication -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="238.0.0.1"/>
- <option name="port" value="1337"/>
- <option name="duration" value="10"/>
- <option name="delay" value="0.1"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_block_source"/>
- <option name="address" value="238.0.0.1"/>
- <option name="port" value="1337"/>
- <option name="duration" value="10"/>
- <option name="interface" value="{ip(2,1)}"/>
- <option name="source" value="{ip(1,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- <option name="condition" value="packets_received_while_blocking == 0"/>
- </options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- Nonexistent source -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="238.0.0.1"/>
- <option name="port" value="1337"/>
- <option name="duration" value="10"/>
- <option name="delay" value="0.1"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_block_source"/>
- <option name="address" value="238.0.0.1"/>
- <option name="port" value="1337"/>
- <option name="duration" value="10"/>
- <option name="interface" value="{ip(2,1)}"/>
- <option name="source" value="127.0.0.200"/>
-
- <option name="condition" value="packets_received > 0"/>
- <option name="condition" value="packets_received_while_blocking > 0"/>
- </options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
-
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/if.xml b/example_recipes/cmd_sequences/multicast/if.xml
deleted file mode 100644
index dfd1108..0000000
--- a/example_recipes/cmd_sequences/multicast/if.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<!-- IP_MULTICAST_IF test --><!-- Requires: 2 hosts
- - [1] with one interface
- - [2] with one interface
- - -->
-<command_sequence>
- <!-- IP_MULTICAST_IF sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_if"/>
-
- <!-- This condition doesn't pass yet because of a
- bug in the syscal. #803202 on RedHat Bugzilla -->
- <!-- <option name="condition" value="status == 'pass'" /> -->
- </options>
- </command>
-
- <!-- IP_MULTICAST_IF correct interfaces set -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- IP_MULTICAST_IF incorrect interfaces set -->
- <command machine_id="1" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="127.0.0.1"/>
-
- <option name="condition" value="packets_received == 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/loop.xml b/example_recipes/cmd_sequences/multicast/loop.xml
deleted file mode 100644
index d4b57d6..0000000
--- a/example_recipes/cmd_sequences/multicast/loop.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<!-- Offline IP_MULTICAST_LOOP test -->
-<!-- Requires: 1 hosts with at least two interfaces -->
-<command_sequence>
- <!-- IP_MULTICAST_LOOP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_loop"/>
- <option name="condition" value="status == 'pass'"/>
- </options>
- </command>
-
- <!-- IP_MULTICAST_LOOP enabled -->
- <command machine_id="1" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="loop" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(1,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- IP_MULTICAST_LOOP disabled -->
- <command machine_id="1" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="loop" value="0"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(1,1)}"/>
-
- <option name="condition" value="packets_received == 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/max_groups.xml b/example_recipes/cmd_sequences/multicast/max_groups.xml
deleted file mode 100644
index a27197f..0000000
--- a/example_recipes/cmd_sequences/multicast/max_groups.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- Offline maximum number of groups test -->
-<!-- Requires: 1 host with one interface -->
-<command_sequence>
- <!-- With a specific interface -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="max_groups"/>
- <option name="interface" value="{ip(1,1)}"/>
- <option name="condition" value="max_groups > 0"/>
- </options>
- </command>
-
- <!-- Change default max_memberhsips -->
- <command machine_id="1" option="/proc/sys/net/ipv4/igmp_max_memberships" type="system_config" value="5"/>
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="max_groups"/>
- <option name="interface" value="{ip(1,1)}"/>
- <option name="condition" value="max_groups == 5"/>
- </options>
- </command>
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/membership.xml b/example_recipes/cmd_sequences/multicast/membership.xml
deleted file mode 100644
index b4c63be..0000000
--- a/example_recipes/cmd_sequences/multicast/membership.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<!-- IP_ADD/DROP_MEMBERSHIP test -->
-<!-- Requires: 2 hosts
- - [1] with one interface
- - [2] with one interface
- - -->
-<command_sequence>
- <!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_membership"/>
- <option name="condition" value="status == 'pass'"/>
- </options>
- </command>
-
- <!-- 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. -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_membership"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- <option name="condition" value="packets_received_after_drop == 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/simple.xml b/example_recipes/cmd_sequences/multicast/simple.xml
deleted file mode 100644
index 88cddd1..0000000
--- a/example_recipes/cmd_sequences/multicast/simple.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- Requires: 2 hosts with at least one interface -->
-<!-- ['machines'][2]['netconfig'][1]['addresses'][0] -->
-<command_sequence>
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/source_membership.xml b/example_recipes/cmd_sequences/multicast/source_membership.xml
deleted file mode 100644
index a659e74..0000000
--- a/example_recipes/cmd_sequences/multicast/source_membership.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<!-- IP_ADD/DROP_SOURCE_MEMBERSHIP test -->
-<!-- Requires: 2 hosts
- - [1] with one interface
- - [2] with one interface
- - -->
-<!-- NOTICE: IGMP packets must be forwarded through the network!
- In kvm/libvirt environment, iptables on host must be off or
- configured to forward igmp traffic through the bridge -->
-<command_sequence>
- <!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_source_membership"/>
- <option name="condition" value="status == 'pass'"/>
- </options>
- </command>
-
- <!-- 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. -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_source_membership"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
- <option name="source" value="{ip(1,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- <option name="condition" value="packets_received_after_drop == 0"/>
- </options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- Nonexistent source -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_source_membership"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
- <option name="source" value="127.0.0.200"/>
-
- <option name="condition" value="packets_received == 0"/>
- <option name="condition" value="packets_received_after_drop == 0"/>
- </options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
-
-</command_sequence>
diff --git a/example_recipes/cmd_sequences/multicast/ttl.xml b/example_recipes/cmd_sequences/multicast/ttl.xml
deleted file mode 100644
index 72d0759..0000000
--- a/example_recipes/cmd_sequences/multicast/ttl.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<!-- Offline IP_MULTICAST_TTL test --><!-- Requires: 2 hosts
- - [1] with one interface
- - [2] with one interface
- - -->
-<command_sequence>
- <!-- IP_MULTICAST_TTL sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="sockopt_ttl"/>
- <option name="condition" value="status == 'pass'"/>
- </options>
- </command>
-
- <!-- IP_MULTICAST_TTL = 0, looped on one host -->
- <command machine_id="1" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="0"/>
- <option name="loop" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(1,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- IP_MULTICAST_TTL = 0 between 2 hosts -->
- <!-- KNOWN BUG: according to the specs, packets
- with TTL=0 should not leave the host.
-
- Well it does, it's an intentional hack for some
- apps [1].
-
- http://www.spinics.net/lists/netdev/msg183704.html
- -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="0"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-
- <!-- IP_MULTICAST_TTL = 1 between 2 hosts -->
- <command machine_id="1" type="exec" value="sleep 1"/>
-
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="send_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="delay" value="{$send_delay}"/>
- <option name="ttl" value="1"/>
- <option name="interface" value="{ip(1,1)}"/>
- </options>
- </command>
-
- <command machine_id="2" timeout="30" type="test" value="Multicast">
- <options>
- <option name="setup" value="recv_simple"/>
- <option name="address" value="{$multicast_group}"/>
- <option name="port" value="{$port}"/>
- <option name="duration" value="{$test_duration}"/>
- <option name="interface" value="{ip(2,1)}"/>
-
- <option name="condition" value="packets_received > 0"/>
- </options>
- </command>
-
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
diff --git a/example_recipes/rpazdera-multicast.xml b/example_recipes/rpazdera-multicast.xml
deleted file mode 100644
index 9f1d68c..0000000
--- a/example_recipes/rpazdera-multicast.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<!-- Example test scenario using multicast test tools -->
-<nettestrecipe>
- <machines>
- <machine id="1">
- <netmachineconfig>
- <info hostname="10.34.1.120" rootpass="redhat"/>
- <netdevice hwaddr="52:54:00:2E:D5:A8" id="1" phys_id="1" type="eth"/>
- <netdevice hwaddr="52:54:00:90:23:0B" id="2" phys_id="2" type="eth"/>
- </netmachineconfig>
- <netconfig>
- <interface id="1" phys_id="1" type="eth">
- <addresses>
- <address value="192.168.122.225/24"/>
- </addresses>
- </interface>
- <interface id="2" phys_id="2" type="eth">
- <addresses>
- <address value="192.168.122.239/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
- <machine id="2">
- <netmachineconfig>
- <info hostname="10.34.1.171" rootpass="redhat"/>
- <netdevice hwaddr="52:54:00:12:DF:5A" id="1" phys_id="1" type="eth"/>
- </netmachineconfig>
- <netconfig>
- <interface id="1" phys_id="1" type="eth">
- <addresses>
- <address value="192.168.122.200/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
- </machines>
-
- <define>
- <alias name="multicast_group" value="239.1.2.3"/>
- <alias name="port" value="1337"/>
- <alias name="test_duration" value="10"/>
- <alias name="send_delay" value="0.1"/>
- <alias name="nonexistent_ip" value="127.0.0.200"/>
- </define>
-
- <command_sequence source="cmd_sequences/multicast/max_groups.xml"/>
- <command_sequence source="cmd_sequences/multicast/block_source.xml"/>
- <command_sequence source="cmd_sequences/multicast/source_membership.xml"/>
- <command_sequence source="cmd_sequences/multicast/membership.xml"/>
- <command_sequence source="cmd_sequences/multicast/if.xml"/>
- <command_sequence source="cmd_sequences/multicast/ttl.xml"/>
- <command_sequence source="cmd_sequences/multicast/loop.xml"/>
- <command_sequence source="cmd_sequences/multicast/simple.xml"/>
-</nettestrecipe>
diff --git a/recipes/multicast/cmd_sequences/block_source.xml b/recipes/multicast/cmd_sequences/block_source.xml
new file mode 100644
index 0000000..f351a79
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/block_source.xml
@@ -0,0 +1,77 @@
+<!-- IP_BLOCK/UNBLOCK_SOURCE test -->
+<!-- Requires: 2 hosts with one interface each -->
+<!-- NOTICE: IGMP packets must be forwarded through the network!
+ In kvm/libvirt environment, iptables on host must be off or
+ configured to forward igmp traffic through the bridge -->
+<command_sequence>
+ <!-- IP_BLOCK/UNBLOCK_SOURCE sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_block_source"/>
+ <option name="condition" value="status == 'pass'"/>
+ </options>
+ </command>
+
+ <!-- Block source in the middle of ongoing communication -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="238.0.0.1"/>
+ <option name="port" value="1337"/>
+ <option name="duration" value="10"/>
+ <option name="delay" value="0.1"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_block_source"/>
+ <option name="address" value="238.0.0.1"/>
+ <option name="port" value="1337"/>
+ <option name="duration" value="10"/>
+ <option name="interface" value="{ip(2,1)}"/>
+ <option name="source" value="{ip(1,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_while_blocking == 0"/>
+ </options>
+ </command>
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- Nonexistent source -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="238.0.0.1"/>
+ <option name="port" value="1337"/>
+ <option name="duration" value="10"/>
+ <option name="delay" value="0.1"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_block_source"/>
+ <option name="address" value="238.0.0.1"/>
+ <option name="port" value="1337"/>
+ <option name="duration" value="10"/>
+ <option name="interface" value="{ip(2,1)}"/>
+ <option name="source" value="127.0.0.200"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_while_blocking > 0"/>
+ </options>
+ </command>
+ <command machine_id="1" type="wait" value="1"/>
+
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/if.xml b/recipes/multicast/cmd_sequences/if.xml
new file mode 100644
index 0000000..dfd1108
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/if.xml
@@ -0,0 +1,75 @@
+<!-- IP_MULTICAST_IF test --><!-- Requires: 2 hosts
+ - [1] with one interface
+ - [2] with one interface
+ - -->
+<command_sequence>
+ <!-- IP_MULTICAST_IF sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_if"/>
+
+ <!-- This condition doesn't pass yet because of a
+ bug in the syscal. #803202 on RedHat Bugzilla -->
+ <!-- <option name="condition" value="status == 'pass'" /> -->
+ </options>
+ </command>
+
+ <!-- IP_MULTICAST_IF correct interfaces set -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- IP_MULTICAST_IF incorrect interfaces set -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="127.0.0.1"/>
+
+ <option name="condition" value="packets_received == 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/loop.xml b/recipes/multicast/cmd_sequences/loop.xml
new file mode 100644
index 0000000..d4b57d6
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/loop.xml
@@ -0,0 +1,69 @@
+<!-- Offline IP_MULTICAST_LOOP test -->
+<!-- Requires: 1 hosts with at least two interfaces -->
+<command_sequence>
+ <!-- IP_MULTICAST_LOOP sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_loop"/>
+ <option name="condition" value="status == 'pass'"/>
+ </options>
+ </command>
+
+ <!-- IP_MULTICAST_LOOP enabled -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="loop" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(1,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- IP_MULTICAST_LOOP disabled -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="loop" value="0"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(1,1)}"/>
+
+ <option name="condition" value="packets_received == 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/max_groups.xml b/recipes/multicast/cmd_sequences/max_groups.xml
new file mode 100644
index 0000000..a27197f
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/max_groups.xml
@@ -0,0 +1,22 @@
+<!-- Offline maximum number of groups test -->
+<!-- Requires: 1 host with one interface -->
+<command_sequence>
+ <!-- With a specific interface -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="max_groups"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ <option name="condition" value="max_groups > 0"/>
+ </options>
+ </command>
+
+ <!-- Change default max_memberhsips -->
+ <command machine_id="1" option="/proc/sys/net/ipv4/igmp_max_memberships" type="system_config" value="5"/>
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="max_groups"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ <option name="condition" value="max_groups == 5"/>
+ </options>
+ </command>
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/membership.xml b/recipes/multicast/cmd_sequences/membership.xml
new file mode 100644
index 0000000..b4c63be
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/membership.xml
@@ -0,0 +1,47 @@
+<!-- IP_ADD/DROP_MEMBERSHIP test -->
+<!-- Requires: 2 hosts
+ - [1] with one interface
+ - [2] with one interface
+ - -->
+<command_sequence>
+ <!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_membership"/>
+ <option name="condition" value="status == 'pass'"/>
+ </options>
+ </command>
+
+ <!-- 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. -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_membership"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/simple.xml b/recipes/multicast/cmd_sequences/simple.xml
new file mode 100644
index 0000000..88cddd1
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/simple.xml
@@ -0,0 +1,31 @@
+<!-- Requires: 2 hosts with at least one interface -->
+<!-- ['machines'][2]['netconfig'][1]['addresses'][0] -->
+<command_sequence>
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/source_membership.xml b/recipes/multicast/cmd_sequences/source_membership.xml
new file mode 100644
index 0000000..a659e74
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/source_membership.xml
@@ -0,0 +1,82 @@
+<!-- IP_ADD/DROP_SOURCE_MEMBERSHIP test -->
+<!-- Requires: 2 hosts
+ - [1] with one interface
+ - [2] with one interface
+ - -->
+<!-- NOTICE: IGMP packets must be forwarded through the network!
+ In kvm/libvirt environment, iptables on host must be off or
+ configured to forward igmp traffic through the bridge -->
+<command_sequence>
+ <!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_source_membership"/>
+ <option name="condition" value="status == 'pass'"/>
+ </options>
+ </command>
+
+ <!-- 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. -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_source_membership"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+ <option name="source" value="{ip(1,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
+ </options>
+ </command>
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- Nonexistent source -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_source_membership"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+ <option name="source" value="127.0.0.200"/>
+
+ <option name="condition" value="packets_received == 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
+ </options>
+ </command>
+ <command machine_id="1" type="wait" value="1"/>
+
+</command_sequence>
diff --git a/recipes/multicast/cmd_sequences/ttl.xml b/recipes/multicast/cmd_sequences/ttl.xml
new file mode 100644
index 0000000..72d0759
--- /dev/null
+++ b/recipes/multicast/cmd_sequences/ttl.xml
@@ -0,0 +1,110 @@
+<!-- Offline IP_MULTICAST_TTL test --><!-- Requires: 2 hosts
+ - [1] with one interface
+ - [2] with one interface
+ - -->
+<command_sequence>
+ <!-- IP_MULTICAST_TTL sockopt conformance test -->
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="sockopt_ttl"/>
+ <option name="condition" value="status == 'pass'"/>
+ </options>
+ </command>
+
+ <!-- IP_MULTICAST_TTL = 0, looped on one host -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="0"/>
+ <option name="loop" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(1,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- IP_MULTICAST_TTL = 0 between 2 hosts -->
+ <!-- KNOWN BUG: according to the specs, packets
+ with TTL=0 should not leave the host.
+
+ Well it does, it's an intentional hack for some
+ apps [1].
+
+ http://www.spinics.net/lists/netdev/msg183704.html
+ -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="0"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+
+ <!-- IP_MULTICAST_TTL = 1 between 2 hosts -->
+ <command machine_id="1" type="exec" value="sleep 1"/>
+
+ <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="send_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="delay" value="{$send_delay}"/>
+ <option name="ttl" value="1"/>
+ <option name="interface" value="{ip(1,1)}"/>
+ </options>
+ </command>
+
+ <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <options>
+ <option name="setup" value="recv_simple"/>
+ <option name="address" value="{$multicast_group}"/>
+ <option name="port" value="{$port}"/>
+ <option name="duration" value="{$test_duration}"/>
+ <option name="interface" value="{ip(2,1)}"/>
+
+ <option name="condition" value="packets_received > 0"/>
+ </options>
+ </command>
+
+ <command machine_id="1" type="wait" value="1"/>
+</command_sequence>
diff --git a/recipes/multicast/multicast-all.xml b/recipes/multicast/multicast-all.xml
new file mode 100644
index 0000000..f4dc82c
--- /dev/null
+++ b/recipes/multicast/multicast-all.xml
@@ -0,0 +1,72 @@
+<!-- Execute all tests for multicast -->
+<nettestrecipe>
+ <!-- Change these parameters to match your test environment setup -->
+ <define>
+ <alias name="hostname1" value="192.168.122.11"/>
+ <alias name="virtdomain1" value="RHEL6"/>
+
+ <alias name="hostname2" value="192.168.122.10"/>
+ <alias name="virtdomain2" value="Fedora16-clone"/>
+ </define>
+ <machines>
+ <machine id="1">
+ <netmachineconfig>
+ <info hostname="{$hostname1}" libvirt_domain="{$virtdomain1}"
+ rootpass="redhat"/>
+ <netdevices>
+ <libvirt_create>
+ <netdevice network="tnet" phys_id="1" type="eth"/>
+ <netdevice network="tnet" phys_id="2" type="eth"/>
+ </libvirt_create>
+ </netdevices>
+ </netmachineconfig>
+ <netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <addresses>
+ <address value="192.168.100.226/24"/>
+ </addresses>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <addresses>
+ <address value="192.168.100.240/24"/>
+ </addresses>
+ </interface>
+ </netconfig>
+ </machine>
+ <machine id="2">
+ <netmachineconfig>
+ <info hostname="{$hostname2}" libvirt_domain="{$virtdomain2}"
+ rootpass="redhat"/>
+ <netdevices>
+ <libvirt_create>
+ <netdevice network="tnet" phys_id="1" type="eth"/>
+ </libvirt_create>
+ </netdevices>
+ </netmachineconfig>
+ <netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <addresses>
+ <address value="192.168.100.215/24"/>
+ </addresses>
+ </interface>
+ </netconfig>
+ </machine>
+ </machines>
+
+ <define>
+ <alias name="multicast_group" value="239.1.2.3"/>
+ <alias name="port" value="1337"/>
+ <alias name="test_duration" value="10"/>
+ <alias name="send_delay" value="0.1"/>
+ <alias name="nonexistent_ip" value="127.0.0.200"/>
+ </define>
+
+ <command_sequence source="cmd_sequences/multicast/max_groups.xml"/>
+ <command_sequence source="cmd_sequences/multicast/block_source.xml"/>
+ <command_sequence source="cmd_sequences/multicast/source_membership.xml"/>
+ <command_sequence source="cmd_sequences/multicast/membership.xml"/>
+ <command_sequence source="cmd_sequences/multicast/if.xml"/>
+ <command_sequence source="cmd_sequences/multicast/ttl.xml"/>
+ <command_sequence source="cmd_sequences/multicast/loop.xml"/>
+ <command_sequence source="cmd_sequences/multicast/simple.xml"/>
+</nettestrecipe>
--
1.7.7.6
11 years, 3 months
[PATCH] NetTestController: Fix race in _prepare_device()
by Radek Pazdera
This commit fixes possible race condition in _prepare_device()
that can occur when dynamically attaching interfaces to a libvirt
domain.
In case the interface already exists the call of wait_for can return
prematurely and then the following device check will not fail.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
NetTest/NetTestController.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index c70e252..c0ebb96 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -106,8 +106,18 @@ class NetTestController:
"Machine '%d' is not virtual." % (machine_id)
raise NetTestError(msg)
- if not "hwaddr" in dev:
- dev["hwaddr"] = self._mac_pool.get_addr()
+ if "hwaddr" in dev:
+ query_result = rpc.get_devices_by_hwaddr(dev["hwaddr"])
+ if query_result:
+ msg = "Device with hwaddr %s already exists" \
+ % dev["hwaddr"]
+ raise NetTestError(msg)
+ else:
+ while True:
+ dev["hwaddr"] = self._mac_pool.get_addr()
+ query_result = rpc.get_devices_by_hwaddr(dev["hwaddr"])
+ if not len(query_result):
+ break
if "target_bridge" in dev:
brctl = BridgeCtl(dev["target_bridge"])
--
1.7.7.6
11 years, 3 months
[PATCH] system_config: Config restore regression fix
by Radek Pazdera
This commit fixes a regression in config restoration on
command sequence termination.
The command sequence format has changed recently, which occured
in changing of _run_command_sequence() method. This method is used
in the system config restoration to avoid code duplication, because
it does all the necessary error checking.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
NetTest/NetTestController.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index c70e252..b39939e 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -461,5 +461,6 @@ class NetTestController:
for option, values in system_config.iteritems():
command["options"][option] = [{"value": values["initial_val"]}]
- self._run_command_sequence([command])
+ seq = {"commands": [command], "quit_on_fail": "no"}
+ self._run_command_sequence(seq)
info["system_config"] = {}
--
1.7.7.6
11 years, 3 months