[PATCH] example_recipes: Apply new conventions to examples
by Radek Pazdera
From: Radek Pazdera <rpazdera(a)redhat.com>
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>
--
1.7.7.6
10 years, 6 months
[PATCH] NetTestParse: Changing 'netdevice' to 'interface'
by Radek Pazdera
From: Radek Pazdera <rpazdera(a)redhat.com>
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
--
1.7.7.6
10 years, 6 months
Meeting this week (23rd July - 27th July)
by Radek Pazdera
Hello again :),
I have just finished (hopefully) the parser and I'm ready to dive right
into the libvirt integration.
I'd appreciate if we could meet up this week to revamp what needs to be
done and talk more about how to grasp it, where to start etc.
When will you be available in the office this week?
I plan to be here:
on Monday 23rd 8-12
on Tuesday 24th 12-16
on Wednesday 25th 8-16
I can come on Thursday if necessary, but I can't make it on Friday.
I sent some XML propositions for it [1], but there's a problem with "how
to specify the connections between two machines". I'd like to discuss that
at the meeting.
[1]
https://fedorahosted.org/pipermail/lnst-developers/2012-June/000170.html
Radek
10 years, 6 months
Netdev Proposal
by Radek Pazdera
Hi,
When I was working on the parser, it occured to me, that in LNST recipes
there are two slightly different things called by the same name. But I'm
not sure if it's a problem or not. I just thought, that while we need to
change our older recipes because recipe_eval was dropped, I should bring
this up, so in case we'd agree on this we don't need to change existing
recipes again.
I'm talking about
<netdev />
Netdev tags are used in two different contexts. First to assign phys_id
to a device identified by a mac address in <netmachineconfig>. And secondly
in <netconfig> to specify the configuration of the devices that will be
used. New devices can be created during configuration on top of the existing
ones (e.g. bonds, teams, vlans).
On top of that, the physical netdevs have phys_id, while the 'logical'
configured devices have id and some of them also phys_id in case they
corespond directly to the underlying physical devices.
It makes sense, they are both netdevices from the kernel's point of view,
but from LNST's point of view the first is a set of "physical" source
devices, while the second group are configured interfaces that can be
used in the test.
I think this could be a little confusing to people learning to use LNST
at first. I think, that we could somehow emphasize the difference
between these two. But I'm not sure what are the right names. What do you
think?
Maybe keep the physical devices in netmachineconfig called <netdev> and
change those in <netconfig> to <interface> to emphasize that those are
the "communication channels" used later in recipe? Or the other way?
Here's an example:
<machine id="1">
<netmachineconfig>
<info hostname="10.34.1.171" rootpass="redhat" />
<netdevice type="eth" phys_id="1" hwaddr="52:54:00:e4:75:16"/>
<netdevice type="eth" phys_id="2" hwaddr="52:54:00:91:01:9c"/>
<netdevice type="eth" phys_id="3" hwaddr="52:54:00:94:b7:32"/>
<netdevice type="eth" phys_id="4" hwaddr="52:54:00:f3:a1:b4"/>
</netmachineconfig>
<netconfig>
<interface id="1" type="eth" phys_id="1" />
<interface id="2" type="eth" phys_id="2" />
<interface id="5" type="team">
<options>
<option name="teamd_config">
{
"runner": {"name": "roundrobin"},
"ports": {"{devname(1,1)}": {},
"{devname(1,2)}": {}}
}
</option>
</options>
<slaves>
<slave id="1" />
<slave id="2" />
</slaves>
<addresses>
<address value="192.168.122.100/24" />
</addresses>
</interface>
</netconfig>
</machine>
Radek :)
10 years, 6 months
[PATCH] NetTestController: Fix behavior of -c parameter
by Radek Pazdera
From: Radek Pazdera <rpazdera(a)redhat.com>
I "fixed" what I thought was a bad behavior of the cleanup option in
commit 791fd48e6a95a10dfef60ac442f2a34f225e672a [1]. As it turns out,
my understanding of the purpose of -c option was wrong and the current
behavior is in fact a regression.
This commit reverts the changes and takes the semantics of '-c' option
back to the original.
If you pass -c option to `nettestctl.py', the machines will be cleaned
up *before* the recipe is executed. The option now has no effect on the
cleanup, that takes place after the recipe was run. This is done always
automatically.
[1] NetTestController: Adding missing cleanup
https://fedorahosted.org/pipermail/lnst-developers/2012-June/000149.html
Reported-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
NetTest/NetTestController.py | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 4daf070..6c047d3 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -158,27 +158,25 @@ class NetTestController:
ip_addr = get_corespond_local_ip(hostname)
rpc.set_logging(ip_addr, LoggingServer.DEFAULT_PORT)
- def _cleanup_slave(self, machine_id):
- info = self._get_machineinfo(machine_id)
-
- if self._docleanup:
+ def _deconfigure_slaves(self):
+ for machine_id in self._recipe["machines"]:
+ info = self._get_machineinfo(machine_id)
rpc = self._get_machinerpc(machine_id)
for if_id in reversed(info["configured_interfaces"]):
rpc.deconfigure_interface(if_id)
- if self._remoteexec and "session" in info:
- info["session"].kill()
- info["session"].wait()
+ def _disconnect_slaves(self):
+ for machine_id in self._recipe["machines"]:
+ info = self._get_machineinfo(machine_id)
+ if self._remoteexec and "session" in info:
+ info["session"].kill()
+ info["session"].wait()
def _prepare(self):
# All the perparations are made within the recipe parsing
# This is achieved by handling parser events (by registering
self._ntparse.parse_recipe()
- def _cleanup(self):
- for machine_id in self._recipe["machines"]:
- self._cleanup_slave(machine_id)
-
def _run_command(self, command):
machine_id = command["machine_id"]
try:
@@ -236,12 +234,13 @@ class NetTestController:
def dump_recipe(self):
self._prepare()
pprint(self._recipe)
- self._cleanup()
+ self._deconfigure_slaves()
+ self._disconnect_slaves()
return True
def config_only_recipe(self):
self._prepare()
- self._cleanup()
+ self._disconnect_slaves()
return True
def run_recipe(self, packet_capture=False):
@@ -260,7 +259,8 @@ class NetTestController:
self._stop_packet_capture()
self._gather_capture_files()
- self._cleanup()
+ self._deconfigure_slaves()
+ self._disconnect_slaves()
if not err:
return res
--
1.7.7.6
10 years, 6 months
[lnst] XmlTemplates: Wrong alias regexp
by Jiří Pírko
commit 2b1b5394ffa28d2e96f9b0505fbb8b774371ff39
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Jul 19 22:26:08 2012 +0200
XmlTemplates: Wrong alias regexp
The regexp for matching aliases was malformed. This error was
causing greedy-match problem with multiple alias references
in one string.
Reported-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Common/XmlTemplates.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/Common/XmlTemplates.py b/Common/XmlTemplates.py
index 92ff269..a88ccca 100644
--- a/Common/XmlTemplates.py
+++ b/Common/XmlTemplates.py
@@ -29,7 +29,7 @@ class XmlTemplateError(Exception):
class XmlTemplates:
""" This class serves as template processor """
- _alias_re = "\{\$([a-zA-Z0-9_]+)(\[.+\])*\}"
+ _alias_re = "\{\$([a-zA-Z0-9_]+)(\[[^{}]+\])?\}"
_func_re = "\{([a-zA-Z0-9_]+)\(([^\(\)]*)\)\}"
def __init__(self, definitions=None):
10 years, 6 months
[lnst] Parser regression fix: Forgot to do type_cleanup
by Jiří Pírko
commit aae155dce7273ff10bde58d7c22de89ff0a596e2
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Jul 19 22:26:07 2012 +0200
Parser regression fix: Forgot to do type_cleanup
This patch addresses a regression that was introduced along with the
parser modifications.
NetDevice type classes were not cleaned up properly when the devices
were deconfigured. This might cause problems with running multiple
recipes at once.
Reported-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetConfig/NetConfig.py | 12 ++++++++----
NetTest/NetTestSlave.py | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index a0a8e20..3561205 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -62,15 +62,20 @@ class NetConfig:
if not dev_type in self._get_used_types():
NetConfigDeviceType(dev_type).type_init()
- def _types_cleanup(self):
- for dev_type in self._get_used_types():
+ 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._config[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"])
+
def get_interface_config(self, if_id):
return self._config[if_id]
@@ -95,7 +100,6 @@ class NetConfig:
dev_order = self._get_dev_order()
for dev_id in reversed(dev_order):
self.deconfigure(dev_id)
- self._types_cleanup()
def dump_config(self):
return copy.deepcopy(self._config)
diff --git a/NetTest/NetTestSlave.py b/NetTest/NetTestSlave.py
index 272066d..1746452 100644
--- a/NetTest/NetTestSlave.py
+++ b/NetTest/NetTestSlave.py
@@ -65,6 +65,7 @@ class NetTestSlaveXMLRPC:
def deconfigure_interface(self, if_id):
self._netconfig.deconfigure(if_id)
+ self._netconfig.remove_interface_config(if_id)
return True
def netconfig_dump(self):
10 years, 6 months
[lnst] NetTestController: Fix behavior of -c parameter
by Jiří Pírko
commit 490df9f97f74316421cf06d4bb854e7e440dd845
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Jul 19 22:26:06 2012 +0200
NetTestController: Fix behavior of -c parameter
I "fixed" what I thought was a bad behavior of the cleanup option in
commit 791fd48e6a95a10dfef60ac442f2a34f225e672a [1]. As it turns out,
my understanding of the purpose of -c option was wrong and the current
behavior is in fact a regression.
This commit reverts the changes and takes the semantics of '-c' option
back to the original.
If you pass -c option to `nettestctl.py', the machines will be cleaned
up *before* the recipe is executed. The option now has no effect on the
cleanup, that takes place after the recipe was run. This is done always
automatically.
[1] NetTestController: Adding missing cleanup
https://fedorahosted.org/pipermail/lnst-developers/2012-June/000149.html
Reported-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetTest/NetTestController.py | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/NetTest/NetTestController.py b/NetTest/NetTestController.py
index 4daf070..6c047d3 100644
--- a/NetTest/NetTestController.py
+++ b/NetTest/NetTestController.py
@@ -158,27 +158,25 @@ class NetTestController:
ip_addr = get_corespond_local_ip(hostname)
rpc.set_logging(ip_addr, LoggingServer.DEFAULT_PORT)
- def _cleanup_slave(self, machine_id):
- info = self._get_machineinfo(machine_id)
-
- if self._docleanup:
+ def _deconfigure_slaves(self):
+ for machine_id in self._recipe["machines"]:
+ info = self._get_machineinfo(machine_id)
rpc = self._get_machinerpc(machine_id)
for if_id in reversed(info["configured_interfaces"]):
rpc.deconfigure_interface(if_id)
- if self._remoteexec and "session" in info:
- info["session"].kill()
- info["session"].wait()
+ def _disconnect_slaves(self):
+ for machine_id in self._recipe["machines"]:
+ info = self._get_machineinfo(machine_id)
+ if self._remoteexec and "session" in info:
+ info["session"].kill()
+ info["session"].wait()
def _prepare(self):
# All the perparations are made within the recipe parsing
# This is achieved by handling parser events (by registering
self._ntparse.parse_recipe()
- def _cleanup(self):
- for machine_id in self._recipe["machines"]:
- self._cleanup_slave(machine_id)
-
def _run_command(self, command):
machine_id = command["machine_id"]
try:
@@ -236,12 +234,13 @@ class NetTestController:
def dump_recipe(self):
self._prepare()
pprint(self._recipe)
- self._cleanup()
+ self._deconfigure_slaves()
+ self._disconnect_slaves()
return True
def config_only_recipe(self):
self._prepare()
- self._cleanup()
+ self._disconnect_slaves()
return True
def run_recipe(self, packet_capture=False):
@@ -260,7 +259,8 @@ class NetTestController:
self._stop_packet_capture()
self._gather_capture_files()
- self._cleanup()
+ self._deconfigure_slaves()
+ self._disconnect_slaves()
if not err:
return res
10 years, 6 months
[lnst] NetConfig: Adding support for the new parser
by Jiří Pírko
commit 47a921d183967b0438f9b0fc3f5e52b7f55b8cde
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Wed Jul 18 17:03:39 2012 +0200
NetConfig: Adding support for the new parser
This commit modifies NetConfig package to reflect recent changes in
parser implementation.
The original NetConfig was initialized with the machine and net
config's XML strings. Now the config is initialized with a dictionary
that contains parsed configuration the interface.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
NetConfig/NetConfig.py | 34 +++----
NetConfig/NetConfigDevNames.py | 43 ++++-----
NetConfig/NetConfigParse.py | 199 ----------------------------------------
3 files changed, 30 insertions(+), 246 deletions(-)
---
diff --git a/NetConfig/NetConfig.py b/NetConfig/NetConfig.py
index 4dd63e1..a0a8e20 100644
--- a/NetConfig/NetConfig.py
+++ b/NetConfig/NetConfig.py
@@ -12,30 +12,15 @@ jpirko(a)redhat.com (Jiri Pirko)
import logging
import copy
-from NetConfigParse import NetConfigParse
from NetConfigDevNames import NetConfigDevNames
from NetConfigDevice import NetConfigDevice
from NetConfigDevice import NetConfigDeviceType
from NetConfigCommon import get_slaves
class NetConfig:
- def __init__(self, machine_xml_string, config_xml_string=None):
- parse = NetConfigParse(machine_xml_string)
+ def __init__(self):
devnames = NetConfigDevNames()
-
- if config_xml_string:
- config = parse.parse_config(config_xml_string)
- else:
- '''
- No config is passed so make essential netdevices as they
- are listed in machine config and stores them into config
- '''
- mnetdevs = parse.get_machine_netdevs()
- config = copy.deepcopy(mnetdevs)
- for key in config:
- config[key]["phys_id"] = key
-
- devnames.assign_names(config)
+ config = {}
self._devnames = devnames
self._config = config
@@ -73,14 +58,22 @@ class NetConfig:
types.add(netdev["type"])
return types
- def _types_init(self):
- for dev_type in self._get_used_types():
+ def _type_init(self, dev_type):
+ if not dev_type in self._get_used_types():
NetConfigDeviceType(dev_type).type_init()
def _types_cleanup(self):
for dev_type in self._get_used_types():
NetConfigDeviceType(dev_type).type_cleanup()
+ def add_interface_config(self, if_id, config):
+ self._config[if_id] = config
+ self._type_init(config["type"])
+ self._devnames.assign_name(if_id, self._config)
+
+ def get_interface_config(self, if_id):
+ return self._config[if_id]
+
def configure(self, dev_id):
netdev = self._config[dev_id]
device = NetConfigDevice(netdev, self._config)
@@ -88,7 +81,6 @@ class NetConfig:
device.up()
def configure_all(self):
- self._types_init()
dev_order = self._get_dev_order()
for dev_id in dev_order:
self.configure(dev_id)
@@ -129,7 +121,7 @@ class NetConfig:
if "slaves" in params:
netdev["slaves"] = params["slaves"]
self._config[dev_id] = netdev
- self._devnames.assign_names(self._config)
+ self._devnames.assign_name(dev_id, self._config)
return dev_id
def netdev_del(self, dev_id):
diff --git a/NetConfig/NetConfigDevNames.py b/NetConfig/NetConfigDevNames.py
index 8522e00..1619b7e 100644
--- a/NetConfig/NetConfigDevNames.py
+++ b/NetConfig/NetConfigDevNames.py
@@ -84,29 +84,20 @@ class NetConfigDevNames:
vlan_tci = get_option(netdev, "vlan_tci")
netdev["name"] = "%s.%s" % (real_netdev["name"], vlan_tci)
- def assign_names(self, config):
- for dev_id in config:
- netdev = config[dev_id]
- if "name" in netdev:
- continue
- dev_type = netdev["type"]
- if dev_type == "eth":
- self.assign_name_by_scan(dev_id, netdev)
- elif dev_type == "bond":
- self._assign_name_bond(netdev, config)
- elif dev_type == "bridge":
- self._assign_name_bridge(netdev, config)
- elif dev_type == "macvlan":
- self._assign_name_macvlan(netdev, config)
- elif dev_type == "team":
- self._assign_name_team(netdev, config)
-
- '''
- In second round assign names for vlans as they use
- previously assigned names
- '''
- for dev_id in config:
- netdev = config[dev_id]
- dev_type = netdev["type"]
- if dev_type == "vlan":
- self._assign_name_vlan(netdev, config)
+ def assign_name(self, dev_id, config):
+ netdev = config[dev_id]
+ if "name" in netdev:
+ return
+ dev_type = netdev["type"]
+ if dev_type == "eth":
+ self.assign_name_by_scan(dev_id, netdev)
+ elif dev_type == "bond":
+ self._assign_name_bond(netdev, config)
+ elif dev_type == "bridge":
+ self._assign_name_bridge(netdev, config)
+ elif dev_type == "macvlan":
+ self._assign_name_macvlan(netdev, config)
+ elif dev_type == "team":
+ self._assign_name_team(netdev, config)
+ elif dev_type == "vlan":
+ self._assign_name_vlan(netdev, config)
10 years, 6 months
[PATCH 0/7] New Parser Implementation
by Radek Pazdera
From: Radek Pazdera <rpazdera(a)redhat.com>
This patch series introduces new parser implementation to LNST.
The decision to write a new implementation of XML parsing was made
in regards to some recent problems, that was caused by incompatibility
of the XML templates and the original parser principle.
The issues includes:
* Inabillity to resolve aliases and template functions
outside of command_sequence
* Aliases have global area of effect - they can be accessed
even before they were actually defined
* Includes are resolved before expanding templates, so you
cannot use <tag source="{$alias}" />
The new implementation addresses all these problems and on top of that
brings some new features.
Here are listed some of the changes:
* Aliases and template functions can be resolved immediately
after the tag that defines them is finished
<netdevice phys_id="1" name="eth0" hwaddr="12:34:56:78:9A:BC" />
<netdevice phys_id="2" name="{devname(1,1)}" />
^^^^^^^^^^^^
devname of the previous device |
can be safely used here --------'
* Effect of aliases is now limited only within the parent tag
in which they we're defined
<t1>
<define>
<alias name="file" value="abcd.xml" />
</define>
<netconfig source="{$file}" />
</t1>
<netconfig source="{$file}" />
^^^^^
'-- This will be undefined
* Recipe eval is gone (I removed it, as we discussed earlier)
* I enhanced the error reporting of parsing errors which is
now done in the following format:
XmlProcessingError:easy_recipe.xml:12: Alias tag must have
the 'name' attribute
The exact location of the error is reported. That includes
filename and a line number.
I tried to keep the design of the parser as similar to the original
one as possible. It is split into several RecipeParser classes. Each
subclass is responsible for parsing different part of the recipe.
I also tried to reuse as much of the other code as possible (for
instance the error checking algorithms for command sequences and
netconfigs).
I tested the implementation on several recipes and double-checked for
errors with pylint. Everything seems to work ok, hopefully there won't
be any regressions. But it's a pretty big patch so I might have forgotten
something :-(. Let me know if you encounter any problems.
Radek Pazdera (7):
XmlPreprocessor: Changing to XmlTemplates
Common: Adding XmlProcessing module
nettestctl.py: all_dump and eval actions removed
netconfig.py: Adapting to the new parser
NetTestParse: New parser implementation
NetTest: Adding support for the new parser
NetConfig: Adding support for the new parser
Common/XmlPreprocessor.py | 232 ---------------
Common/XmlProcessing.py | 351 +++++++++++++++++++++++
Common/XmlTemplates.py | 275 ++++++++++++++++++
NetConfig/NetConfig.py | 34 +--
NetConfig/NetConfigDevNames.py | 43 ++--
NetConfig/NetConfigParse.py | 199 -------------
NetTest/NetTestController.py | 277 ++++++++++--------
NetTest/NetTestParse.py | 614 +++++++++++++++++++++++++---------------
NetTest/NetTestSlave.py | 35 ++-
netconfig.py | 107 ++++++--
nettestctl.py | 9 +-
11 files changed, 1307 insertions(+), 869 deletions(-)
delete mode 100644 Common/XmlPreprocessor.py
create mode 100644 Common/XmlProcessing.py
create mode 100644 Common/XmlTemplates.py
delete mode 100644 NetConfig/NetConfigParse.py
--
1.7.7.6
10 years, 6 months