[PATCH] NetConfig: Small code cleanup
by Radek Pazdera
From: Radek Pazdera <rpazdera(a)redhat.com>
This commit merges type_init() function with add_interface_config() and
type_cleanup() with remove_interface_config().
These functions had too dangerous preconditions, which was not very
obvious. The preconditions disappear after the merge.
Also an info entry will be written to the log when a device class is
initialized or cleaned up.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
NetConfig/NetConfig.py | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index 57903cd..6e97478 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -58,23 +58,24 @@ class NetConfig:
types.add(netdev["type"])
return types
- def _type_init(self, dev_type):
+ def add_interface_config(self, if_id, config):
+ dev_type = config["type"]
if not dev_type in self._get_used_types():
+ logging.info("Initializing '%s' device class", dev_type)
NetConfigDeviceType(dev_type).type_init()
- def _type_cleanup(self, dev_type):
- if not dev_type in self._get_used_types():
- NetConfigDeviceType(dev_type).type_cleanup()
-
- def add_interface_config(self, if_id, config):
- self._type_init(config["type"])
self._config[if_id] = config
self._devnames.assign_name(if_id, self._config)
def remove_interface_config(self, if_id):
config = self._config[if_id]
del self._config[if_id]
- self._type_cleanup(config["type"])
+ print self._config
+
+ dev_type = config["type"]
+ if not dev_type in self._get_used_types():
+ logging.info("Cleaning up '%s' device class.", dev_type)
+ NetConfigDeviceType(dev_type).type_cleanup()
def get_interface_config(self, if_id):
return self._config[if_id]
--
1.7.7.6
11 years, 4 months
[lnst] NetConfig: Small code cleanup
by Jiří Pírko
commit 2587cd9176895a27e13dc10558f1e00847edab05
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Jul 31 11:54:44 2012 +0200
NetConfig: Small code cleanup
This commit merges type_init() function with add_interface_config() and
type_cleanup() with remove_interface_config().
These functions had too dangerous preconditions, which was not very
obvious. The preconditions disappear after the merge.
Also an info entry will be written to the log when a device class is
initialized or cleaned up.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetConfig/NetConfig.py | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index 57903cd..6e97478 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -58,23 +58,24 @@ class NetConfig:
types.add(netdev["type"])
return types
- def _type_init(self, dev_type):
+ def add_interface_config(self, if_id, config):
+ dev_type = config["type"]
if not dev_type in self._get_used_types():
+ logging.info("Initializing '%s' device class", dev_type)
NetConfigDeviceType(dev_type).type_init()
- def _type_cleanup(self, dev_type):
- if not dev_type in self._get_used_types():
- NetConfigDeviceType(dev_type).type_cleanup()
-
- def add_interface_config(self, if_id, config):
- self._type_init(config["type"])
self._config[if_id] = config
self._devnames.assign_name(if_id, self._config)
def remove_interface_config(self, if_id):
config = self._config[if_id]
del self._config[if_id]
- self._type_cleanup(config["type"])
+ print self._config
+
+ dev_type = config["type"]
+ if not dev_type in self._get_used_types():
+ logging.info("Cleaning up '%s' device class.", dev_type)
+ NetConfigDeviceType(dev_type).type_cleanup()
def get_interface_config(self, if_id):
return self._config[if_id]
11 years, 4 months
[lnst] misc: Adding recipe_conv script
by Jiří Pírko
commit 8c335bde7192512b038f7d7c06ca5bf43f27f1e4
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Mon Jul 30 12:21:13 2012 +0200
misc: Adding recipe_conv script
misc directory was created to store things related to LNST, which doesn't
fit into any other existing directory.
recipe_conv.py was added to the directory right away. It's a helper
script, that will convert any unsupported features found in recipes
to their supported equivalents.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
misc/recipe_conv.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 0 deletions(-)
---
diff --git a/misc/recipe_conv.py b/misc/recipe_conv.py
new file mode 100755
index 0000000..9bfc74e
--- /dev/null
+++ b/misc/recipe_conv.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+"""
+Recipe converter
+
+This script will help you convert your old recipes with the
+outdated conventions that are now unsupported in LNST.
+
+You can pass a list of files or dirs to it and it will
+remove all recipe-evals and change netdevices in netconfig
+to interfaces.
+
+Copyright 2012 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+rpazdera(a)redhat.com (Radek Pazdera)
+"""
+
+import sys
+import os
+import re
+from xml.dom.minidom import parse
+
+def change_netdev_to_iface(dom):
+ configs = dom.getElementsByTagName("netconfig")
+ for config in configs:
+ netdevs = config.getElementsByTagName("netdevice")
+ for dev in netdevs:
+ dev.tagName = "interface"
+
+def remove_recipe_eval(dom):
+ opts = dom.getElementsByTagName("option")
+ for opt in opts:
+ if opt.hasAttribute("type"):
+ opt_type = opt.getAttribute("type")
+ if opt_type == "recipe_eval":
+ opt.removeAttribute("type")
+ subscript = opt.getAttribute("value")
+ opt.setAttribute("value", "{$recipe%s}" % subscript)
+
+def convert_recipe(file_path):
+ dom = parse(file_path)
+
+ change_netdev_to_iface(dom)
+ remove_recipe_eval(dom)
+
+ output = dom.toxml()
+ output = re.sub(r"<\?xml[^>]*\?>", "", output)
+
+ writer = open(file_path, "w")
+ writer.write(output)
+ writer.close()
+
+def usage():
+ print "Usage: %s recipe1 recipe2 dir1 ..." % sys.argv[0]
+
+def main():
+ if len(sys.argv) <= 1 or "-h" in sys.argv:
+ usage()
+ return 0
+
+ files = sys.argv[1:]
+
+ for file_path in files:
+ if os.path.isdir(file_path):
+ for root, dirs, file_names in os.walk(file_path):
+ for file_name in file_names:
+ if re.match(r"^.*\.xml$", file_name):
+ full_path = "%s/%s" % (root, file_name)
+ full_path = os.path.normpath(full_path)
+ print "Converting %s" % full_path
+ convert_recipe(full_path)
+ else:
+ print "Converting %s" % file_path
+ convert_recipe(file_path)
+ return 0
+
+if __name__ == "__main__":
+ rv = main()
+ sys.exit(rv)
11 years, 4 months
Recipe Convertor Script
by Radek Pazdera
Hi!
In the last patch I changed the "netdevice" in netconfig to "interface".
This patch will probably break all your recipes, so I decided to make
a sipmle script, that you can use to convert your recipes automatically
to the new conventions.
Make sure you backup the recipes first (just in case)!
Radek :)
11 years, 4 months
[lnst] Do proper cleanup when requested.
by Jiří Pírko
commit b66c235f0aa73d186b0242b20674d2cefe7ddae6
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Jul 25 20:28:50 2012 +0200
Do proper cleanup when requested.
NetConfig/NetConfig.py | 6 ++++++
NetTest/NetTestSlave.py | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index 3561205..57903cd 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -150,3 +150,9 @@ class NetConfig:
device = NetConfigDevice(netdev, self._config)
device.slave_del(slave_dev_id)
return True
+
+ def cleanup(self):
+ tmp = copy.deepcopy(self._config)
+ for dev_id in tmp:
+ del self._config[dev_id]
+ self._devnames.rescan_netdevs()
diff --git a/NetTest/NetTestSlave.py b/NetTest/NetTestSlave.py
index 1746452..12440f7 100644
--- a/NetTest/NetTestSlave.py
+++ b/NetTest/NetTestSlave.py
@@ -111,6 +111,7 @@ class NetTestSlaveXMLRPC:
def machine_cleanup(self):
NetConfigDeviceAllCleanup()
+ self._netconfig.cleanup()
return True
class MySimpleXMLRPCServer(Server):
11 years, 4 months
[lnst] Adding rescan method to reinitialize scanned devices.
by Jiří Pírko
commit f4911d859c215c9b7d9d911d29e85ce541ebf5e7
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Jul 25 20:28:49 2012 +0200
Adding rescan method to reinitialize scanned devices.
NetConfig/NetConfigDevNames.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/NetConfig/NetConfigDevNames.py b/NetConfig/NetConfigDevNames.py
index 1619b7e..1220480 100644
--- a/NetConfig/NetConfigDevNames.py
+++ b/NetConfig/NetConfigDevNames.py
@@ -39,6 +39,9 @@ class NetConfigDevNames:
scan.append({"name": d, "hwaddr": addr})
return scan
+ def rescan_netdevs(self):
+ self._scan = self._scan_netdevs()
+
def assign_name_by_scan(self, dev_id, netdev):
if (not "hwaddr" in netdev or
"name" in netdev): # name was previously assigned
11 years, 4 months
[lnst] Move _docleanup out from slave xmlrpc initialization
by Jiří Pírko
commit eb42ef66316cf2eb4ae761a7dba132c86f7a7600
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Jul 25 20:28:48 2012 +0200
Move _docleanup out from slave xmlrpc initialization
NetTest/NetTestController.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 6c047d3..4e34c90 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -114,6 +114,11 @@ class NetTestController:
info["configured_interfaces"] = []
+ rpc = self._get_machinerpc(machine_id)
+
+ if self._docleanup:
+ rpc.machine_cleanup()
+
def _init_slave_session(self, machine_id):
info = self._get_machineinfo(machine_id)
hostname = info["hostname"]
@@ -145,9 +150,6 @@ class NetTestController:
logging.error("Handshake error with machine %s", hostname)
raise Exception("Hanshake error")
- if self._docleanup:
- rpc.machine_cleanup()
-
info["rpc"] = rpc
def _init_slave_logging(self, machine_id):
11 years, 4 months
[lnst] example_recipes: Apply new conventions to examples
by Jiří Pírko
commit a3722ce6c11315bd41f18e064e72818e8973fe77
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 25 13:45:48 2012 +0200
example_recipes: Apply new conventions to examples
This patch modifies all the example recipes to the new conventions,
i.e., removes any recipe_evals and changes the 'netdevice' to
'interface' within netconfigs.
*WARNING*
I didn't touch recipes in jpirko_test and jtluka_test, because I
don't want to break anything in your recipes, if you use them.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
example_recipes/cmd_sequences/memory_pressure.xml | 22 ++--
.../cmd_sequences/multicast/block_source.xml | 87 +++++++--------
example_recipes/cmd_sequences/multicast/if.xml | 78 +++++++-------
example_recipes/cmd_sequences/multicast/loop.xml | 75 ++++++-------
.../cmd_sequences/multicast/max_groups.xml | 20 ++--
.../cmd_sequences/multicast/membership.xml | 45 ++++----
example_recipes/cmd_sequences/multicast/simple.xml | 35 +++---
.../cmd_sequences/multicast/source_membership.xml | 87 +++++++--------
example_recipes/cmd_sequences/multicast/ttl.xml | 116 ++++++++++----------
example_recipes/cmd_sequences/netcat-sequence.xml | 49 ++++----
example_recipes/cmd_sequences/sequence1.xml | 8 +-
.../machine_configs/config-f14peanut.xml | 6 +-
example_recipes/net_configs/netconfig1.xml | 11 +-
example_recipes/net_configs/netconfig2.xml | 11 +-
example_recipes/net_configs/netconfig3.xml | 15 +--
example_recipes/net_configs/netconfig4.xml | 9 +-
example_recipes/net_configs/netconfig5.xml | 15 +--
example_recipes/net_configs/netconfig6.xml | 19 ++--
example_recipes/net_configs/netconfig7.xml | 9 +-
example_recipes/net_configs/team1.xml | 28 +++---
example_recipes/packet_assert.xml | 18 ++--
example_recipes/recipe1.xml | 17 ++--
example_recipes/recipe2.xml | 25 ++--
example_recipes/recipe3.xml | 9 +-
example_recipes/recipe4.xml | 3 +-
example_recipes/recipe5.xml | 9 +-
example_recipes/recipe6.xml | 9 +-
example_recipes/rpazdera-multicast.xml | 54 +++++-----
28 files changed, 432 insertions(+), 457 deletions(-)
---
diff --git a/example_recipes/cmd_sequences/memory_pressure.xml b/example_recipes/cmd_sequences/memory_pressure.xml
index 2ba4c48..f1d1678 100644
--- a/example_recipes/cmd_sequences/memory_pressure.xml
+++ b/example_recipes/cmd_sequences/memory_pressure.xml
@@ -1,22 +1,22 @@
<command_sequence>
- <command type='test' value='Iperf' machine_id='2' bg_id="1">
+ <command bg_id="1" machine_id="2" type="test" value="Iperf">
<options>
<option name="role" value="server"/>
- <option name="bind" value="192.168.122.102" />
+ <option name="bind" value="192.168.122.102"/>
<option name="duration" value="3600"/>
</options>
</command>
- <command type='exec' value='sleep 30' />
- <command type='test' value='Iperf' machine_id='1' bg_id="1">
+ <command type="exec" value="sleep 30"/>
+ <command bg_id="1" machine_id="1" type="test" value="Iperf">
<options>
<option name="role" value="client"/>
- <option name="iperf_server" value="192.168.122.102" />
+ <option name="iperf_server" value="192.168.122.102"/>
<option name="duration" value="120"/>
</options>
</command>
- <command type='exec' value='sleep 30' />
- <command type='exec' value="fb=`free -b | grep Mem: | sed 's/[ ]\+/ /g' | cut -f4 -d' '`; stress -m 10 --vm-bytes $(( $fb / 10 ))" machine_id='1' bg_id='2'/>
- <command type='wait' machine_id='1' value='1'/>
- <command type='kill' machine_id='1' value='2' />
- <command type='kill' machine_id='2' value='1' />
-</command_sequence>
+ <command type="exec" value="sleep 30"/>
+ <command bg_id="2" machine_id="1" type="exec" value="fb=`free -b | grep Mem: | sed 's/[ ]\+/ /g' | cut -f4 -d' '`; stress -m 10 --vm-bytes $(( $fb / 10 ))"/>
+ <command machine_id="1" type="wait" value="1"/>
+ <command machine_id="1" type="kill" value="2"/>
+ <command machine_id="2" type="kill" value="1"/>
+</command_sequence>
\ No newline at end of file
diff --git a/example_recipes/cmd_sequences/multicast/block_source.xml b/example_recipes/cmd_sequences/multicast/block_source.xml
index 72d0fd2..f351a79 100644
--- a/example_recipes/cmd_sequences/multicast/block_source.xml
+++ b/example_recipes/cmd_sequences/multicast/block_source.xml
@@ -3,76 +3,75 @@
<!-- 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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_block_source" />
- <option name="condition" value="status == 'pass'" />
+ <option name="setup" value="sockopt_block_source"/>
+ <option name="condition" value="status == 'pass'"/>
</options>
</command>
<!-- Block source in the middle of ongoing communication -->
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_while_blocking == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- Nonexistent source -->
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_while_blocking > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index a81557c..dfd1108 100644
--- a/example_recipes/cmd_sequences/multicast/if.xml
+++ b/example_recipes/cmd_sequences/multicast/if.xml
@@ -1,14 +1,12 @@
-<!-- IP_MULTICAST_IF test -->
-<!-- Requires: 2 hosts
+<!-- IP_MULTICAST_IF test --><!-- Requires: 2 hosts
- [1] with one interface
- [2] with one interface
- -->
-
<command_sequence>
<!-- IP_MULTICAST_IF sockopt conformance test -->
- <command type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_if" />
+ <option name="setup" value="sockopt_if"/>
<!-- This condition doesn't pass yet because of a
bug in the syscal. #803202 on RedHat Bugzilla -->
@@ -17,61 +15,61 @@
</command>
<!-- IP_MULTICAST_IF correct interfaces set -->
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- IP_MULTICAST_IF incorrect interfaces set -->
- <command type="exec" machine_id="1" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index ceac21c..d4b57d6 100644
--- a/example_recipes/cmd_sequences/multicast/loop.xml
+++ b/example_recipes/cmd_sequences/multicast/loop.xml
@@ -1,70 +1,69 @@
<!-- Offline IP_MULTICAST_LOOP test -->
<!-- Requires: 1 hosts with at least two interfaces -->
-
<command_sequence>
<!-- IP_MULTICAST_LOOP sockopt conformance test -->
- <command type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_loop" />
- <option name="condition" value="status == 'pass'" />
+ <option name="setup" value="sockopt_loop"/>
+ <option name="condition" value="status == 'pass'"/>
</options>
</command>
<!-- IP_MULTICAST_LOOP enabled -->
- <command type="exec" machine_id="1" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- IP_MULTICAST_LOOP disabled -->
- <command type="exec" machine_id="1" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index a2d1a25..a27197f 100644
--- a/example_recipes/cmd_sequences/multicast/max_groups.xml
+++ b/example_recipes/cmd_sequences/multicast/max_groups.xml
@@ -1,24 +1,22 @@
<!-- Offline maximum number of groups test -->
<!-- Requires: 1 host with one interface -->
-
<command_sequence>
<!-- With a specific interface -->
- <command type="test" value="Multicast" machine_id="1" timeout="30">
+ <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" />
+ <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 type="system_config" option="/proc/sys/net/ipv4/igmp_max_memberships" value="5" machine_id="1" />
- <command type="test" value="Multicast" machine_id="1" timeout="30">
+ <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" />
+ <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
index 3136e2f..b4c63be 100644
--- a/example_recipes/cmd_sequences/multicast/membership.xml
+++ b/example_recipes/cmd_sequences/multicast/membership.xml
@@ -3,46 +3,45 @@
- [1] with one interface
- [2] with one interface
- -->
-
<command_sequence>
<!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <command type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_membership" />
- <option name="condition" value="status == 'pass'" />
+ <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 type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index 7455201..88cddd1 100644
--- a/example_recipes/cmd_sequences/multicast/simple.xml
+++ b/example_recipes/cmd_sequences/multicast/simple.xml
@@ -1,32 +1,31 @@
<!-- Requires: 2 hosts with at least one interface -->
<!-- ['machines'][2]['netconfig'][1]['addresses'][0] -->
-
<command_sequence>
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index ffda96f..a659e74 100644
--- a/example_recipes/cmd_sequences/multicast/source_membership.xml
+++ b/example_recipes/cmd_sequences/multicast/source_membership.xml
@@ -6,78 +6,77 @@
<!-- 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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_source_membership" />
- <option name="condition" value="status == 'pass'" />
+ <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 type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- Nonexistent source -->
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received == 0"/>
+ <option name="condition" value="packets_received_after_drop == 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <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
index d0fe197..72d0759 100644
--- a/example_recipes/cmd_sequences/multicast/ttl.xml
+++ b/example_recipes/cmd_sequences/multicast/ttl.xml
@@ -1,47 +1,45 @@
-<!-- Offline IP_MULTICAST_TTL test -->
-<!-- Requires: 2 hosts
+<!-- 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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="Multicast">
<options>
- <option name="setup" value="sockopt_ttl" />
- <option name="condition" value="status == 'pass'" />
+ <option name="setup" value="sockopt_ttl"/>
+ <option name="condition" value="status == 'pass'"/>
</options>
</command>
<!-- IP_MULTICAST_TTL = 0, looped on one host -->
- <command type="exec" machine_id="1" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="1" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- IP_MULTICAST_TTL = 0 between 2 hosts -->
<!-- KNOWN BUG: according to the specs, packets
@@ -52,61 +50,61 @@
http://www.spinics.net/lists/netdev/msg183704.html
-->
- <command type="exec" machine_id="1" value="sleep 1" />
- <command type="exec" machine_id="2" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
+ <command machine_id="2" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
<!-- IP_MULTICAST_TTL = 1 between 2 hosts -->
- <command type="exec" machine_id="1" value="sleep 1" />
+ <command machine_id="1" type="exec" value="sleep 1"/>
- <command type="test" value="Multicast" machine_id="1" timeout="30" bg_id="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)}" />
+ <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 type="test" value="Multicast" machine_id="2" timeout="30">
+ <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="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" />
+ <option name="condition" value="packets_received > 0"/>
</options>
</command>
- <command type="wait" machine_id="1" value="1" />
+ <command machine_id="1" type="wait" value="1"/>
</command_sequence>
diff --git a/example_recipes/cmd_sequences/netcat-sequence.xml b/example_recipes/cmd_sequences/netcat-sequence.xml
index 12acccc..06113a0 100644
--- a/example_recipes/cmd_sequences/netcat-sequence.xml
+++ b/example_recipes/cmd_sequences/netcat-sequence.xml
@@ -1,38 +1,37 @@
<command_sequence>
- <command type="exec" machine_id="2" value="nc -l 1234" bg_id="1" />
- <command type="exec" machine_id="1" value="sleep 5" />
- <command type="test" machine_id="1" value="NetCat">
+ <command bg_id="1" machine_id="2" type="exec" value="nc -l 1234"/>
+ <command machine_id="1" type="exec" value="sleep 5"/>
+ <command machine_id="1" type="test" value="NetCat">
<options>
- <option type="recipe_eval" name="addr" value="['machines'][2]['netconfig'][1]['addresses'][0]" />
- <option name="port" value="1234" />
+ <option name="addr" value="{ip(2,1)}"/>
+ <option name="port" value="1234"/>
</options>
</command>
- <command type="kill" machine_id="2" value="1" />
+ <command machine_id="2" type="kill" value="1"/>
- <command type="exec" machine_id="2" value="nc -u -l 1234" bg_id="2" />
- <command type="exec" machine_id="1" value="sleep 5" />
- <command type="test" machine_id="1" value="NetCat">
+ <command bg_id="2" machine_id="2" type="exec" value="nc -u -l 1234"/>
+ <command machine_id="1" type="exec" value="sleep 5"/>
+ <command machine_id="1" type="test" value="NetCat">
<options>
- <option type="recipe_eval" name="addr" value="['machines'][2]['netconfig'][1]['addresses'][0]" />
- <option name="port" value="1234" />
- <option name="duration" value="10" />
- <option name="stream" value="udp" />
- <option name="ipv" value="4" />
+ <option name="addr" value="{ip(2,1)}"/>
+ <option name="port" value="1234"/>
+ <option name="duration" value="10"/>
+ <option name="stream" value="udp"/>
+ <option name="ipv" value="4"/>
</options>
</command>
- <command type="kill" machine_id="2" value="2" />
+ <command machine_id="2" type="kill" value="2"/>
- <command type="exec" machine_id="2" value="nc -l 1234" bg_id="3" />
- <command type="exec" machine_id="1" value="sleep 5" />
- <command type="test" machine_id="1" value="NetCat">
+ <command bg_id="3" machine_id="2" type="exec" value="nc -l 1234"/>
+ <command machine_id="1" type="exec" value="sleep 5"/>
+ <command machine_id="1" type="test" value="NetCat">
<options>
- <option type="recipe_eval" name="addr" value="['machines'][2]['netconfig'][1]['addresses'][0]" />
- <option name="port" value="1234" />
- <option name="duration" value="10" />
- <option name="stream" value="tcp" />
- <option name="ipv" value="4" />
+ <option name="addr" value="{ip(2,1)}"/>
+ <option name="port" value="1234"/>
+ <option name="duration" value="10"/>
+ <option name="stream" value="tcp"/>
+ <option name="ipv" value="4"/>
</options>
</command>
- <command type="kill" machine_id="2" value="3" />
+ <command machine_id="2" type="kill" value="3"/>
</command_sequence>
-
diff --git a/example_recipes/cmd_sequences/sequence1.xml b/example_recipes/cmd_sequences/sequence1.xml
index 66755ad..fdb8abd 100644
--- a/example_recipes/cmd_sequences/sequence1.xml
+++ b/example_recipes/cmd_sequences/sequence1.xml
@@ -1,10 +1,10 @@
<command_sequence>
- <command type="exec" value="xeyes" bg_id="1"/>
+ <command bg_id="1" type="exec" value="xeyes"/>
<command type="exec" value="sleep 2"/>
<command type="kill" value="1"/>
- <command type="exec" value="ping www.redhat.com -c 2" bg_id="1"/>
+ <command bg_id="1" type="exec" value="ping www.redhat.com -c 2"/>
<command type="wait" value="1"/>
- <command type="exec" value="xeyes" bg_id="1"/>
+ <command bg_id="1" type="exec" value="xeyes"/>
<command type="exec" value="sleep 2"/>
<command type="kill" value="1"/>
-</command_sequence>
+</command_sequence>
\ No newline at end of file
diff --git a/example_recipes/machine_configs/config-f14peanut.xml b/example_recipes/machine_configs/config-f14peanut.xml
index ec9eed2..4d0aac3 100644
--- a/example_recipes/machine_configs/config-f14peanut.xml
+++ b/example_recipes/machine_configs/config-f14peanut.xml
@@ -1,5 +1,5 @@
<netmachineconfig>
<info hostname="10.34.37.141" rootpass="aaa"/>
- <netdevice type="eth" phys_id="1" hwaddr="00:E0:4C:14:2E:5D"/>
- <netdevice type="eth" phys_id="2" hwaddr="00:30:4F:7F:FD:30"/>
-</netmachineconfig>
+ <netdevice hwaddr="00:E0:4C:14:2E:5D" phys_id="1" type="eth"/>
+ <netdevice hwaddr="00:30:4F:7F:FD:30" phys_id="2" type="eth"/>
+</netmachineconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig1.xml b/example_recipes/net_configs/netconfig1.xml
index 728590f..ec0ec80 100644
--- a/example_recipes/net_configs/netconfig1.xml
+++ b/example_recipes/net_configs/netconfig1.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bond">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bond">
<options>
<option name="mode" value="1"/>
<option name="miimon" value="100"/>
@@ -14,6 +14,5 @@
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig2.xml b/example_recipes/net_configs/netconfig2.xml
index c9e8228..ebda58a 100644
--- a/example_recipes/net_configs/netconfig2.xml
+++ b/example_recipes/net_configs/netconfig2.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bridge">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bridge">
<slaves>
<slave id="1"/>
<slave id="2"/>
@@ -9,6 +9,5 @@
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig3.xml b/example_recipes/net_configs/netconfig3.xml
index cef9529..c32cc01 100644
--- a/example_recipes/net_configs/netconfig3.xml
+++ b/example_recipes/net_configs/netconfig3.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bond">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bond">
<options>
<option name="mode" value="1"/>
<option name="miimon" value="100"/>
@@ -10,14 +10,13 @@
<slave id="1"/>
<slave id="2"/>
</slaves>
- </netdevice>
- <netdevice id="4" type="bridge">
+ </interface>
+ <interface id="4" type="bridge">
<slaves>
<slave id="3"/>
</slaves>
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig4.xml b/example_recipes/net_configs/netconfig4.xml
index c41feca..ba99a3f 100644
--- a/example_recipes/net_configs/netconfig4.xml
+++ b/example_recipes/net_configs/netconfig4.xml
@@ -1,6 +1,6 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="vlan">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" type="vlan">
<options>
<option name="vlan_tci" value="100"/>
</options>
@@ -10,6 +10,5 @@
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig5.xml b/example_recipes/net_configs/netconfig5.xml
index d99e2bc..4597c38 100644
--- a/example_recipes/net_configs/netconfig5.xml
+++ b/example_recipes/net_configs/netconfig5.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bond">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bond">
<options>
<option name="mode" value="1"/>
<option name="miimon" value="100"/>
@@ -10,8 +10,8 @@
<slave id="1"/>
<slave id="2"/>
</slaves>
- </netdevice>
- <netdevice id="4" type="vlan">
+ </interface>
+ <interface id="4" type="vlan">
<options>
<option name="vlan_tci" value="100"/>
</options>
@@ -21,6 +21,5 @@
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig6.xml b/example_recipes/net_configs/netconfig6.xml
index c69bce2..b2af05c 100644
--- a/example_recipes/net_configs/netconfig6.xml
+++ b/example_recipes/net_configs/netconfig6.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bond">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bond">
<options>
<option name="mode" value="1"/>
<option name="miimon" value="100"/>
@@ -10,22 +10,21 @@
<slave id="1"/>
<slave id="2"/>
</slaves>
- </netdevice>
- <netdevice id="4" type="vlan">
+ </interface>
+ <interface id="4" type="vlan">
<options>
<option name="vlan_tci" value="100"/>
</options>
<slaves>
<slave id="3"/>
</slaves>
- </netdevice>
- <netdevice id="5" type="bridge">
+ </interface>
+ <interface id="5" type="bridge">
<slaves>
<slave id="4"/>
</slaves>
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/netconfig7.xml b/example_recipes/net_configs/netconfig7.xml
index b1faa37..ba45e4c 100644
--- a/example_recipes/net_configs/netconfig7.xml
+++ b/example_recipes/net_configs/netconfig7.xml
@@ -1,10 +1,9 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="macvlan" hwaddr="aa:84:52:e1:09:bc">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface hwaddr="aa:84:52:e1:09:bc" id="2" type="macvlan">
<realdev id="1"/>
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
-</netconfig>
-
+ </interface>
+</netconfig>
\ No newline at end of file
diff --git a/example_recipes/net_configs/team1.xml b/example_recipes/net_configs/team1.xml
index 4bebf13..62959c3 100644
--- a/example_recipes/net_configs/team1.xml
+++ b/example_recipes/net_configs/team1.xml
@@ -1,7 +1,7 @@
<netconfig>
- <netdevice id="1" type="eth" phys_id="1" />
- <netdevice id="2" type="eth" phys_id="2" />
- <netdevice id="5" type="team">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="5" type="team">
<options>
<!-- Team device name can be omitted from teamd config,
because it will be overridden by LNST anyway. -->
@@ -13,16 +13,16 @@
</option>
</options>
<slaves>
- <slave id="1" />
- <slave id="2" />
+ <slave id="1"/>
+ <slave id="2"/>
</slaves>
<addresses>
- <address value="192.168.122.200/24" />
+ <address value="192.168.122.200/24"/>
</addresses>
- </netdevice>
- <netdevice id="3" type="eth" phys_id="3" />
- <netdevice id="4" type="eth" phys_id="4" />
- <netdevice id="6" type="team">
+ </interface>
+ <interface id="3" phys_id="3" type="eth"/>
+ <interface id="4" phys_id="4" type="eth"/>
+ <interface id="6" type="team">
<options>
<option name="teamd_config">
{
@@ -32,11 +32,11 @@
</option>
</options>
<slaves>
- <slave id="3" />
- <slave id="4" />
+ <slave id="3"/>
+ <slave id="4"/>
</slaves>
<addresses>
- <address value="192.168.122.210/24" />
+ <address value="192.168.122.210/24"/>
</addresses>
- </netdevice>
+ </interface>
</netconfig>
diff --git a/example_recipes/packet_assert.xml b/example_recipes/packet_assert.xml
index 11d20b7..d777d5e 100644
--- a/example_recipes/packet_assert.xml
+++ b/example_recipes/packet_assert.xml
@@ -1,15 +1,15 @@
<nettestrecipe>
<command_sequence>
- <command type="test" value="PacketAssert" bg_id="1">
+ <command bg_id="1" type="test" value="PacketAssert">
<options>
- <option name="interface" value="br0" />
- <option name="filter" value="" />
- <option name="grep_for" value="IP" />
- <option name="min" value="1" />
- <option name="max" value="5" />
+ <option name="interface" value="br0"/>
+ <option name="filter" value=""/>
+ <option name="grep_for" value="IP"/>
+ <option name="min" value="1"/>
+ <option name="max" value="5"/>
</options>
</command>
- <command type="exec" value="sleep 3" />
- <command type="intr" value="1" />
+ <command type="exec" value="sleep 3"/>
+ <command type="intr" value="1"/>
</command_sequence>
-</nettestrecipe>
+</nettestrecipe>
\ No newline at end of file
diff --git a/example_recipes/recipe1.xml b/example_recipes/recipe1.xml
index 07cde2d..dc4e086 100644
--- a/example_recipes/recipe1.xml
+++ b/example_recipes/recipe1.xml
@@ -7,28 +7,27 @@
<machine id="2">
<netmachineconfig>
<info hostname="junkbox.lab.eng.brq.redhat.com"/>
- <netdevice type="eth" phys_id="1" hwaddr="00:10:18:61:35:9B"/>
+ <netdevice hwaddr="00:10:18:61:35:9B" phys_id="1" type="eth"/>
</netmachineconfig>
<netconfig>
- <netdevice id="1" type="eth" phys_id="1">
+ <interface id="1" phys_id="1" type="eth">
<addresses>
<address value="192.168.101.2/24"/>
</addresses>
- </netdevice>
+ </interface>
</netconfig>
</machine>
</machines>
<command_sequence>
<command type="exec" value="sleep 4"/>
- <command type="test" machine_id="1" value="IcmpPing" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="IcmpPing">
<options>
- <option type="recipe_eval" name="addr" value="['machines'][2]['netconfig'][1]['addresses'][0]"/>
- <option name="count" value="40"/>
- <option name="interval" value="0.2"/>
- <option name="limit_rate" value="95"/>
+ <option name="addr" value="{$recipe['machines'][2]['netconfig'][1]['addresses'][0]}"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0.2"/>
+ <option name="limit_rate" value="95"/>
</options>
</command>
</command_sequence>
</nettestrecipe>
-
diff --git a/example_recipes/recipe2.xml b/example_recipes/recipe2.xml
index b54a574..d8a538a 100644
--- a/example_recipes/recipe2.xml
+++ b/example_recipes/recipe2.xml
@@ -3,17 +3,17 @@
<machine id="1">
<netmachineconfig>
<info hostname="10.34.37.141" rootpass="aaa"/>
- <netdevice type="eth" phys_id="1" hwaddr="00:E0:4C:14:2E:5D"/>
- <netdevice type="eth" phys_id="2" hwaddr="00:30:4F:7F:FD:30"/>
+ <netdevice hwaddr="00:E0:4C:14:2E:5D" phys_id="1" type="eth"/>
+ <netdevice hwaddr="00:30:4F:7F:FD:30" phys_id="2" type="eth"/>
</netmachineconfig>
<netconfig>
- <netdevice id="1" type="eth" phys_id="1"/>
- <netdevice id="2" type="eth" phys_id="2"/>
- <netdevice id="3" type="bond">
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" type="bond">
<options>
- <option name="mode" value="1"/>
- <option name="miimon" value="100"/>
- <option name="primary" value="2"/>
+ <option name="mode" value="1"/>
+ <option name="miimon" value="100"/>
+ <option name="primary" value="2"/>
</options>
<slaves>
<slave id="1"/>
@@ -22,22 +22,21 @@
<addresses>
<address value="192.168.101.1/24"/>
</addresses>
- </netdevice>
+ </interface>
</netconfig>
</machine>
<machine id="2">
<netmachineconfig>
<info hostname="junkbox.lab.eng.brq.redhat.com"/>
- <netdevice type="eth" phys_id="1" hwaddr="00:13:20:F7:73:1B"/>
+ <netdevice hwaddr="00:13:20:F7:73:1B" phys_id="1" type="eth"/>
</netmachineconfig>
<netconfig>
- <netdevice id="1" type="eth" phys_id="1">
+ <interface id="1" phys_id="1" type="eth">
<addresses>
<address value="192.168.101.2/24"/>
</addresses>
- </netdevice>
+ </interface>
</netconfig>
</machine>
</machines>
</nettestrecipe>
-
diff --git a/example_recipes/recipe3.xml b/example_recipes/recipe3.xml
index bd28e53..ef69e48 100644
--- a/example_recipes/recipe3.xml
+++ b/example_recipes/recipe3.xml
@@ -1,13 +1,12 @@
<nettestrecipe>
<command_sequence>
- <command type="exec" value="xeyes" bg_id="1"/>
+ <command bg_id="1" type="exec" value="xeyes"/>
<command type="exec" value="sleep 2"/>
<command type="kill" value="1"/>
- <command type="exec" value="ping www.redhat.com -c 2" bg_id="1"/>
+ <command bg_id="1" type="exec" value="ping www.redhat.com -c 2"/>
<command type="wait" value="1"/>
- <command type="exec" value="xeyes" bg_id="1"/>
+ <command bg_id="1" type="exec" value="xeyes"/>
<command type="exec" value="sleep 2"/>
<command type="kill" value="1"/>
</command_sequence>
-</nettestrecipe>
-
+</nettestrecipe>
\ No newline at end of file
diff --git a/example_recipes/recipe4.xml b/example_recipes/recipe4.xml
index 2ed2b27..ea0a453 100644
--- a/example_recipes/recipe4.xml
+++ b/example_recipes/recipe4.xml
@@ -1,4 +1,3 @@
<nettestrecipe>
<command_sequence source="cmd_sequences/sequence1.xml"/>
-</nettestrecipe>
-
+</nettestrecipe>
\ No newline at end of file
diff --git a/example_recipes/recipe5.xml b/example_recipes/recipe5.xml
index 504c651..3cc4ec7 100644
--- a/example_recipes/recipe5.xml
+++ b/example_recipes/recipe5.xml
@@ -1,14 +1,13 @@
<nettestrecipe>
<command_sequence>
- <command type="test" value="IcmpPing" timeout="30">
+ <command timeout="30" type="test" value="IcmpPing">
<options>
<option name="addr" value="www.redhat.com"/>
- <option name="count" value="40"/>
- <option name="interval" value="0.2"/>
- <option name="limit_rate" value="95"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0.2"/>
+ <option name="limit_rate" value="95"/>
</options>
</command>
<command type="test" value="DummyFailing"/>
</command_sequence>
</nettestrecipe>
-
diff --git a/example_recipes/recipe6.xml b/example_recipes/recipe6.xml
index 4820a10..2115fec 100644
--- a/example_recipes/recipe6.xml
+++ b/example_recipes/recipe6.xml
@@ -6,15 +6,14 @@
</machine>
</machines>
<command_sequence>
- <command machine_id="1" type="test" value="IcmpPing" timeout="30">
+ <command machine_id="1" timeout="30" type="test" value="IcmpPing">
<options>
<option name="addr" value="www.redhat.com"/>
- <option name="count" value="40"/>
- <option name="interval" value="0.2"/>
- <option name="limit_rate" value="95"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0.2"/>
+ <option name="limit_rate" value="95"/>
</options>
</command>
<command machine_id="1" type="test" value="DummyFailing"/>
</command_sequence>
</nettestrecipe>
-
diff --git a/example_recipes/rpazdera-multicast.xml b/example_recipes/rpazdera-multicast.xml
index 192e462..9f1d68c 100644
--- a/example_recipes/rpazdera-multicast.xml
+++ b/example_recipes/rpazdera-multicast.xml
@@ -3,52 +3,52 @@
<machines>
<machine id="1">
<netmachineconfig>
- <info hostname="10.34.1.120" rootpass="redhat" />
- <netdevice id="1" type="eth" phys_id="1" hwaddr="52:54:00:2E:D5:A8"/>
- <netdevice id="2" type="eth" phys_id="2" hwaddr="52:54:00:90:23:0B"/>
+ <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>
- <netdevice id="1" type="eth" phys_id="1">
+ <interface id="1" phys_id="1" type="eth">
<addresses>
- <address value="192.168.122.225/24" />
+ <address value="192.168.122.225/24"/>
</addresses>
- </netdevice>
- <netdevice id="2" type="eth" phys_id="2">
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
<addresses>
- <address value="192.168.122.239/24" />
+ <address value="192.168.122.239/24"/>
</addresses>
- </netdevice>
+ </interface>
</netconfig>
</machine>
<machine id="2">
<netmachineconfig>
- <info hostname="10.34.1.171" rootpass="redhat" />
- <netdevice id="1" type="eth" phys_id="1" hwaddr="52:54:00:12:DF:5A"/>
+ <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>
- <netdevice id="1" type="eth" phys_id="1">
+ <interface id="1" phys_id="1" type="eth">
<addresses>
- <address value="192.168.122.200/24" />
+ <address value="192.168.122.200/24"/>
</addresses>
- </netdevice>
+ </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" />
+ <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" />
+ <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>
11 years, 4 months
[lnst] NetTestParse: Changing 'netdevice' to 'interface'
by Jiří Pírko
commit 372408de22a494b973f39901228ee30353c1baa9
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 25 11:57:06 2012 +0200
NetTestParse: Changing 'netdevice' to 'interface'
This patch changes the name of 'netdevice' tag within 'netconfig'
to 'interface' to make it more distinguishable from 'netdevice' tag
that is also present within 'netmachineconfig', but with a little
different semantics. I posted more in-depth description of this
to the lnst-developers list [1].
This change should help users to understand the XML recipes better.
I also tried shorter 'iface' instead of 'interface' (as we discussed
at the meeting), but in my opinion it doesn't fit there right. None
of the other tag names is abbreviated and 'interface' is 9 chars long,
which is exactly the same as the previous 'netdevice'.
Here's an example:
<netconfig>
<interface id="1" phys_id="1" type="eth"/>
<interface id="2" phys_id="2" type="eth"/>
<interface id="3" type="bond">
<options>
<option name="mode" value="0" />
<option name="miimon" value="100" />
</options>
<slaves>
<slave id="1"/>
<slave id="2"/>
</slaves>
<addresses>
<address value="192.168.122.3/24" />
</addresses>
</interface>
</netconfig>
[1] https://fedorahosted.org/pipermail/lnst-developers/2012-July/000219.html
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestParse.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 7869cd0..e52f0f3 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -119,7 +119,7 @@ class NetMachineConfigParse(RecipeParser):
def parse(self, node):
scheme = {"info": self._info,
- "netdevice": self._phys_netdevice}
+ "netdevice": self._netdevice}
self._process_child_nodes(node, scheme)
def _info(self, node, params):
@@ -139,7 +139,7 @@ class NetMachineConfigParse(RecipeParser):
self._trigger_event("machine_info_ready",
{"machine_id": self._machine_id})
- def _phys_netdevice(self, node, params):
+ def _netdevice(self, node, params):
machine = self._machine
phys_id = self._get_attribute(node, "phys_id", int)
@@ -169,10 +169,10 @@ class NetConfigParse(RecipeParser):
devices = self._machine["netdevices"]
self._devices = devices
- scheme = {"netdevice": self._netdevice}
+ scheme = {"interface": self._interface}
self._process_child_nodes(node, scheme)
- def _netdevice(self, node, params):
+ def _interface(self, node, params):
netconfig = self._netconfig
devices = self._devices
11 years, 4 months
Make cleanup more robust
by Jan Tluka
I have recently hit several bugs during testing refactored recipe parsing.
Namely following:
1. Corrupted netdevice names
If bond set up was left after config_only and nettestslave instance was
killed and restarted then inconsistent device names were read (e.g. in
bond mode 0 all devices had the same MAC address and t_bond0 was
incorrectly identified instead of e.g. eth0)
2. Bonding module is not loaded
If config_only run was performed with independent slaves running
continuously the netconfigs from previous run were used resulting in
inconsistent set of used netdevices (e.g. slave saw a bond device in used
netdevice types and therefore bonding module was not loaded)
This patch set resolves these problems and makes cleanup more robust and
proper.
I have tested the patchset on RHEL6.
11 years, 4 months