[lnst] recipes: Updating smoke tests
by Jiří Pírko
commit c9bcb757b726672b0b96de12ad2f8cebe8aa8f8f
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:12 2013 +0200
recipes: Updating smoke tests
This patch contains updates of the smoke test suite to reflect the
recent facelift of the command sequences.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/smoke/generate-recipes.py | 6 +++---
recipes/smoke/lib/conf-bond.xml | 2 +-
recipes/smoke/lib/conf-eth.xml | 2 +-
recipes/smoke/lib/conf-team.xml | 2 +-
recipes/smoke/lib/conf-vlan.xml | 2 +-
recipes/smoke/lib/recipe-temp.xml | 2 +-
recipes/smoke/lib/seq-bg.xml | 13 -------------
recipes/smoke/lib/{seq-ping.xml => task-bg.xml} | 10 ++++++----
.../lib/{seq-sysconfig.xml => task-config.xml} | 8 ++++----
recipes/smoke/lib/{seq-exec.xml => task-exec.xml} | 7 +++----
recipes/smoke/lib/{seq-ping.xml => task-ping.xml} | 8 ++++----
11 files changed, 25 insertions(+), 37 deletions(-)
---
diff --git a/recipes/smoke/generate-recipes.py b/recipes/smoke/generate-recipes.py
index e81d265..c7eedb9 100755
--- a/recipes/smoke/generate-recipes.py
+++ b/recipes/smoke/generate-recipes.py
@@ -101,10 +101,10 @@ def main():
sequences = ""
for seq in os.listdir(LIB):
- if not re.match("seq-.*", seq):
+ if not re.match("task-.*", seq):
continue
- print "Found command sequence %s%s" % (LIB, seq)
- sequences += "\n <command_sequence source=\"%s%s\"/>" % (LIB, seq)
+ print "Found a task: %s%s" % (LIB, seq)
+ sequences += "\n <task source=\"%s%s\"/>" % (LIB, seq)
conf_files = [LIB+i for i in os.listdir(LIB) if re.match("conf-.*", i)]
for conf in conf_files:
diff --git a/recipes/smoke/lib/conf-bond.xml b/recipes/smoke/lib/conf-bond.xml
index 269b123..c60ea62 100644
--- a/recipes/smoke/lib/conf-bond.xml
+++ b/recipes/smoke/lib/conf-bond.xml
@@ -10,4 +10,4 @@
<address value="{$testip}"/>
</addresses>
</bond>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/smoke/lib/conf-eth.xml b/recipes/smoke/lib/conf-eth.xml
index a4562ea..d718d8c 100644
--- a/recipes/smoke/lib/conf-eth.xml
+++ b/recipes/smoke/lib/conf-eth.xml
@@ -4,4 +4,4 @@
<address value="{$testip}"/>
</addresses>
</eth>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/smoke/lib/conf-team.xml b/recipes/smoke/lib/conf-team.xml
index 8493e09..796d6e8 100644
--- a/recipes/smoke/lib/conf-team.xml
+++ b/recipes/smoke/lib/conf-team.xml
@@ -17,4 +17,4 @@
<address value="{$testip}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/smoke/lib/conf-vlan.xml b/recipes/smoke/lib/conf-vlan.xml
index 542b167..e21573e 100644
--- a/recipes/smoke/lib/conf-vlan.xml
+++ b/recipes/smoke/lib/conf-vlan.xml
@@ -11,4 +11,4 @@
<address value="{$testip}"/>
</addresses>
</vlan>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/smoke/lib/recipe-temp.xml b/recipes/smoke/lib/recipe-temp.xml
index ab06173..954b7ef 100644
--- a/recipes/smoke/lib/recipe-temp.xml
+++ b/recipes/smoke/lib/recipe-temp.xml
@@ -14,4 +14,4 @@
</machine>
</machines>
#SEQUENCES#
-</lnstrecipe>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/smoke/lib/seq-ping.xml b/recipes/smoke/lib/task-bg.xml
similarity index 57%
copy from recipes/smoke/lib/seq-ping.xml
copy to recipes/smoke/lib/task-bg.xml
index ec8e340..eea6ef3 100644
--- a/recipes/smoke/lib/seq-ping.xml
+++ b/recipes/smoke/lib/task-bg.xml
@@ -1,10 +1,12 @@
-<command_sequence>
- <command machine_id="1" timeout="30" type="test" value="IcmpPing" pass_result="#icmp_result#">
+<task>
+ <run bg_id="1" machine="1" module="IcmpPing" timeout="30">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="40"/>
<option name="interval" value="0.2"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
-</command_sequence>
+ </run>
+ <ctl_wait seconds="5"/>
+ <intr bg_id="1" expect="fail" machine="1" timeout="30"/>
+</task>
\ No newline at end of file
diff --git a/recipes/smoke/lib/seq-sysconfig.xml b/recipes/smoke/lib/task-config.xml
similarity index 77%
rename from recipes/smoke/lib/seq-sysconfig.xml
rename to recipes/smoke/lib/task-config.xml
index f901b7b..25a0a6a 100644
--- a/recipes/smoke/lib/seq-sysconfig.xml
+++ b/recipes/smoke/lib/task-config.xml
@@ -1,10 +1,10 @@
-<command_sequence>
- <command machine_id="1" type="system_config">
+<task>
+ <config machine="1">
<options>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="6"/>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="7"/>
<option name="/proc/sys/net/ipv4/igmp_max_memberships" value="8"/>
</options>
- </command>
-</command_sequence>
+ </config>
+</task>
\ No newline at end of file
diff --git a/recipes/smoke/lib/seq-exec.xml b/recipes/smoke/lib/task-exec.xml
similarity index 53%
rename from recipes/smoke/lib/seq-exec.xml
rename to recipes/smoke/lib/task-exec.xml
index 9cd014e..9fae49f 100644
--- a/recipes/smoke/lib/seq-exec.xml
+++ b/recipes/smoke/lib/task-exec.xml
@@ -1,7 +1,6 @@
-<command_sequence>
- <command machine_id="1" timeout="30" type="exec"
- value="[ `ip -o link | grep {devname(1,testiface)} | wc -l` -gt 0 ]"/>
+<task>
+ <run command="[ `ip -o link | grep {devname(1,testiface)} | wc -l` -gt 0 ]" machine="1" timeout="30"/>
<!-- This does not yet work for non-eth devices -->
<!--<command machine_id="1" timeout="30" type="exec"
value="[ `ip -o link | grep {hwaddr(1,testiface)} | wc -l` -gt 0 ]"/>-->
-</command_sequence>
+</task>
\ No newline at end of file
diff --git a/recipes/smoke/lib/seq-ping.xml b/recipes/smoke/lib/task-ping.xml
similarity index 61%
rename from recipes/smoke/lib/seq-ping.xml
rename to recipes/smoke/lib/task-ping.xml
index ec8e340..8e84d7e 100644
--- a/recipes/smoke/lib/seq-ping.xml
+++ b/recipes/smoke/lib/task-ping.xml
@@ -1,10 +1,10 @@
-<command_sequence>
- <command machine_id="1" timeout="30" type="test" value="IcmpPing" pass_result="#icmp_result#">
+<task>
+ <run expect="fail" machine="1" module="IcmpPing" timeout="30">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="40"/>
<option name="interval" value="0.2"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
-</command_sequence>
+ </run>
+</task>
\ No newline at end of file
10 years, 8 months
[lnst] recipes: Updating the team recipes
by Jiří Pírko
commit 7c1161b999c77f32d3492ba81bb4ce6e456a52d0
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:11 2013 +0200
recipes: Updating the team recipes
The team recipes has been converted to tasks.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/team/interfaces-bond_lacp.xml | 2 +-
recipes/team/interfaces-br_queue_mapping.xml | 2 +-
recipes/team/interfaces-simple.xml | 2 +-
recipes/team/interfaces-simple_br.xml | 2 +-
recipes/team/interfaces-team_ab.xml | 2 +-
recipes/team/interfaces-team_ab_lw_001.xml | 2 +-
recipes/team/interfaces-team_ab_lw_002.xml | 2 +-
recipes/team/interfaces-team_ab_lw_003.xml | 2 +-
recipes/team/interfaces-team_ab_lw_004.xml | 2 +-
recipes/team/interfaces-team_ab_lw_005.xml | 2 +-
recipes/team/interfaces-team_ab_lw_006.xml | 2 +-
recipes/team/interfaces-team_ab_lw_007.xml | 2 +-
recipes/team/interfaces-team_ab_lw_008.xml | 2 +-
recipes/team/interfaces-team_bcast.xml | 2 +-
recipes/team/interfaces-team_lacp.xml | 2 +-
recipes/team/interfaces-team_lacp_act.xml | 2 +-
recipes/team/interfaces-team_lacp_passive.xml | 2 +-
recipes/team/interfaces-team_lacp_slowrate.xml | 2 +-
recipes/team/interfaces-team_lb.xml | 2 +-
recipes/team/interfaces-team_lb_act.xml | 8 ++--
recipes/team/interfaces-team_rr.xml | 2 +-
recipes/team/interfaces-team_rr_queue_mapping.xml | 2 +-
recipes/team/machineconfig-dhcp-37-128.xml | 8 ++--
recipes/team/machineconfig-peanut.xml | 8 ++--
recipes/team/machineconfig-test1.xml | 6 ++--
recipes/team/machineconfig-test2.xml | 6 ++--
recipes/team/recipex_ab_001.xml | 4 +-
recipes/team/recipex_ab_002.xml | 18 +++++-----
recipes/team/recipex_ab_003.xml | 4 +-
recipes/team/recipex_ab_004.xml | 4 +-
recipes/team/recipex_bcast_001.xml | 4 +-
recipes/team/recipex_bcast_002.xml | 18 +++++-----
recipes/team/recipex_bcast_003.xml | 4 +-
recipes/team/recipex_bcast_004.xml | 4 +-
recipes/team/recipex_lacp_001.xml | 4 +-
recipes/team/recipex_lacp_002.xml | 18 +++++-----
recipes/team/recipex_lacp_003.xml | 4 +-
recipes/team/recipex_lacp_004.xml | 4 +-
recipes/team/recipex_lacp_act_001.xml | 4 +-
recipes/team/recipex_lacp_act_002.xml | 18 +++++-----
recipes/team/recipex_lacp_act_003.xml | 4 +-
recipes/team/recipex_lacp_act_004.xml | 4 +-
recipes/team/recipex_lb_001.xml | 4 +-
recipes/team/recipex_lb_002.xml | 18 +++++-----
recipes/team/recipex_lb_003.xml | 4 +-
recipes/team/recipex_lb_004.xml | 4 +-
recipes/team/recipex_lb_act_001.xml | 4 +-
recipes/team/recipex_lb_act_002.xml | 18 +++++-----
recipes/team/recipex_lb_act_003.xml | 4 +-
recipes/team/recipex_lb_act_004.xml | 4 +-
recipes/team/recipex_rr_001.xml | 4 +-
recipes/team/recipex_rr_002.xml | 18 +++++-----
recipes/team/recipex_rr_003.xml | 4 +-
recipes/team/recipex_rr_004.xml | 4 +-
recipes/team/recipey_ab_lw_001.xml | 4 +-
recipes/team/recipey_ab_lw_002.xml | 4 +-
recipes/team/recipey_ab_lw_003.xml | 4 +-
recipes/team/recipey_ab_lw_004.xml | 4 +-
recipes/team/recipey_ab_lw_005.xml | 4 +-
recipes/team/recipey_ab_lw_006.xml | 4 +-
recipes/team/recipey_ab_lw_007.xml | 4 +-
recipes/team/recipey_ab_lw_008.xml | 4 +-
recipes/team/recipey_lacp_act_flows.xml | 4 +-
recipes/team/recipey_lacp_hashes.xml | 4 +-
recipes/team/recipey_lacp_passive.xml | 4 +-
recipes/team/recipey_lacp_slowrate.xml | 4 +-
recipes/team/recipey_lb_act_flows.xml | 4 +-
recipes/team/recipey_lb_hashes.xml | 4 +-
recipes/team/recipey_rr_queue_mapping.xml | 4 +-
recipes/team/sequence_iperf.xml | 26 +++++++-------
recipes/team/sequence_ping_simple.xml | 14 ++++----
recipes/team/sequence_pktgen.xml | 16 ++++----
recipes/team/sequence_pktgen_flows.xml | 14 ++++----
recipes/team/sequence_pktgen_hashes.xml | 10 +++---
recipes/team/sequence_pktgen_lacp.xml | 16 ++++----
recipes/team/sequence_queue_mapping.xml | 38 ++++++++++----------
76 files changed, 241 insertions(+), 241 deletions(-)
---
diff --git a/recipes/team/interfaces-bond_lacp.xml b/recipes/team/interfaces-bond_lacp.xml
index 4b53158..5ca7db6 100644
--- a/recipes/team/interfaces-bond_lacp.xml
+++ b/recipes/team/interfaces-bond_lacp.xml
@@ -17,4 +17,4 @@
<address value="{$testip6}"/>
</addresses>
</bond>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-br_queue_mapping.xml b/recipes/team/interfaces-br_queue_mapping.xml
index dc864fa..a8a5bee 100644
--- a/recipes/team/interfaces-br_queue_mapping.xml
+++ b/recipes/team/interfaces-br_queue_mapping.xml
@@ -15,4 +15,4 @@
<address value="172.0.4.2/24"/>
</addresses>
</bridge>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-simple.xml b/recipes/team/interfaces-simple.xml
index 7367512..dc3beec 100644
--- a/recipes/team/interfaces-simple.xml
+++ b/recipes/team/interfaces-simple.xml
@@ -6,4 +6,4 @@
</eth>
<eth id="2" network="net2"/>
<eth id="3" network="net3"/>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-simple_br.xml b/recipes/team/interfaces-simple_br.xml
index 0b83caa..02952e1 100644
--- a/recipes/team/interfaces-simple_br.xml
+++ b/recipes/team/interfaces-simple_br.xml
@@ -13,4 +13,4 @@
<address value="{$testip6}"/>
</addresses>
</bridge>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab.xml b/recipes/team/interfaces-team_ab.xml
index 3177fbb..ec748ea 100644
--- a/recipes/team/interfaces-team_ab.xml
+++ b/recipes/team/interfaces-team_ab.xml
@@ -47,4 +47,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_001.xml b/recipes/team/interfaces-team_ab_lw_001.xml
index 2a0e3f5..70a9e85 100644
--- a/recipes/team/interfaces-team_ab_lw_001.xml
+++ b/recipes/team/interfaces-team_ab_lw_001.xml
@@ -22,4 +22,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_002.xml b/recipes/team/interfaces-team_ab_lw_002.xml
index b589ea0..fe3ede9 100644
--- a/recipes/team/interfaces-team_ab_lw_002.xml
+++ b/recipes/team/interfaces-team_ab_lw_002.xml
@@ -57,4 +57,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_003.xml b/recipes/team/interfaces-team_ab_lw_003.xml
index bbda268..49a2985 100644
--- a/recipes/team/interfaces-team_ab_lw_003.xml
+++ b/recipes/team/interfaces-team_ab_lw_003.xml
@@ -28,4 +28,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_004.xml b/recipes/team/interfaces-team_ab_lw_004.xml
index 628ed03..170e75d 100644
--- a/recipes/team/interfaces-team_ab_lw_004.xml
+++ b/recipes/team/interfaces-team_ab_lw_004.xml
@@ -65,4 +65,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_005.xml b/recipes/team/interfaces-team_ab_lw_005.xml
index 634528d..93498bc 100644
--- a/recipes/team/interfaces-team_ab_lw_005.xml
+++ b/recipes/team/interfaces-team_ab_lw_005.xml
@@ -27,4 +27,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_006.xml b/recipes/team/interfaces-team_ab_lw_006.xml
index cc65c27..d14a8f7 100644
--- a/recipes/team/interfaces-team_ab_lw_006.xml
+++ b/recipes/team/interfaces-team_ab_lw_006.xml
@@ -62,4 +62,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_007.xml b/recipes/team/interfaces-team_ab_lw_007.xml
index 6ef0efb..8bd31ab 100644
--- a/recipes/team/interfaces-team_ab_lw_007.xml
+++ b/recipes/team/interfaces-team_ab_lw_007.xml
@@ -61,4 +61,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_ab_lw_008.xml b/recipes/team/interfaces-team_ab_lw_008.xml
index 0f0085a..f82f26a 100644
--- a/recipes/team/interfaces-team_ab_lw_008.xml
+++ b/recipes/team/interfaces-team_ab_lw_008.xml
@@ -87,4 +87,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_bcast.xml b/recipes/team/interfaces-team_bcast.xml
index d99c321..c5879f7 100644
--- a/recipes/team/interfaces-team_bcast.xml
+++ b/recipes/team/interfaces-team_bcast.xml
@@ -21,4 +21,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lacp.xml b/recipes/team/interfaces-team_lacp.xml
index 6bf0d5b..5f82d12 100644
--- a/recipes/team/interfaces-team_lacp.xml
+++ b/recipes/team/interfaces-team_lacp.xml
@@ -35,4 +35,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lacp_act.xml b/recipes/team/interfaces-team_lacp_act.xml
index 658976c..4d9e88a 100644
--- a/recipes/team/interfaces-team_lacp_act.xml
+++ b/recipes/team/interfaces-team_lacp_act.xml
@@ -38,4 +38,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lacp_passive.xml b/recipes/team/interfaces-team_lacp_passive.xml
index e25bd7c..d75d332 100644
--- a/recipes/team/interfaces-team_lacp_passive.xml
+++ b/recipes/team/interfaces-team_lacp_passive.xml
@@ -35,4 +35,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lacp_slowrate.xml b/recipes/team/interfaces-team_lacp_slowrate.xml
index 52cab70..0c02ff0 100644
--- a/recipes/team/interfaces-team_lacp_slowrate.xml
+++ b/recipes/team/interfaces-team_lacp_slowrate.xml
@@ -35,4 +35,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lb.xml b/recipes/team/interfaces-team_lb.xml
index 7091501..a3e98d5 100644
--- a/recipes/team/interfaces-team_lb.xml
+++ b/recipes/team/interfaces-team_lb.xml
@@ -24,4 +24,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_lb_act.xml b/recipes/team/interfaces-team_lb_act.xml
index 3b9a8ca..4a20849 100644
--- a/recipes/team/interfaces-team_lb_act.xml
+++ b/recipes/team/interfaces-team_lb_act.xml
@@ -1,7 +1,7 @@
<interfaces>
- <eth id="1" network="net1" />
- <eth id="2" network="net2" />
- <eth id="3" network="net3" />
+ <eth id="1" network="net1"/>
+ <eth id="2" network="net2"/>
+ <eth id="3" network="net3"/>
<team id="testiface">
<options>
<option name="teamd_config">
@@ -27,4 +27,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_rr.xml b/recipes/team/interfaces-team_rr.xml
index 02d5252..f17705a 100644
--- a/recipes/team/interfaces-team_rr.xml
+++ b/recipes/team/interfaces-team_rr.xml
@@ -21,4 +21,4 @@
<address value="{$testip6}"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/interfaces-team_rr_queue_mapping.xml b/recipes/team/interfaces-team_rr_queue_mapping.xml
index 989782e..2b62957 100644
--- a/recipes/team/interfaces-team_rr_queue_mapping.xml
+++ b/recipes/team/interfaces-team_rr_queue_mapping.xml
@@ -47,4 +47,4 @@
<address value="172.0.4.1/24"/>
</addresses>
</team>
-</interfaces>
+</interfaces>
\ No newline at end of file
diff --git a/recipes/team/machineconfig-dhcp-37-128.xml b/recipes/team/machineconfig-dhcp-37-128.xml
index 59a4940..d55f8d1 100644
--- a/recipes/team/machineconfig-dhcp-37-128.xml
+++ b/recipes/team/machineconfig-dhcp-37-128.xml
@@ -1,8 +1,8 @@
<machineconfig>
<info hostname="10.34.37.128"/>
<netdevices>
- <netdevice type="eth" phys_id="1" hwaddr="00:10:18:61:35:9b" network="testing_green"/>
- <netdevice type="eth" phys_id="2" hwaddr="00:10:18:48:15:fa" network="testing_magenta"/>
- <netdevice type="eth" phys_id="3" hwaddr="00:0e:0c:b3:09:4e" network="testing_blue"/>
+ <netdevice hwaddr="00:10:18:61:35:9b" network="testing_green" phys_id="1" type="eth"/>
+ <netdevice hwaddr="00:10:18:48:15:fa" network="testing_magenta" phys_id="2" type="eth"/>
+ <netdevice hwaddr="00:0e:0c:b3:09:4e" network="testing_blue" phys_id="3" type="eth"/>
</netdevices>
-</machineconfig>
+</machineconfig>
\ No newline at end of file
diff --git a/recipes/team/machineconfig-peanut.xml b/recipes/team/machineconfig-peanut.xml
index 43d7e61..3c7a286 100644
--- a/recipes/team/machineconfig-peanut.xml
+++ b/recipes/team/machineconfig-peanut.xml
@@ -1,8 +1,8 @@
<machineconfig>
<info hostname="10.34.33.99"/>
<netdevices>
- <netdevice type="eth" phys_id="1" hwaddr="d4:85:64:01:46:9e" network="testing_green"/>
- <netdevice type="eth" phys_id="2" hwaddr="00:e0:4c:14:2e:5d" network="testing_magenta"/>
- <netdevice type="eth" phys_id="3" hwaddr="00:30:4f:7f:fd:30" network="testing_blue"/>
+ <netdevice hwaddr="d4:85:64:01:46:9e" network="testing_green" phys_id="1" type="eth"/>
+ <netdevice hwaddr="00:e0:4c:14:2e:5d" network="testing_magenta" phys_id="2" type="eth"/>
+ <netdevice hwaddr="00:30:4f:7f:fd:30" network="testing_blue" phys_id="3" type="eth"/>
</netdevices>
-</machineconfig>
+</machineconfig>
\ No newline at end of file
diff --git a/recipes/team/machineconfig-test1.xml b/recipes/team/machineconfig-test1.xml
index ec3062a..2d4bb0b 100644
--- a/recipes/team/machineconfig-test1.xml
+++ b/recipes/team/machineconfig-test1.xml
@@ -1,7 +1,7 @@
<machineconfig>
<info hostname="192.168.122.182"/>
<netdevices>
- <netdevice type="eth" phys_id="1" hwaddr="52:54:00:3d:c7:6d" network="testing"/>
- <netdevice type="eth" phys_id="2" hwaddr="52:54:00:73:15:c2" network="testing"/>
+ <netdevice hwaddr="52:54:00:3d:c7:6d" network="testing" phys_id="1" type="eth"/>
+ <netdevice hwaddr="52:54:00:73:15:c2" network="testing" phys_id="2" type="eth"/>
</netdevices>
-</machineconfig>
+</machineconfig>
\ No newline at end of file
diff --git a/recipes/team/machineconfig-test2.xml b/recipes/team/machineconfig-test2.xml
index 4c57d2e..a9327af 100644
--- a/recipes/team/machineconfig-test2.xml
+++ b/recipes/team/machineconfig-test2.xml
@@ -1,7 +1,7 @@
<machineconfig>
<info hostname="192.168.122.223"/>
<netdevices>
- <netdevice type="eth" phys_id="1" hwaddr="52:54:00:99:bb:27" network="testing"/>
- <netdevice type="eth" phys_id="2" hwaddr="52:54:00:b7:cc:fb" network="testing"/>
+ <netdevice hwaddr="52:54:00:99:bb:27" network="testing" phys_id="1" type="eth"/>
+ <netdevice hwaddr="52:54:00:b7:cc:fb" network="testing" phys_id="2" type="eth"/>
</netdevices>
-</machineconfig>
+</machineconfig>
\ No newline at end of file
diff --git a/recipes/team/recipex_ab_001.xml b/recipes/team/recipex_ab_001.xml
index 9ba2947..37232b6 100644
--- a/recipes/team/recipex_ab_001.xml
+++ b/recipes/team/recipex_ab_001.xml
@@ -17,5 +17,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_ab_002.xml b/recipes/team/recipex_ab_002.xml
index df5c138..391d139 100644
--- a/recipes/team/recipex_ab_002.xml
+++ b/recipes/team/recipex_ab_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_ab_003.xml b/recipes/team/recipex_ab_003.xml
index 858c330..45e7143 100644
--- a/recipes/team/recipex_ab_003.xml
+++ b/recipes/team/recipex_ab_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_ab_004.xml b/recipes/team/recipex_ab_004.xml
index 0cefe69..81420b8 100644
--- a/recipes/team/recipex_ab_004.xml
+++ b/recipes/team/recipex_ab_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_bcast_001.xml b/recipes/team/recipex_bcast_001.xml
index e369dd8..6487253 100644
--- a/recipes/team/recipex_bcast_001.xml
+++ b/recipes/team/recipex_bcast_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_bcast_002.xml b/recipes/team/recipex_bcast_002.xml
index 268f185..274a676 100644
--- a/recipes/team/recipex_bcast_002.xml
+++ b/recipes/team/recipex_bcast_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_bcast_003.xml b/recipes/team/recipex_bcast_003.xml
index d878298..cb1c002 100644
--- a/recipes/team/recipex_bcast_003.xml
+++ b/recipes/team/recipex_bcast_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_bcast_004.xml b/recipes/team/recipex_bcast_004.xml
index 720957c..f804166 100644
--- a/recipes/team/recipex_bcast_004.xml
+++ b/recipes/team/recipex_bcast_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_001.xml b/recipes/team/recipex_lacp_001.xml
index 95e1a1e..3e53cbe 100644
--- a/recipes/team/recipex_lacp_001.xml
+++ b/recipes/team/recipex_lacp_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_002.xml b/recipes/team/recipex_lacp_002.xml
index fb0602c..3036d78 100644
--- a/recipes/team/recipex_lacp_002.xml
+++ b/recipes/team/recipex_lacp_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_003.xml b/recipes/team/recipex_lacp_003.xml
index 94515c8..eeb2a01 100644
--- a/recipes/team/recipex_lacp_003.xml
+++ b/recipes/team/recipex_lacp_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_lacp.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_lacp.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_004.xml b/recipes/team/recipex_lacp_004.xml
index 59c52de..a4a88d4 100644
--- a/recipes/team/recipex_lacp_004.xml
+++ b/recipes/team/recipex_lacp_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_act_001.xml b/recipes/team/recipex_lacp_act_001.xml
index aa7d198..7636dbf 100644
--- a/recipes/team/recipex_lacp_act_001.xml
+++ b/recipes/team/recipex_lacp_act_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_act_002.xml b/recipes/team/recipex_lacp_act_002.xml
index 0ab7a23..d19f620 100644
--- a/recipes/team/recipex_lacp_act_002.xml
+++ b/recipes/team/recipex_lacp_act_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_act_003.xml b/recipes/team/recipex_lacp_act_003.xml
index 64751f6..5b7cf91 100644
--- a/recipes/team/recipex_lacp_act_003.xml
+++ b/recipes/team/recipex_lacp_act_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_lacp.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_lacp.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lacp_act_004.xml b/recipes/team/recipex_lacp_act_004.xml
index 2d6de99..186fe9d 100644
--- a/recipes/team/recipex_lacp_act_004.xml
+++ b/recipes/team/recipex_lacp_act_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_001.xml b/recipes/team/recipex_lb_001.xml
index 00f34aa..6dd5334 100644
--- a/recipes/team/recipex_lb_001.xml
+++ b/recipes/team/recipex_lb_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_002.xml b/recipes/team/recipex_lb_002.xml
index 8c49a4f..4a9f093 100644
--- a/recipes/team/recipex_lb_002.xml
+++ b/recipes/team/recipex_lb_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_003.xml b/recipes/team/recipex_lb_003.xml
index 586536a..03f9d0d 100644
--- a/recipes/team/recipex_lb_003.xml
+++ b/recipes/team/recipex_lb_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_004.xml b/recipes/team/recipex_lb_004.xml
index 772781d..956d2c7 100644
--- a/recipes/team/recipex_lb_004.xml
+++ b/recipes/team/recipex_lb_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_act_001.xml b/recipes/team/recipex_lb_act_001.xml
index 4e9c362..59ec09b 100644
--- a/recipes/team/recipex_lb_act_001.xml
+++ b/recipes/team/recipex_lb_act_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_act_002.xml b/recipes/team/recipex_lb_act_002.xml
index f8fbd13..09c3de6 100644
--- a/recipes/team/recipex_lb_act_002.xml
+++ b/recipes/team/recipex_lb_act_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_act_003.xml b/recipes/team/recipex_lb_act_003.xml
index af9dba6..b410aaf 100644
--- a/recipes/team/recipex_lb_act_003.xml
+++ b/recipes/team/recipex_lb_act_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_lb_act_004.xml b/recipes/team/recipex_lb_act_004.xml
index fff409d..64801c1 100644
--- a/recipes/team/recipex_lb_act_004.xml
+++ b/recipes/team/recipex_lb_act_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_rr_001.xml b/recipes/team/recipex_rr_001.xml
index 8a8e561..4fe0198 100644
--- a/recipes/team/recipex_rr_001.xml
+++ b/recipes/team/recipex_rr_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_rr_002.xml b/recipes/team/recipex_rr_002.xml
index 0a283cc..12e520d 100644
--- a/recipes/team/recipex_rr_002.xml
+++ b/recipes/team/recipex_rr_002.xml
@@ -23,12 +23,12 @@
<alias name="nonexistent_ip" value="127.0.0.200"/>
</define>
- <command_sequence source="../multicast/cmd_sequences/max_groups.xml"/>
- <command_sequence source="../multicast/cmd_sequences/block_source.xml"/>
- <command_sequence source="../multicast/cmd_sequences/source_membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/membership.xml"/>
- <command_sequence source="../multicast/cmd_sequences/if.xml"/>
- <command_sequence source="../multicast/cmd_sequences/ttl.xml"/>
- <command_sequence source="../multicast/cmd_sequences/loop.xml"/>
- <command_sequence source="../multicast/cmd_sequences/simple.xml"/>
-</lnstrecipe>
+ <task source="../multicast/cmd_sequences/max_groups.xml"/>
+ <task source="../multicast/cmd_sequences/block_source.xml"/>
+ <task source="../multicast/cmd_sequences/source_membership.xml"/>
+ <task source="../multicast/cmd_sequences/membership.xml"/>
+ <task source="../multicast/cmd_sequences/if.xml"/>
+ <task source="../multicast/cmd_sequences/ttl.xml"/>
+ <task source="../multicast/cmd_sequences/loop.xml"/>
+ <task source="../multicast/cmd_sequences/simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_rr_003.xml b/recipes/team/recipex_rr_003.xml
index 2b8407b..e82bb8a 100644
--- a/recipes/team/recipex_rr_003.xml
+++ b/recipes/team/recipex_rr_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipex_rr_004.xml b/recipes/team/recipex_rr_004.xml
index c244424..a5efa24 100644
--- a/recipes/team/recipex_rr_004.xml
+++ b/recipes/team/recipex_rr_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_iperf.xml"/>
-</lnstrecipe>
+ <task source="sequence_iperf.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_001.xml b/recipes/team/recipey_ab_lw_001.xml
index 359fa03..4d1b482 100644
--- a/recipes/team/recipey_ab_lw_001.xml
+++ b/recipes/team/recipey_ab_lw_001.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_002.xml b/recipes/team/recipey_ab_lw_002.xml
index cacb765..531c1da 100644
--- a/recipes/team/recipey_ab_lw_002.xml
+++ b/recipes/team/recipey_ab_lw_002.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_003.xml b/recipes/team/recipey_ab_lw_003.xml
index d00f0be..046b591 100644
--- a/recipes/team/recipey_ab_lw_003.xml
+++ b/recipes/team/recipey_ab_lw_003.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_004.xml b/recipes/team/recipey_ab_lw_004.xml
index 280f556..f58d1f9 100644
--- a/recipes/team/recipey_ab_lw_004.xml
+++ b/recipes/team/recipey_ab_lw_004.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_005.xml b/recipes/team/recipey_ab_lw_005.xml
index 00781d9..5741b86 100644
--- a/recipes/team/recipey_ab_lw_005.xml
+++ b/recipes/team/recipey_ab_lw_005.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_006.xml b/recipes/team/recipey_ab_lw_006.xml
index 48b9669..8f98207 100644
--- a/recipes/team/recipey_ab_lw_006.xml
+++ b/recipes/team/recipey_ab_lw_006.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_007.xml b/recipes/team/recipey_ab_lw_007.xml
index 39f9f68..0661f86 100644
--- a/recipes/team/recipey_ab_lw_007.xml
+++ b/recipes/team/recipey_ab_lw_007.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_ab_lw_008.xml b/recipes/team/recipey_ab_lw_008.xml
index 56ab7f7..9daf884 100644
--- a/recipes/team/recipey_ab_lw_008.xml
+++ b/recipes/team/recipey_ab_lw_008.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lacp_act_flows.xml b/recipes/team/recipey_lacp_act_flows.xml
index e6cd481..c6b2d62 100644
--- a/recipes/team/recipey_lacp_act_flows.xml
+++ b/recipes/team/recipey_lacp_act_flows.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_flows.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_flows.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lacp_hashes.xml b/recipes/team/recipey_lacp_hashes.xml
index be23faa..3a3e3ab 100644
--- a/recipes/team/recipey_lacp_hashes.xml
+++ b/recipes/team/recipey_lacp_hashes.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_hashes.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_hashes.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lacp_passive.xml b/recipes/team/recipey_lacp_passive.xml
index f6127b3..2723f84 100644
--- a/recipes/team/recipey_lacp_passive.xml
+++ b/recipes/team/recipey_lacp_passive.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lacp_slowrate.xml b/recipes/team/recipey_lacp_slowrate.xml
index dc2cbe4..cddb3e8 100644
--- a/recipes/team/recipey_lacp_slowrate.xml
+++ b/recipes/team/recipey_lacp_slowrate.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-bond_lacp.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_ping_simple.xml"/>
-</lnstrecipe>
+ <task source="sequence_ping_simple.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lb_act_flows.xml b/recipes/team/recipey_lb_act_flows.xml
index 3e08ed1..2755426 100644
--- a/recipes/team/recipey_lb_act_flows.xml
+++ b/recipes/team/recipey_lb_act_flows.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_flows.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_flows.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_lb_hashes.xml b/recipes/team/recipey_lb_hashes.xml
index 25eb9f6..ad7cf3a 100644
--- a/recipes/team/recipey_lb_hashes.xml
+++ b/recipes/team/recipey_lb_hashes.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-simple_br.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_pktgen_hashes.xml"/>
-</lnstrecipe>
+ <task source="sequence_pktgen_hashes.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/recipey_rr_queue_mapping.xml b/recipes/team/recipey_rr_queue_mapping.xml
index 72efb19..d286493 100644
--- a/recipes/team/recipey_rr_queue_mapping.xml
+++ b/recipes/team/recipey_rr_queue_mapping.xml
@@ -15,5 +15,5 @@
<interfaces source="interfaces-br_queue_mapping.xml"/>
</machine>
</machines>
- <command_sequence source="sequence_queue_mapping.xml"/>
-</lnstrecipe>
+ <task source="sequence_queue_mapping.xml"/>
+</lnstrecipe>
\ No newline at end of file
diff --git a/recipes/team/sequence_iperf.xml b/recipes/team/sequence_iperf.xml
index a92977b..f34d47d 100644
--- a/recipes/team/sequence_iperf.xml
+++ b/recipes/team/sequence_iperf.xml
@@ -1,18 +1,18 @@
-<command_sequence>
- <command type="ctl_wait" value="3" />
- <command machine_id="2" type="test" value="Iperf" bg_id="1">
+<task>
+ <ctl_wait seconds="3"/>
+ <run bg_id="1" machine="2" module="Iperf">
<options>
- <option name="role" value="server" />
- <option name="bind" value="{ip(2,testiface)}" />
+ <option name="role" value="server"/>
+ <option name="bind" value="{ip(2,testiface)}"/>
</options>
- </command>
- <command type="ctl_wait" value="3" />
- <command machine_id="1" type="test" value="Iperf">
+ </run>
+ <ctl_wait seconds="3"/>
+ <run machine="1" module="Iperf">
<options>
- <option name="role" value="client" />
+ <option name="role" value="client"/>
<option name="duration" value="15"/>
- <option name="iperf_server" value="{ip(2,testiface)}" />
+ <option name="iperf_server" value="{ip(2,testiface)}"/>
</options>
- </command>
- <command type="kill" machine_id="2" value="1" />
-</command_sequence>
+ </run>
+ <kill bg_id="1" machine="2"/>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_ping_simple.xml b/recipes/team/sequence_ping_simple.xml
index ecccb9c..853cceb 100644
--- a/recipes/team/sequence_ping_simple.xml
+++ b/recipes/team/sequence_ping_simple.xml
@@ -1,19 +1,19 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" timeout="60" type="test" value="IcmpPing">
+<task>
+ <ctl_wait seconds="4"/>
+ <run machine="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface)}"/>
<option name="count" value="2000"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
- <command machine_id="1" timeout="60" type="test" value="Icmp6Ping">
+ </run>
+ <run machine="1" module="Icmp6Ping" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,1)}"/>
<option name="count" value="2000"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
-</command_sequence>
+ </run>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_pktgen.xml b/recipes/team/sequence_pktgen.xml
index f969c69..a5012d9 100644
--- a/recipes/team/sequence_pktgen.xml
+++ b/recipes/team/sequence_pktgen.xml
@@ -1,13 +1,13 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" type="test" value="PktCounter" bg_id="1">
+<task>
+ <ctl_wait seconds="4"/>
+ <run bg_id="1" machine="1" module="PktCounter">
<options>
<option name="input_netdev_name" value="{devname(1,testiface)}"/>
<option name="proto" value="udp"/>
<option name="dport" value="9"/>
</options>
- </command>
- <command machine_id="2" type="test" value="PktgenTx" timeout="200">
+ </run>
+ <run machine="2" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="dst {ip(1,testiface)}"/>
<option name="pktgen_option" value="dst_mac 00:11:22:33:44:55"/>
@@ -16,6 +16,6 @@
<option name="netdev_name" value="{devname(2,2)}"/>
<option name="netdev_name" value="{devname(2,3)}"/>
</options>
- </command>
- <command machine_id="1" type="intr" value="1"/>
-</command_sequence>
+ </run>
+ <intr bg_id="1" machine="1"/>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_pktgen_flows.xml b/recipes/team/sequence_pktgen_flows.xml
index b65edd5..729f3cd 100644
--- a/recipes/team/sequence_pktgen_flows.xml
+++ b/recipes/team/sequence_pktgen_flows.xml
@@ -1,6 +1,6 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" type="test" value="PktgenTx" bg_id="1">
+<task>
+ <ctl_wait seconds="4"/>
+ <run bg_id="1" machine="1" module="PktgenTx">
<options>
<option name="pktgen_option" value="count 0"/>
<option name="pktgen_option" value="clone_skb 0"/>
@@ -16,7 +16,7 @@
<option name="pktgen_option" value="flowlen 20000"/>
<option name="netdev_name" value="{devname(1,testiface)}"/>
</options>
- </command>
- <command type="ctl_wait" value="400"/>
- <command machine_id="1" type="intr" value="1"/>
-</command_sequence>
+ </run>
+ <ctl_wait seconds="400"/>
+ <intr bg_id="1" machine="1"/>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_pktgen_hashes.xml b/recipes/team/sequence_pktgen_hashes.xml
index f2d61d4..6d5c046 100644
--- a/recipes/team/sequence_pktgen_hashes.xml
+++ b/recipes/team/sequence_pktgen_hashes.xml
@@ -1,6 +1,6 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" type="test" value="PktgenTx" timeout="200">
+<task>
+ <ctl_wait seconds="4"/>
+ <run machine="1" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="count 10000"/>
<option name="pktgen_option" value="clone_skb 0"/>
@@ -10,5 +10,5 @@
<option name="pktgen_option" value="src_min {ip(1,testiface)}"/>
<option name="netdev_name" value="{devname(1,testiface)}"/>
</options>
- </command>
-</command_sequence>
+ </run>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_pktgen_lacp.xml b/recipes/team/sequence_pktgen_lacp.xml
index 9a78e98..0c469a8 100644
--- a/recipes/team/sequence_pktgen_lacp.xml
+++ b/recipes/team/sequence_pktgen_lacp.xml
@@ -1,13 +1,13 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" type="test" value="PktCounter" bg_id="1">
+<task>
+ <ctl_wait seconds="4"/>
+ <run bg_id="1" machine="1" module="PktCounter">
<options>
<option name="input_netdev_name" value="{devname(1,testiface)}"/>
<option name="proto" value="udp"/>
<option name="dport" value="9"/>
</options>
- </command>
- <command machine_id="2" type="test" value="PktgenTx" timeout="200">
+ </run>
+ <run machine="2" module="PktgenTx" timeout="200">
<options>
<option name="pktgen_option" value="dst {ip(1,testiface)}"/>
<option name="pktgen_option" value="dst_mac 00:11:22:33:44:55"/>
@@ -16,6 +16,6 @@
<option name="netdev_name" value="{devname(2,2)}"/>
<option name="netdev_name" value="{devname(2,3)}"/>
</options>
- </command>
- <command machine_id="1" type="intr" value="1"/>
-</command_sequence>
+ </run>
+ <intr bg_id="1" machine="1"/>
+</task>
\ No newline at end of file
diff --git a/recipes/team/sequence_queue_mapping.xml b/recipes/team/sequence_queue_mapping.xml
index e74138c..ede0499 100644
--- a/recipes/team/sequence_queue_mapping.xml
+++ b/recipes/team/sequence_queue_mapping.xml
@@ -1,43 +1,43 @@
-<command_sequence>
- <command type="ctl_wait" value="4"/>
- <command machine_id="1" type="exec" value="tc qdisc add dev {devname(1,testiface)} handle 1 root multiq"/>
- <command machine_id="1" type="exec" value="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,0)} action skbedit queue_mapping 1"/>
- <command machine_id="1" type="exec" value="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,1)} action skbedit queue_mapping 2"/>
- <command machine_id="1" type="exec" value="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,2)} action skbedit queue_mapping 3"/>
- <command machine_id="1" timeout="60" type="test" value="IcmpPing" bg_id="1">
+<task>
+ <ctl_wait seconds="4"/>
+ <run command="tc qdisc add dev {devname(1,testiface)} handle 1 root multiq" machine="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,0)} action skbedit queue_mapping 1" machine="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,1)} action skbedit queue_mapping 2" machine="1"/>
+ <run command="tc filter add dev {devname(1,testiface)} protocol ip parent 1: prio 1 u32 match ip dst {ip(2,testiface,2)} action skbedit queue_mapping 3" machine="1"/>
+ <run bg_id="1" machine="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,0)}"/>
<option name="count" value="100"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
- <command machine_id="1" timeout="60" type="test" value="IcmpPing" bg_id="2">
+ </run>
+ <run bg_id="2" machine="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,1)}"/>
<option name="count" value="100"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
- <command machine_id="1" timeout="60" type="test" value="IcmpPing" bg_id="3">
+ </run>
+ <run bg_id="3" machine="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,2)}"/>
<option name="count" value="100"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
- <command machine_id="1" timeout="60" type="test" value="IcmpPing" bg_id="4">
+ </run>
+ <run bg_id="4" machine="1" module="IcmpPing" timeout="60">
<options>
<option name="addr" value="{ip(2,testiface,3)}"/>
<option name="count" value="100"/>
<option name="interval" value="0.01"/>
<option name="limit_rate" value="95"/>
</options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
- <command machine_id="1" type="wait" value="2"/>
- <command machine_id="1" type="wait" value="3"/>
- <command machine_id="1" type="wait" value="4"/>
-</command_sequence>
+ </run>
+ <wait bg_id="1" machine="1"/>
+ <wait bg_id="2" machine="1"/>
+ <wait bg_id="3" machine="1"/>
+ <wait bg_id="4" machine="1"/>
+</task>
\ No newline at end of file
10 years, 8 months
[lnst] recipes: Updating multicast recipes
by Jiří Pírko
commit cbc3678190c3965cb232c8b64d648a66c3fdad38
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:10 2013 +0200
recipes: Updating multicast recipes
The multicast recipes were converted to use the new <task> syntax
instead of <command_sequence>.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/multicast/cmd_sequences/block_source.xml | 36 +++++++-------
recipes/multicast/cmd_sequences/if.xml | 37 ++++++++-------
recipes/multicast/cmd_sequences/loop.xml | 32 ++++++------
recipes/multicast/cmd_sequences/max_groups.xml | 14 +++---
recipes/multicast/cmd_sequences/membership.xml | 22 ++++----
recipes/multicast/cmd_sequences/simple.xml | 19 ++++----
.../multicast/cmd_sequences/source_membership.xml | 39 ++++++++--------
recipes/multicast/cmd_sequences/ttl.xml | 49 ++++++++++----------
recipes/multicast/multicast-all.xml | 32 +++----------
9 files changed, 132 insertions(+), 148 deletions(-)
---
diff --git a/recipes/multicast/cmd_sequences/block_source.xml b/recipes/multicast/cmd_sequences/block_source.xml
index ae3a9c0..dc16789 100644
--- a/recipes/multicast/cmd_sequences/block_source.xml
+++ b/recipes/multicast/cmd_sequences/block_source.xml
@@ -3,20 +3,20 @@
<!-- 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>
+<task>
<!-- IP_BLOCK/UNBLOCK_SOURCE sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_block_source"/>
<option name="condition" value="status == 'pass'"/>
</options>
- </command>
+ </run>
<!-- Block source in the middle of ongoing communication -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="238.0.0.1"/>
@@ -26,9 +26,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_block_source"/>
<option name="address" value="238.0.0.1"/>
@@ -40,14 +40,14 @@
<option name="condition" value="packets_received > 0"/>
<option name="condition" value="packets_received_while_blocking == 0"/>
</options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
+ </run>
+ <wait bg_id="1" machine="1"/>
<!-- Nonexistent source -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="238.0.0.1"/>
@@ -57,9 +57,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_block_source"/>
<option name="address" value="238.0.0.1"/>
@@ -71,7 +71,7 @@
<option name="condition" value="packets_received > 0"/>
<option name="condition" value="packets_received_while_blocking > 0"/>
</options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
+ </run>
+ <wait bg_id="1" machine="1"/>
-</command_sequence>
+</task>
diff --git a/recipes/multicast/cmd_sequences/if.xml b/recipes/multicast/cmd_sequences/if.xml
index 3de948c..6a4392a 100644
--- a/recipes/multicast/cmd_sequences/if.xml
+++ b/recipes/multicast/cmd_sequences/if.xml
@@ -1,10 +1,11 @@
-<!-- IP_MULTICAST_IF test --><!-- Requires: 2 hosts
+<!-- IP_MULTICAST_IF test -->
+<!-- Requires: 2 hosts
- [1] with one interface
- [2] with one interface
- -->
-<command_sequence>
+<task>
<!-- IP_MULTICAST_IF sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_if"/>
@@ -12,13 +13,13 @@
bug in the syscal. #803202 on RedHat Bugzilla -->
<!-- <option name="condition" value="status == 'pass'" /> -->
</options>
- </command>
+ </run>
<!-- IP_MULTICAST_IF correct interfaces set -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -28,9 +29,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -40,14 +41,14 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
+ <wait bg_id="1" machine="1"/>
<!-- IP_MULTICAST_IF incorrect interfaces set -->
- <command machine_id="1" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -57,9 +58,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -69,7 +70,7 @@
<option name="condition" value="packets_received == 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
+ <wait bg_id="1" machine="1"/>
+</task>
diff --git a/recipes/multicast/cmd_sequences/loop.xml b/recipes/multicast/cmd_sequences/loop.xml
index c1dbcc3..f3ac139 100644
--- a/recipes/multicast/cmd_sequences/loop.xml
+++ b/recipes/multicast/cmd_sequences/loop.xml
@@ -1,18 +1,18 @@
<!-- Offline IP_MULTICAST_LOOP test -->
<!-- Requires: 1 hosts with at least two interfaces -->
-<command_sequence>
+<task>
<!-- IP_MULTICAST_LOOP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_loop"/>
<option name="condition" value="status == 'pass'"/>
</options>
- </command>
+ </run>
<!-- IP_MULTICAST_LOOP enabled -->
- <command machine_id="1" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -22,9 +22,9 @@
<option name="loop" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -34,14 +34,14 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
+ <wait bg_id="1" machine="1"/>
<!-- IP_MULTICAST_LOOP disabled -->
- <command machine_id="1" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -51,9 +51,9 @@
<option name="loop" value="0"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -63,7 +63,7 @@
<option name="condition" value="packets_received == 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
+ <wait bg_id="1" machine="1"/>
+</task>
diff --git a/recipes/multicast/cmd_sequences/max_groups.xml b/recipes/multicast/cmd_sequences/max_groups.xml
index 1082d74..0be1ed4 100644
--- a/recipes/multicast/cmd_sequences/max_groups.xml
+++ b/recipes/multicast/cmd_sequences/max_groups.xml
@@ -1,22 +1,22 @@
<!-- Offline maximum number of groups test -->
<!-- Requires: 1 host with one interface -->
-<command_sequence>
+<task>
<!-- With a specific interface -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="max_groups"/>
<option name="interface" value="{ip(1,testiface)}"/>
<option name="condition" value="max_groups > 0"/>
</options>
- </command>
+ </run>
<!-- Change default max_memberhsips -->
- <command machine_id="1" option="/proc/sys/net/ipv4/igmp_max_memberships" type="system_config" value="5"/>
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <config machine="1" option="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="max_groups"/>
<option name="interface" value="{ip(1,testiface)}"/>
<option name="condition" value="max_groups == 5"/>
</options>
- </command>
-</command_sequence>
+ </run>
+</task>
diff --git a/recipes/multicast/cmd_sequences/membership.xml b/recipes/multicast/cmd_sequences/membership.xml
index ecea8ba..21b12d6 100644
--- a/recipes/multicast/cmd_sequences/membership.xml
+++ b/recipes/multicast/cmd_sequences/membership.xml
@@ -3,22 +3,22 @@
- [1] with one interface
- [2] with one interface
- -->
-<command_sequence>
+<task>
<!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_membership"/>
<option name="condition" value="status == 'pass'"/>
</options>
- </command>
+ </run>
<!-- This simple test case verifies that if one side leaves multicast group
- in the middle of ongoing communication, no further packets are delivered
- to the process. -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -28,9 +28,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -41,7 +41,7 @@
<option name="condition" value="packets_received > 0"/>
<option name="condition" value="packets_received_after_drop == 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
+ <wait bg_id="1" machine="1"/>
+</task>
diff --git a/recipes/multicast/cmd_sequences/simple.xml b/recipes/multicast/cmd_sequences/simple.xml
index d3c3119..ccfa22e 100644
--- a/recipes/multicast/cmd_sequences/simple.xml
+++ b/recipes/multicast/cmd_sequences/simple.xml
@@ -1,10 +1,9 @@
<!-- Requires: 2 hosts with at least one interface -->
-<!-- ['machines'][2]['netconfig'][1]['addresses'][0] -->
-<command_sequence>
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+<task>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -13,9 +12,9 @@
<option name="delay" value="{$send_delay}"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -25,7 +24,7 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
+ <wait bg_id="1" machine="1"/>
+</task>
diff --git a/recipes/multicast/cmd_sequences/source_membership.xml b/recipes/multicast/cmd_sequences/source_membership.xml
index 62bfa86..5b598e0 100644
--- a/recipes/multicast/cmd_sequences/source_membership.xml
+++ b/recipes/multicast/cmd_sequences/source_membership.xml
@@ -1,27 +1,26 @@
-<!-- IP_ADD/DROP_SOURCE_MEMBERSHIP test -->
-<!-- Requires: 2 hosts
+<!-- IP_ADD/DROP_SOURCE_MEMBERSHIP test --><!-- Requires: 2 hosts
- [1] with one interface
- [2] with one interface
- -->
<!-- NOTICE: IGMP packets must be forwarded through the network!
In kvm/libvirt environment, iptables on host must be off or
configured to forward igmp traffic through the bridge -->
-<command_sequence>
+<task>
<!-- IP_ADD/DROP_MEMBERSHIP sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_source_membership"/>
<option name="condition" value="status == 'pass'"/>
</options>
- </command>
+ </run>
<!-- This simple test case verifies that if one side leaves multicast group
- in the middle of ongoing communication, no further packets are delivered
- to the process. -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -31,9 +30,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_source_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -45,14 +44,14 @@
<option name="condition" value="packets_received > 0"/>
<option name="condition" value="packets_received_after_drop == 0"/>
</options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
+ </run>
+ <wait bg_id="1" machine="1"/>
<!-- Nonexistent source -->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -62,9 +61,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_source_membership"/>
<option name="address" value="{$multicast_group}"/>
@@ -76,7 +75,7 @@
<option name="condition" value="packets_received == 0"/>
<option name="condition" value="packets_received_after_drop == 0"/>
</options>
- </command>
- <command machine_id="1" type="wait" value="1"/>
+ </run>
+ <wait bg_id="1" machine="1"/>
-</command_sequence>
+</task>
diff --git a/recipes/multicast/cmd_sequences/ttl.xml b/recipes/multicast/cmd_sequences/ttl.xml
index b96ad8c..6390f31 100644
--- a/recipes/multicast/cmd_sequences/ttl.xml
+++ b/recipes/multicast/cmd_sequences/ttl.xml
@@ -1,20 +1,21 @@
-<!-- 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>
+<task>
<!-- IP_MULTICAST_TTL sockopt conformance test -->
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="sockopt_ttl"/>
<option name="condition" value="status == 'pass'"/>
</options>
- </command>
+ </run>
<!-- IP_MULTICAST_TTL = 0, looped on one host -->
- <command machine_id="1" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -25,9 +26,9 @@
<option name="loop" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="1" timeout="30" type="test" value="Multicast">
+ <run machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -37,9 +38,9 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
+ <wait bg_id="1" machine="1"/>
<!-- IP_MULTICAST_TTL = 0 between 2 hosts -->
<!-- KNOWN BUG: according to the specs, packets
@@ -50,10 +51,10 @@
http://www.spinics.net/lists/netdev/msg183704.html
-->
- <command machine_id="1" type="exec" value="sleep 1"/>
- <command machine_id="2" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
+ <run command="sleep 1" machine="2"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -63,9 +64,9 @@
<option name="ttl" value="0"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -75,14 +76,14 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
+ <wait bg_id="1" machine="1"/>
<!-- IP_MULTICAST_TTL = 1 between 2 hosts -->
- <command machine_id="1" type="exec" value="sleep 1"/>
+ <run command="sleep 1" machine="1"/>
- <command bg_id="1" machine_id="1" timeout="30" type="test" value="Multicast">
+ <run bg_id="1" machine="1" module="Multicast" timeout="30">
<options>
<option name="setup" value="send_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -92,9 +93,9 @@
<option name="ttl" value="1"/>
<option name="interface" value="{ip(1,testiface)}"/>
</options>
- </command>
+ </run>
- <command machine_id="2" timeout="30" type="test" value="Multicast">
+ <run machine="2" module="Multicast" timeout="30">
<options>
<option name="setup" value="recv_simple"/>
<option name="address" value="{$multicast_group}"/>
@@ -104,7 +105,7 @@
<option name="condition" value="packets_received > 0"/>
</options>
- </command>
+ </run>
- <command machine_id="1" type="wait" value="1"/>
-</command_sequence>
+ <wait bg_id="1" machine="1"/>
+</task>
diff --git a/recipes/multicast/multicast-all.xml b/recipes/multicast/multicast-all.xml
index 5378195..7b653d0 100644
--- a/recipes/multicast/multicast-all.xml
+++ b/recipes/multicast/multicast-all.xml
@@ -1,19 +1,7 @@
<!-- Execute all tests for multicast -->
<lnstrecipe>
- <!-- Change these parameters to match your test environment setup -->
- <define>
- <alias name="hostname1" value="192.168.122.11"/>
- <alias name="virtdomain1" value="RHEL6"/>
-
- <alias name="hostname2" value="192.168.122.10"/>
- <alias name="virtdomain2" value="Fedora16-clone"/>
- </define>
<machines>
<machine id="1">
- <params>
- <param name="hostname" value="{$hostname1}"/>
- <param name="libvirt_domain" value="{$virtdomain1}"/>
- </params>
<interfaces>
<eth id="testiface" network="tnet">
<addresses>
@@ -28,10 +16,6 @@
</interfaces>
</machine>
<machine id="2">
- <params>
- <param name="hostname" value="{$hostname2}"/>
- <param name="libvirt_domain" value="{$virtdomain2}"/>
- </params>
<interfaces>
<eth id="testiface" network="tnet">
<addresses>
@@ -50,12 +34,12 @@
<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"/>
+ <task source="cmd_sequences/max_groups.xml"/>
+ <task source="cmd_sequences/block_source.xml"/>
+ <task source="cmd_sequences/source_membership.xml"/>
+ <task source="cmd_sequences/membership.xml"/>
+ <task source="cmd_sequences/if.xml"/>
+ <task source="cmd_sequences/ttl.xml"/>
+ <task source="cmd_sequences/loop.xml"/>
+ <task source="cmd_sequences/simple.xml"/>
</lnstrecipe>
10 years, 8 months
[lnst] recipes: Updating example recipes
by Jiří Pírko
commit 5fd418f155e81d2d37b6d2dc48c5fe6502c41bba
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:09 2013 +0200
recipes: Updating example recipes
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/examples/quick_guides/ping_check.xml | 27 ++++---------------------
1 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/recipes/examples/quick_guides/ping_check.xml b/recipes/examples/quick_guides/ping_check.xml
index 73495f6..586fffe 100644
--- a/recipes/examples/quick_guides/ping_check.xml
+++ b/recipes/examples/quick_guides/ping_check.xml
@@ -1,22 +1,13 @@
<!--
-This is a recipe from a quick guide that
-is available on LNST wiki page:
+This is a recipe from a quick guide that is available on LNST wiki page:
https://fedorahosted.org/lnst/wiki/QuickGuides/QuickGuidePingCheck
-->
<lnstrecipe>
<machines>
<machine id="testmachine1">
- <params>
- <!-- Change hostname bellow -->
- <param name="hostname" value="192.168.1.2"/>
- </params>
<interfaces>
<eth id="testifc1" network="tnet">
- <params>
- <!-- Change hwaddr here -->
- <param name="hwaddr" value="52:54:01:00:00:05"/>
- </params>
<addresses>
<address value="192.168.200.2/24"/>
</addresses>
@@ -25,16 +16,8 @@ is available on LNST wiki page:
</machine>
<machine id="testmachine2">
- <params>
- <!-- Change hostname bellow -->
- <param name="hostname" value="192.168.1.3"/>
- </params>
<interfaces>
<eth id="testifc2" network="tnet">
- <params>
- <!-- Change hwaddr here -->
- <param name="hwaddr" value="52:54:01:00:00:06"/>
- </params>
<addresses>
<address value="192.168.200.3/24"/>
</addresses>
@@ -43,12 +26,12 @@ is available on LNST wiki page:
</machine>
</machines>
- <command_sequence>
- <command type="test" machine_id="testmachine1" value="IcmpPing">
+ <task>
+ <run machine="testmachine1" module="IcmpPing">
<options>
<option name="addr" value="{ip(testmachine2,testifc2)}"/>
<option name="count" value="3"/>
</options>
- </command>
- </command_sequence>
+ </run>
+ </task>
</lnstrecipe>
10 years, 8 months
[lnst] misc: Updating the recipe conversion script
by Jiří Pírko
commit 56d1e1ce67294bbb5bb69faf8f69154938868fd5
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:08 2013 +0200
misc: Updating the recipe conversion script
The recipe conversion has been updated to be able to convert the old
command sequences to the new task syntax.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
misc/recipe_conv.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 2 deletions(-)
---
diff --git a/misc/recipe_conv.py b/misc/recipe_conv.py
index 9bfc74e..a5c19c4 100755
--- a/misc/recipe_conv.py
+++ b/misc/recipe_conv.py
@@ -40,15 +40,67 @@ def remove_recipe_eval(dom):
subscript = opt.getAttribute("value")
opt.setAttribute("value", "{$recipe%s}" % subscript)
+def _rename_attr(node, prev_name, new_name):
+ if node.hasAttribute(prev_name):
+ value = node.getAttribute(prev_name)
+ node.removeAttribute(prev_name)
+ node.setAttribute(new_name, value)
+
+def cmd_seqs_to_tasks(dom):
+ seqs = dom.getElementsByTagName("command_sequence")
+
+ for seq in seqs:
+ dom.renameNode(seq, "task", "task")
+
+ cmds = seq.getElementsByTagName("command")
+ for cmd in cmds:
+ cmd_type = cmd.getAttribute("type")
+ cmd.removeAttribute("type")
+
+ dom.renameNode(cmd, cmd_type, cmd_type)
+
+ if cmd.hasAttribute("machine_id"):
+ _rename_attr(cmd, "machine_id", "machine")
+
+ # Change 'pass_result' to expect
+ if cmd.hasAttribute("pass_result"):
+ value = cmd.getAttribute("pass_result")
+ cmd.removeAttribute("pass_result")
+
+ # In this case, the value must be converted as well
+ value = "fail"
+ if re.match(r"(?i)(true)", value) or \
+ re.match(r"(?i)(yes)", value) or value == "1":
+ value = "pass"
+ cmd.setAttribute("expect", value)
+
+ if cmd_type == "test":
+ dom.renameNode(cmd, "run", "run")
+ _rename_attr(cmd, "value", "module")
+ elif cmd_type == "exec":
+ dom.renameNode(cmd, "run", "run")
+ _rename_attr(cmd, "value", "command")
+ elif cmd_type == "system_config":
+ dom.renameNode(cmd, "config", "config")
+ elif cmd_type in ["wait", "intr", "kill"]:
+ _rename_attr(cmd, "value", "bg_id")
+ elif cmd_type == "ctl_wait":
+ _rename_attr(cmd, "value", "seconds")
+
def convert_recipe(file_path):
dom = parse(file_path)
- change_netdev_to_iface(dom)
- remove_recipe_eval(dom)
+ #change_netdev_to_iface(dom)
+ #remove_recipe_eval(dom)
+ cmd_seqs_to_tasks(dom)
output = dom.toxml()
output = re.sub(r"<\?xml[^>]*\?>", "", output)
+ output = output.replace(""", "\"")
+ output = output.replace(">", ">")
+ output = output.replace("<", "<")
+
writer = open(file_path, "w")
writer.write(output)
writer.close()
10 years, 8 months
[lnst] ctl: Massive refactoring of NetTestController
by Jiří Pírko
commit 68cc94a3177d8413aeaeb7d66c846472c5a48417
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:07 2013 +0200
ctl: Massive refactoring of NetTestController
This patch contains the second part of the changes that were done in the
RecipeParser. Many semantic checks were moved from the parser to the
controller, which now properly controls the execution of recipes.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestController.py | 404 ++++++++++++++++++++++++----------
1 files changed, 286 insertions(+), 118 deletions(-)
---
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 47c615a..ca41ca2 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -24,10 +24,10 @@ from lnst.Common.XmlRpc import ServerProxy, ServerException
from lnst.Common.NetUtils import MacPool
from lnst.Common.VirtUtils import VirtNetCtl, VirtDomainCtl, BridgeCtl
from lnst.Common.Utils import wait_for, md5sum, dir_md5sum, create_tar_archive
-from lnst.Common.Utils import check_process_running
+from lnst.Common.Utils import check_process_running, bool_it
from lnst.Common.NetTestCommand import NetTestCommandContext, NetTestCommand
from lnst.Common.NetTestCommand import str_command, CommandException
-from lnst.Controller.RecipeParse import RecipeParse
+from lnst.Controller.RecipeParse import RecipeParse, RecipeError
from lnst.Controller.SlavePool import SlavePool
from lnst.Controller.Machine import Machine, MachineError
from lnst.Common.ConnectionHandler import send_data, recv_data
@@ -56,23 +56,14 @@ class NetTestController:
self._machines = {}
self._network_bridges = {}
-
- self._recipe = recipe = {}
- recipe["networks"] = {}
- recipe["machines"] = {}
- recipe["switches"] = {}
+ self._tasks = []
mac_pool_range = lnst_config.get_option('environment', 'mac_pool_range')
self._mac_pool = MacPool(mac_pool_range[0], mac_pool_range[1])
parser = RecipeParse(recipe_path)
- parser.set_target(self._recipe)
parser.set_machines(self._machines)
-
- parser.register_event_handler("provisioning_requirements_ready",
- self._prepare_provisioning)
- parser.register_event_handler("interface_config_ready",
- self._prepare_interface)
+ self._recipe = parser.parse_recipe()
modules_dirs = lnst_config.get_option('environment', 'module_dirs')
tools_dirs = lnst_config.get_option('environment', 'tool_dirs')
@@ -81,8 +72,6 @@ class NetTestController:
self._resource_table["module"] = self._load_test_modules(modules_dirs)
self._resource_table["tools"] = self._load_test_tools(tools_dirs)
- self._parser = parser
-
def _get_machineinfo(self, machine_id):
try:
info = self._recipe["machines"][machine_id]["params"]
@@ -98,14 +87,95 @@ class NetTestController:
msg = "SSH session terminated with status %s" % status
raise NetTestError(msg)
- def _prepare_provisioning(self):
- machines = self._recipe["machines"]
- if len(machines) <= 0:
- return
+ def _get_machine_requirements(self):
+ recipe = self._recipe
+
+ # There must be some machines specified in the recipe
+ if "machines" not in recipe or \
+ ("machines" in recipe and len(recipe["machines"]) == 0):
+ msg = "No machines specified in the recipe. At least two " \
+ "machines are required to perform a network test."
+ raise RecipeError(msg, recipe)
+
+ # machine requirements
+ mreq = {}
+ for machine in recipe["machines"]:
+ m_id = machine["id"]
+
+ if m_id in mreq:
+ msg = "Machine with id='%s' already exists." % m_id
+ raise RecipeError(msg, machine)
+
+ params = {}
+ if "params" in machine:
+ for p in machine["params"]:
+ if p["name"] in params:
+ msg = "Parameter '%s' of machine %s was specified " \
+ "multiple times. Overriding the previous value." \
+ % (p["name"], m_id)
+ logging.warn(RecipeError(msg, p))
+ name = p["name"]
+ val = p["value"]
+ params[name] = val
+
+ # Each machine must have at least one interface
+ if "interfaces" not in machine or \
+ ("interfaces" in machine and len(machine["interfaces"]) == 0):
+ msg = "Machine '%s' has no interfaces specified." % m_id
+ raise RecipeError(msg, machine)
+
+ ifaces = {}
+ for iface in machine["interfaces"]:
+ if_id = iface["id"]
+ if if_id in ifaces:
+ msg = "Interface with id='%s' already exists on machine " \
+ "'%s'." % (if_id, m_id)
+
+ iface_type = iface["type"]
+ if iface_type != "eth":
+ continue
+
+ iface_params = {}
+ if "params" in iface:
+ for i in iface["params"]:
+ if i["name"] in iface_params:
+ msg = "Parameter '%s' of interface %s of " \
+ "machine %s was defined multiple times. " \
+ "Overriding the previous value." \
+ % (i["name"], if_id, m_id)
+ logging.warn(RecipeError(msg, p))
+ name = i["name"]
+ val = i["value"]
+ iface_params[name] = val
+
+ ifaces[if_id] = {
+ "network": iface["network"],
+ "params": iface_params
+ }
+
+ mreq[m_id] = {"params": params, "interfaces": ifaces}
+
+ return mreq
+
+ def _prepare_network(self):
+ recipe = self._recipe
+
+ mreq = self._get_machine_requirements()
+ self._prepare_provisioning(mreq)
+
+ machines = self._machines
+ for m_id in machines.keys():
+ self._prepare_machine(m_id)
+
+ for machine_xml_data in recipe["machines"]:
+ m_id = machine_xml_data["id"]
+ for iface_xml_data in machine_xml_data["interfaces"]:
+ self._prepare_interface(m_id, iface_xml_data)
+ def _prepare_provisioning(self, mreq):
sp = self._slave_pool
- machines = sp.provision_machines(machines)
- if machines == None:
+ machines = self._machines
+ if not sp.provision_machines(mreq, machines):
msg = "This setup cannot be provisioned with the current pool."
raise NetTestError(msg)
@@ -115,17 +185,11 @@ class NetTestController:
"priviledges so it can connect to qemu."
raise NetTestError(msg)
- for m_id, machine in machines.iteritems():
- self._machines[m_id] = machine
-
logging.info("Provisioning initialized")
for m_id in machines.keys():
provisioner = sp.get_provisioner_id(m_id)
logging.info(" machine %s uses %s" % (m_id, provisioner))
- for m_id in machines.keys():
- self._prepare_machine(m_id)
-
def _prepare_machine(self, m_id):
machine = self._machines[m_id]
address = socket.gethostbyname(machine.get_hostname())
@@ -140,31 +204,164 @@ class NetTestController:
machine.configure(recipe_name, self._docleanup)
machine.sync_resources(self._resource_table)
- def _prepare_interface(self, machine_id, if_id):
- machine = self._machines[machine_id]
- ifconfig = self._recipe["machines"][machine_id]["interfaces"][if_id]
- if_type = ifconfig["type"]
+ def _prepare_interface(self, m_id, iface_xml_data):
+ machine = self._machines[m_id]
+ if_id = iface_xml_data["id"]
+ if_type = iface_xml_data["type"]
try:
iface = machine.get_interface(if_id)
except MachineError:
iface = machine.new_soft_interface(if_id, if_type)
- if "slaves" in ifconfig:
- for slave_id in ifconfig["slaves"]:
+ if "slaves" in iface_xml_data:
+ for slave in iface_xml_data["slaves"]:
+ slave_id = slave["id"]
iface.add_slave(machine.get_interface(slave_id))
- iface.set_slave_options(ifconfig["slave_options"])
- if "addresses" in ifconfig:
- for addr in ifconfig["addresses"]:
+ # Some soft devices (such as team) use per-slave options
+ if "options" in slave:
+ for opt in slave["options"]:
+ iface.set_slave_option(slave_id, opt["name"],
+ opt["value"])
+
+ if "addresses" in iface_xml_data:
+ for addr in iface_xml_data["addresses"]:
iface.add_address(addr)
- if "options" in ifconfig:
- for name, value in ifconfig["options"]:
- iface.set_option(name, value)
+ if "options" in iface_xml_data:
+ for opt in iface_xml_data["options"]:
+ iface.set_option(opt["name"], opt["value"])
iface.configure()
+ def _prepare_tasks(self):
+ recipe = self._recipe
+ for task_data in self._recipe["tasks"]:
+ task = {}
+
+ if "quit_on_fail" in task_data:
+ task["quit_on_fail"] = bool_it(task_data["quit_on_fail"])
+
+ task["commands"] = []
+ for cmd_data in task_data["commands"]:
+ cmd = {"type": cmd_data["type"]}
+
+ if "machine" in cmd_data:
+ cmd["machine"] = cmd_data["machine"]
+ if cmd["machine"] not in self._machines:
+ msg = "Invalid machine id '%s'." % cmd["machine"]
+ raise RecipeError(msg, cmd_data)
+
+ if "expect" in cmd_data:
+ expect = cmd_data["expect"]
+ if expect not in ["pass", "fail"]:
+ msg = "Illegal expect attribute value."
+ raise RecipeError(msg, cmd_data)
+ cmd["expect"] = expect == "pass"
+
+ if cmd["type"] == "test":
+ cmd["module"] = cmd_data["module"]
+
+ cmd_opts = {}
+ if "options" in cmd_data:
+ for opt in cmd_data["options"]:
+ name = opt["name"]
+ val = opt["value"]
+
+ if name not in cmd_opts:
+ cmd_opts[name] = []
+
+ cmd_opts[name].append({"value": val})
+ cmd["options"] = cmd_opts
+ elif cmd["type"] == "exec":
+ cmd["command"] = cmd_data["command"]
+
+ if "from" in cmd_data:
+ tool = cmd_data["from"]
+ if tool in self._resource_table["tools"]:
+ cmd["command"] = cmd_data["command"]
+ else:
+ msg = "Tool '%s' not found on the controller" % tool
+ raise RecipeError(msg, cmd_data)
+ elif cmd["type"] in ["wait", "intr", "kill"]:
+ # XXX The internal name (proc_id) is different, because
+ # bg_id is already used by LNST in a different context
+ cmd["proc_id"] = cmd_data["bg_id"]
+ elif cmd["type"] == "config":
+ cmd["persistent"] = False
+ if "persistent" in cmd_data:
+ cmd["persistent"] = bool_it(cmd_data["persistent"])
+
+ cmd["options"] = []
+ for opt in cmd_data["options"]:
+ name = opt["name"]
+ value = opt["value"]
+ cmd["options"].append({"name": name, "value": value})
+ elif cmd["type"] == "ctl_wait":
+ cmd["seconds"] = int(cmd_data["seconds"])
+ else:
+ msg = "Unknown command type '%s'" % cmd["type"]
+ raise RecipeError(msg, cmd_data)
+
+
+ if cmd["type"] in ["test", "exec"]:
+ if "bg_id" in cmd_data:
+ cmd["bg_id"] = cmd_data["bg_id"]
+
+ if "timeout" in cmd_data:
+ try:
+ cmd["timeout"] = int(cmd_data["timeout"])
+ except ValueError:
+ msg = "Timeout value must be an integer."
+ raise RecipeError(msg, cmd_data)
+
+ task["commands"].append(cmd)
+
+ if self._check_task(task):
+ raise RecipeError("Incorrect command sequence.", task_data)
+ self._tasks.append(task)
+
+ def _check_task(self, task):
+ err = False
+ bg_ids = {}
+ for i, command in enumerate(task["commands"]):
+ if command["type"] == "ctl_wait":
+ continue
+
+ machine_id = command["machine"]
+ if not machine_id in bg_ids:
+ bg_ids[machine_id] = set()
+
+ cmd_type = command["type"]
+ if cmd_type in ["wait", "intr", "kill"]:
+ bg_id = command["proc_id"]
+ if bg_id in bg_ids[machine_id]:
+ bg_ids[machine_id].remove(bg_id)
+ else:
+ logging.error("Found command \"%s\" for bg_id \"%s\" on "
+ "machine \"%s\" which was not previously "
+ "defined", cmd_type, bg_id, machine_id)
+ err = True
+
+ if "bg_id" in command:
+ bg_id = command["bg_id"]
+ if not bg_id in bg_ids[machine_id]:
+ bg_ids[machine_id].add(bg_id)
+ else:
+ logging.error("Command \"%d\" uses bg_id \"%s\" on machine "
+ "\"%s\" which is already used",
+ i, bg_id, machine_id)
+ err = True
+
+ for machine_id in bg_ids:
+ for bg_id in bg_ids[machine_id]:
+ logging.error("bg_id \"%s\" on machine \"%s\" has no kill/wait "
+ "command to it", bg_id, machine_id)
+ err = True
+
+ return err
+
def _cleanup_slaves(self, deconfigure=True):
if self._machines == None:
return
@@ -180,94 +377,27 @@ class NetTestController:
for bridge in self._network_bridges.itervalues():
bridge.cleanup()
- def _prepare(self):
- # All the perparations are made within the recipe parsing
- # This is achieved by handling parser events
- try:
- self._parser.parse_recipe()
- except Exception as exc:
- logging.error("Exception raised during recipe parsing. "\
- "Deconfiguring machines.")
- self._cleanup_slaves()
- raise
-
- def _run_command(self, command):
- if "desc" in command:
- logging.info("Cmd description: %s", desc)
-
- if command["type"] == "ctl_wait":
- sleep(command["value"])
- cmd_res = {"passed" : True}
- return cmd_res
-
- machine_id = command["machine_id"]
- machine = self._machines[machine_id]
-
- cmd_res = machine.run_command(command)
- return cmd_res
-
- def _run_command_sequence(self, sequence):
- seq_passed = True
- for command in sequence["commands"]:
- logging.info("Executing command: [%s]", str_command(command))
-
- try:
- cmd_res = self._run_command(command)
- except Exception as exc:
- cmd_res = {"passed": False, "err_msg": "Exception raised."}
- raise exc
- finally:
- if self._res_serializer:
- self._res_serializer.add_cmd_result(command, cmd_res)
- logging.debug("Result: %s", str(cmd_res))
- if "res_data" in cmd_res:
- res_data = pformat(cmd_res["res_data"])
- logging.info("Result data: %s", (res_data))
- if not cmd_res["passed"]:
- logging.error("Command failed: [%s], Error message: \"%s\"",
- str_command(command), cmd_res["err_msg"])
- seq_passed = False
- return seq_passed
-
+ # TODO: This should go away.
def dump_recipe(self):
- self._prepare()
+ self._prepare_network()
pprint(self._recipe)
self._cleanup_slaves()
return True
def match_setup(self):
- try:
- self._parser.first_pass()
- except Exception as exc:
- logging.error("Exception raised during recipe parsing. "\
- "Deconfiguring machines.")
- self._cleanup_slaves()
- raise
-
- machines = self._recipe["machines"]
- if len(machines) <= 0:
- return
-
- sp = self._slave_pool
- machines = sp.provision_machines(machines)
- if machines == None:
- msg = "This setup cannot be provisioned with the current pool."
- raise NetTestError(msg)
-
- logging.info("Provisioning initialized")
- for m_id in machines.keys():
- provisioner = sp.get_provisioner_id(m_id)
- logging.info(" machine %s matched to %s" % (m_id, provisioner))
+ mreq = self._get_machine_requirements()
+ self._prepare_provisioning(mreq)
return True
def config_only_recipe(self):
- self._prepare()
+ self._prepare_network()
self._cleanup_slaves(deconfigure=False)
return True
def run_recipe(self, packet_capture=False):
- self._prepare()
+ self._prepare_network()
+ self._prepare_tasks()
if packet_capture:
self._start_packet_capture()
@@ -289,10 +419,10 @@ class NetTestController:
def _run_recipe(self):
overall_res = True
- for sequence in self._recipe["sequences"]:
+ for task in self._tasks:
try:
- self._res_serializer.add_command_sequence()
- res = self._run_command_sequence(sequence)
+ self._res_serializer.add_task()
+ res = self._run_task(task)
except CommandException as exc:
logging.debug(exc)
overall_res = False
@@ -301,14 +431,52 @@ class NetTestController:
for machine in self._machines.itervalues():
machine.restore_system_config()
- # sequence failed, check if we should quit_on_fail
+ # task failed, check if we should quit_on_fail
if not res:
overall_res = False
- if sequence["quit_on_fail"] == "yes":
+ if task["quit_on_fail"]:
break
return overall_res
+ def _run_task(self, task):
+ seq_passed = True
+ for command in task["commands"]:
+ logging.info("Executing command: [%s]", str_command(command))
+
+ try:
+ cmd_res = self._run_command(command)
+ except Exception as exc:
+ cmd_res = {"passed": False, "err_msg": "Exception raised."}
+ raise exc
+ finally:
+ if self._res_serializer:
+ self._res_serializer.add_cmd_result(command, cmd_res)
+ logging.debug("Result: %s", str(cmd_res))
+ if "res_data" in cmd_res:
+ res_data = pformat(cmd_res["res_data"])
+ logging.info("Result data: %s", (res_data))
+ if not cmd_res["passed"]:
+ logging.error("Command failed: [%s], Error message: \"%s\"",
+ str_command(command), cmd_res["err_msg"])
+ seq_passed = False
+ return seq_passed
+
+ def _run_command(self, command):
+ if "desc" in command:
+ logging.info("Cmd description: %s", desc)
+
+ if command["type"] == "ctl_wait":
+ sleep(command["seconds"])
+ cmd_res = {"passed" : True}
+ return cmd_res
+
+ machine_id = command["machine"]
+ machine = self._machines[machine_id]
+
+ cmd_res = machine.run_command(command)
+ return cmd_res
+
def _start_packet_capture(self):
logging.info("Starting packet capture")
for machine_id, machine in self._machines.iteritems():
10 years, 8 months
[lnst] ctl: Changing pass_result to expect
by Jiří Pírko
commit 97215e5d558795a17eb8f06caaa250f60a11a52d
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:06 2013 +0200
ctl: Changing pass_result to expect
The pass_result was changed to expect. Additionaly, LNST was failing in
case the pass_result was false. In that case the "err_msg" was not set
properly. This patch also fixes the problem.
I added a FIXME comment there, because this (in my opinion) should be
done earlier on the slave rather than here. This way, the slave prints
ERROR as if the command failed (because it had in fact failed on the
slave), but the controller knows it was expected and puts PASS to the
summary. This is confusing.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 8fd8a40..76e35b5 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -186,8 +186,12 @@ class Machine(object):
signal.alarm(0)
signal.signal(signal.SIGALRM, prev_handler)
- if "pass_result" in command:
- cmd_res["passed"] = cmd_res["passed"] == command["pass_result"]
+ # FIXME: This shouldn't be here!
+ if "expect" in command:
+ cmd_res["passed"] = cmd_res["passed"] == command["expect"]
+ if not cmd_res["passed"]:
+ msg = "The result differs from what was expected."
+ cmd_res["err_msg"] = msg
return cmd_res
10 years, 8 months
[lnst] commands: Changing the internal structures
by Jiří Pírko
commit fc087985ff602a80d29cf8708ad09c1cb8667732
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:05 2013 +0200
commands: Changing the internal structures
The structure of command sequences changed dramatically. This commit
contains the changes to the internal structures that are sent between
the controller and it slaves.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/NetTestCommand.py | 93 +++++++++++++++++++++++++----------------
1 files changed, 57 insertions(+), 36 deletions(-)
---
diff --git a/lnst/Common/NetTestCommand.py b/lnst/Common/NetTestCommand.py
index 1c34c70..d246795 100644
--- a/lnst/Common/NetTestCommand.py
+++ b/lnst/Common/NetTestCommand.py
@@ -21,15 +21,41 @@ from lnst.Common.ExecCmd import exec_cmd, ExecCmdFail
from lnst.Common.ConnectionHandler import recv_data, send_data
def str_command(command):
- out = ("type (%s), machine_id (%s), value (%s)"
- % (command["type"], command["machine_id"], command["value"]))
- if "timeout" in command:
- out += ", timeout (%d)" % command["timeout"]
- if "bg_id" in command:
- out += ", bg_id (%s)" % command["bg_id"]
- if "desc" in command:
- out += ", desc (%s)" % command["desc"]
- return out
+ attrs = ["type(%s)" % command["type"]]
+ if command["type"] == "test":
+ attrs.append("module(%s)" % command["module"])
+ attrs.append("machine(%s)" % command["machine"])
+
+ if "bg_id" in command:
+ attrs.append("bg_id(%s)" % command["bg_id"])
+ if "timeout" in command:
+ attrs.append("timeout(%s)" % command["timeout"])
+ elif command["type"] == "exec":
+ attrs.append("command(%s)" % command["command"])
+ attrs.append("machine(%s)" % command["machine"])
+
+ if "from" in command:
+ attrs.append("from(%s)" % command["from"])
+ if "bg_id" in command:
+ attrs.append("bg_id(%s)" % command["bg_id"])
+ if "timeout" in command:
+ attrs.append("timeout(%s)" % command["timeout"])
+ elif command["type"] in ["wait", "intr", "kill"]:
+ attrs.append("machine(%s)" % command["machine"])
+ attrs.append("bg_id(%s)" % command["proc_id"])
+ elif command["type"] == "config":
+ attrs.append("machine(%s)" % command["machine"])
+
+ if "option" in command:
+ attrs.append("option(%s)" % command["option"])
+ if "value" in command:
+ attrs.append("value(%s)" % command["value"])
+ elif command["type"] == "ctl_wait":
+ attrs.append("seconds(%s)" % command["seconds"])
+ else:
+ raise RuntimeError("Unknown command type '%s'" % command["type"])
+
+ return ", ".join(attrs)
class CommandException(Exception):
"""Base class for client errors."""
@@ -81,7 +107,7 @@ class NetTestCommand:
def run(self):
if isinstance(self._cmd_cls, NetTestCommandControl) or \
- isinstance(self._cmd_cls, NetTestCommandSystemConfig):
+ isinstance(self._cmd_cls, NetTestCommandConfig):
return self._cmd_cls.run()
self._read_pipe, self._write_pipe = multiprocessing.Pipe()
@@ -146,6 +172,8 @@ class NetTestCommand:
os.killpg(os.getpgid(self._pid), signal.SIGINT)
def kill(self):
+ print self, dir(self)
+ print self._cmd_cls
if os.path.exists("/proc/%d" % self._pid):
if self._id:
logging.debug("Killing background command with id \"%s\", pid \"%d\"" % (self._id, self._pid))
@@ -204,7 +232,7 @@ class NetTestCommandContext:
return pipes
def NetTestCommandTest(command, resource_table):
- test_name = command["value"]
+ test_name = command["module"]
if not test_name in resource_table["module"]:
msg = "Test module '%s' not found" % test_name
@@ -267,9 +295,9 @@ class NetTestCommandExec(NetTestCommandGeneric):
def run(self):
try:
if "from" in self._command:
- self.exec_from(self._command["from"], self._command["value"])
+ self.exec_from(self._command["from"], self._command["command"])
else:
- self.exec_cmd(self._command["value"])
+ self.exec_cmd(self._command["command"])
self.set_pass()
except ExecCmdFail:
if "bg_id" in self._command:
@@ -278,7 +306,7 @@ class NetTestCommandExec(NetTestCommandGeneric):
else:
self.set_fail("Command failed to execute")
-class NetTestCommandSystemConfig(NetTestCommandGeneric):
+class NetTestCommandConfig(NetTestCommandGeneric):
def _retrive_option(self, option):
cmd_str = "cat %s" % option
(stdout, stderr) = exec_cmd(cmd_str)
@@ -289,30 +317,22 @@ class NetTestCommandSystemConfig(NetTestCommandGeneric):
(stdout, stderr) = exec_cmd(cmd_str)
def run(self):
- res_data = {"options": {}, "persistent": False}
-
- # inline version
- if "option" in self._command:
- opt = self._command["option"]
- val = [{"value": self._command["value"]}]
- self._command["options"] = {opt: val}
-
- for option, opt_data in self._command["options"].iteritems():
- new_values = []
- for record in opt_data:
- new_values.append(record["value"])
+ res_data = {"options": [], "persistent": False}
+ for opt in self._command["options"]:
+ option = opt["name"]
+ value = opt["value"]
option_abspath = os.path.abspath(option)
if option_abspath[0:5] != "/sys/" and \
option_abspath[0:6] != "/proc/":
- err = "Wrong config option %s. Only /proc or /sys paths are allowed." % option
+ err = "Wrong config option %s. Only /proc or /sys paths are " \
+ "allowed." % option
self.set_fail(err)
return
try:
prev_val = self._retrive_option(option)
- for new_val in new_values:
- self._set_option(option, new_val)
+ self._set_option(option, value)
except ExecCmdFail:
self.set_fail("Unable to set %s config option!" % option)
return
@@ -320,8 +340,9 @@ class NetTestCommandSystemConfig(NetTestCommandGeneric):
if "persistent" in self._command:
res_data["persistent"] = self._command["persistent"]
- res_data["options"][option] = {"current_val": new_values[-1],
- "previous_val": prev_val}
+ res_data["options"].append({"name": option,
+ "current_val": value,
+ "previous_val": prev_val})
res = {"passed": True}
res["res_data"] = res_data
@@ -334,7 +355,7 @@ class NetTestCommandControl(NetTestCommandGeneric):
class NetTestCommandWait(NetTestCommandControl):
def run(self):
- bg_id = self._command["value"]
+ bg_id = self._command["proc_id"]
bg_cmd = self._command_context.get_cmd(bg_id)
bg_cmd.wait_for()
result = bg_cmd.get_result()
@@ -345,7 +366,7 @@ class NetTestCommandWait(NetTestCommandControl):
class NetTestCommandIntr(NetTestCommandControl):
def run(self):
- bg_id = self._command["value"]
+ bg_id = self._command["proc_id"]
bg_cmd = self._command_context.get_cmd(bg_id)
bg_cmd.interrupt()
result = bg_cmd.get_result()
@@ -356,7 +377,7 @@ class NetTestCommandIntr(NetTestCommandControl):
class NetTestCommandKill(NetTestCommandControl):
def run(self):
- bg_id = self._command["value"]
+ bg_id = self._command["proc_id"]
bg_cmd = self._command_context.get_cmd(bg_id)
bg_cmd.kill()
result = bg_cmd.get_result()
@@ -377,8 +398,8 @@ def get_command_class(command_context, command, resource_table):
cmd_cls = NetTestCommandIntr(command_context, command)
elif cmd_type == "kill":
cmd_cls = NetTestCommandKill(command_context, command)
- elif cmd_type == "system_config":
- cmd_cls = NetTestCommandSystemConfig(command)
+ elif cmd_type == "config":
+ cmd_cls = NetTestCommandConfig(command)
else:
logging.error("Unknown comamnd type \"%s\"" % cmd_type)
raise Exception("Unknown command type \"%s\"" % cmd_type)
10 years, 8 months
[lnst] ctl: Massive refactoring of the RecipeParser
by Jiří Pírko
commit 618b8ba5ed3a264651ed981362a5c97f25059fd6
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:04 2013 +0200
ctl: Massive refactoring of the RecipeParser
Basicaly the whole parser was changed. The parser no longer directs the
execution of the controller. This means the controller hooks were
completely removed and all the semantic checks were moved to
NetTestController.
Apart from that, this commit also contains many structural changes in
the recipe XML file. The <commans_sequence> tag changed to <task>
and the all of the command were changed as well.
For the new format, please refer to the example recipes or to the
documentation that is available online.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/RecipeParse.py | 564 ++++++++++++++-------------------------
1 files changed, 203 insertions(+), 361 deletions(-)
---
diff --git a/lnst/Controller/RecipeParse.py b/lnst/Controller/RecipeParse.py
index e706597..6042dfe 100644
--- a/lnst/Controller/RecipeParse.py
+++ b/lnst/Controller/RecipeParse.py
@@ -16,8 +16,8 @@ import re
from lnst.Common.NetUtils import normalize_hwaddr
from lnst.Common.Utils import bool_it
from lnst.Common.RecipePath import RecipePath
-from lnst.Common.XmlProcessing import XmlDomTreeInit, XmlData
-from lnst.Common.XmlProcessing import XmlProcessingError
+from lnst.Common.XmlProcessing import XmlDomTreeInit, XmlProcessingError
+from lnst.Common.XmlProcessing import XmlData, XmlCollection
from lnst.Common.XmlParser import LnstParser
class RecipeError(XmlProcessingError):
@@ -31,190 +31,95 @@ class RecipeParse(LnstParser):
self._rp = RecipePath(None, self._filepath)
self._include_root = self._rp.get_root()
- def first_pass(self):
+ def parse_recipe(self):
dom_init = XmlDomTreeInit()
rp = self._rp
- self._xml_dom = dom_init.parse_string(rp.to_str(), rp.abs_path())
-
- first_pass = FirstPass(self)
- first_pass.parse(self._xml_dom)
-
- def parse_recipe(self):
- self.first_pass()
- self._trigger_event("provisioning_requirements_ready", {})
-
- second_pass = SecondPass(self)
- second_pass.parse(self._xml_dom)
-
-
-class FirstPass(LnstParser):
- """
- Purpose of the first pass through the recipe is to detect
- machine requirements for provisioning.
-
- The purpose is generic, but the first pass exist only to
- detect provisioning at the moment.
- """
+ self._xml_dom = node = dom_init.parse_string(rp.to_str(), rp.abs_path())
- def parse(self, node):
if node.nodeType == node.DOCUMENT_NODE:
scheme = {"lnstrecipe": self._lnstrecipe}
- self._process_child_nodes(node, scheme,
- default_handler=self._ignore_tag)
+ self._process_child_nodes(node, scheme)
else:
- raise XmlProcessingError("Passed object is not a XML document")
-
- def _lnstrecipe(self, node, params):
- scheme = {"machines": self._machines}
- self._process_child_nodes(node, scheme,
- default_handler=self._ignore_tag)
-
- def _machines(self, node, params):
- if not "machines" in self._data:
- self._data["machines"] = {}
-
- scheme = {"machine": self._machine}
- self._process_child_nodes(node, scheme,
- default_handler=self._ignore_tag)
+ raise ValueError("Passed object is not a XML document")
- def _machine(self, node, params):
- m_id = self._get_attribute(node, "id")
- if not m_id in self._data["machines"]:
- self._data["machines"][m_id] = {}
+ return self._data
- if not "params" in self._data["machines"][m_id]:
- self._data["machines"][m_id]["params"] = {}
-
- if not "interfaces" in self._data["machines"][m_id]:
- self._data["machines"][m_id]["interfaces"] = {}
-
- target = self._data["machines"][m_id]["params"]
- params = {"id": m_id, "target": target}
- scheme = {"params": self._params,
- "interfaces": self._interfaces}
- self._process_child_nodes(node, scheme, params,
- default_handler=self._ignore_tag)
-
- def _params(self, node, params):
- subparser = ParamsParse(self)
- subparser.set_params_dict(params["target"])
- subparser.parse(node)
-
- def _interfaces(self, node, params):
- params = {"id": params["id"]}
- scheme = {"eth": self._interface,
- "bond": self._interface,
- "team": self._interface,
- "vlan": self._interface,
- "macvlan": self._interface,
- "bridge": self._interface}
- self._process_child_nodes(node, scheme, params)
-
- def _interface(self, node, params):
- m_id = params["id"]
- machine = self._data["machines"][m_id]
-
- if_id = self._get_attribute(node, "id")
- if_type = node.tagName
-
- if if_id in machine["interfaces"]:
- msg = "Two interfaces with the same id '%s', " % if_id
- raise XmlProcessingError(msg)
-
- # Matching works with eth devices only
- if if_type != "eth":
- return
-
- if not if_id in machine["interfaces"]:
- machine["interfaces"][if_id] = {}
- iface = machine["interfaces"][if_id]
-
- iface["type"] = if_type
- iface["network"] = self._get_attribute(node, "network")
-
- if not "params" in machine["interfaces"][if_id]:
- machine["interfaces"][if_id]["params"] = {}
-
- target = machine["interfaces"][if_id]["params"]
- params = {"target": target}
- scheme = {"params": self._params}
- self._process_child_nodes(node, scheme, params,
- default_handler=self._ignore_tag)
-
- def _ignore_tag(self, node, params):
- pass
-
-
-class SecondPass(LnstParser):
- """
- Second pass makes sure all recognized values from the recipe
- are properly saved into the self._data.
-
- This is where the real parsing is done.
- """
-
- def parse(self, xml_dom):
- if xml_dom.nodeType == xml_dom.DOCUMENT_NODE:
- scheme = {"lnstrecipe": self._lnstrecipe}
- self._process_child_nodes(xml_dom, scheme)
+ def _lnstrecipe(self, node, params):
+ if self._data == None:
+ self._data = XmlData(node)
else:
- raise XmlProcessingError("Passed object is not a XML document")
+ msg = "Only a single <lnstrecipe> tag allowed in the document."
+ raise RecipeError(msg, node)
- def _lnstrecipe(self, node, params):
scheme = {"machines": self._machines,
"switches": self._switches,
- "command_sequence": self._command_sequence}
+ "task": self._task}
self._process_child_nodes(node, scheme)
def _machines(self, node, params):
+ if "machines" not in self._data:
+ self._data["machines"] = XmlCollection(node)
+ else:
+ msg = "Only a single <machines> child allowed in <lnstrecipe>."
+ raise RecipeError(msg, node)
+
scheme = {"machine": self._machine}
self._process_child_nodes(node, scheme)
def _machine(self, node, params):
subparser = MachineParse(self)
- subparser.set_type("host")
- subparser.parse(node)
+ m = subparser.parse(node)
+ self._data["machines"].append(m)
def _switches(self, node, params):
+ if "switches" not in self._data:
+ self._data["switches"] = XmlCollection(node)
+ else:
+ msg = "Only a single <switches> child allowed in <lnstrecipe>."
+ raise RecipeError(msg, node)
+
scheme = {"switch": self._switch}
self._process_child_nodes(node, scheme)
def _switch(self, node, params):
subparser = MachineParse(self)
- subparser.set_type("switch")
- subparser.parse(node)
-
- def _command_sequence(self, node, params):
- if not "sequences" in self._data:
- self._data["sequences"] = []
+ s = subparser.parse(node)
+ self._data["switches"].append(s)
- subparser = CommandSequenceParse(self)
- subparser.parse(node)
+ def _task(self, node, params):
+ if "tasks" not in self._data:
+ self._data["tasks"] = XmlCollection(node)
+ subparser = TaskParse(self)
+ task = subparser.parse(node)
+ self._data["tasks"].append(task)
class MachineParse(LnstParser):
- _target = "machines"
-
- def set_type(self, machine_type):
- if machine_type == "host":
- self._target = "machines"
- elif machine_type == "switch":
- self._target = "switches"
- else:
- raise XmlProcessingError("Unknown machine type")
-
def parse(self, node):
- self._id = self._get_attribute(node, "id")
-
- recipe = self._data
- self._machine = recipe["machines"][self._id]
- self._machine["netconfig"] = {}
+ self._data = XmlData(node)
+ self._data["id"] = self._get_attribute(node, "id")
- scheme = {"params": self._ignore_tag,
+ scheme = {"params": self._params,
"interfaces": self._interfaces}
self._process_child_nodes(node, scheme)
+ return self._data
+
+ def _params(self, node, params):
+ if "params" in self._data:
+ msg = "Only a single <params> child allowed under <machine>."
+ raise RecipeError(msg, node)
+
+ subparser = ParamsParse(self)
+ self._data["params"] = subparser.parse(node)
+
def _interfaces(self, node, params):
+ if "interfaces" not in self._data:
+ self._data["interfaces"] = XmlCollection(node)
+ else:
+ msg = "Only a single <interfaces> child allowed under <machine>."
+ raise RecipeError(msg, node)
+
scheme = {"eth": self._interface,
"bond": self._interface,
"team": self._interface,
@@ -225,29 +130,15 @@ class MachineParse(LnstParser):
def _interface(self, node, params):
subparser = InterfaceParse(self)
- subparser.set_machine(self._id, self._machine)
- subparser.parse(node)
-
- def _ignore_tag(self, node, params):
- pass
+ iface = subparser.parse(node)
+ self._data["interfaces"].append(iface)
class InterfaceParse(LnstParser):
- _machine_id = None
- _machine = None
- _iface = None
-
- def set_machine(self, machine_id, machine):
- self._machine_id = machine_id
- self._machine = machine
-
def parse(self, node):
- if_id = self._get_attribute(node, "id")
+ self._data = iface = XmlData(node)
+ self._data["id"] = if_id = self._get_attribute(node, "id")
- if not if_id in self._machine["interfaces"]:
- self._machine["interfaces"][if_id] = {}
- self._iface = iface = self._machine["interfaces"][if_id]
-
- iface["type"] = node.tagName
+ iface["type"] = str(node.tagName)
scheme = {"addresses": self._addresses}
if iface["type"] in ["bond", "bridge", "vlan", "macvlan", "team"]:
@@ -257,22 +148,24 @@ class InterfaceParse(LnstParser):
if self._has_attribute(node, "network"):
msg = "Attribute network is not supported by type '%s' " + \
"interfaces" % iface["type"]
- raise XmlProcessingError(msg)
+ raise RecipeError(msg, node)
elif iface["type"] == "eth":
iface["network"] = self._get_attribute(node, "network")
- scheme["params"] = self._ignore_tag
+ scheme["params"] = self._params
self._process_child_nodes(node, scheme)
- try:
- event_params = {"machine_id": self._machine_id, "if_id": if_id}
- self._trigger_event("interface_config_ready", event_params)
- except Exception as exc:
- msg = "Unable to configure interface %s on machine %s [%s]." % \
- (if_id, self._machine_id, str(exc))
- logging.error(XmlProcessingError(str(msg), node))
- raise
+ return iface
+
+ def _params(self, node, params):
+ if "params" in self._data:
+ msg = "Only a single <params> child allowed under <%s>." \
+ % self._data["type"]
+ raise RecipeError(msg, node)
+
+ subparser = ParamsParse(self)
+ self._data["params"] = subparser.parse(node)
def _addresses(self, node, params):
self._list_init(node, params, "addresses", {"address": self._address})
@@ -283,70 +176,75 @@ class InterfaceParse(LnstParser):
else:
addr = self._get_text_content(node)
- self._iface["addresses"].append(addr)
+ self._data["addresses"].append(addr)
def _options(self, node, params):
self._list_init(node, params, "options", {"option": self._option})
def _option(self, node, params):
- name = self._get_attribute(node, "name")
+ option = XmlData(node)
+ option["name"] = self._get_attribute(node, "name")
if self._has_attribute(node, "value"):
- value = self._get_attribute(node, "value")
+ option["value"] = self._get_attribute(node, "value")
else:
- value = self._get_text_content(node)
+ option["value"] = self._get_text_content(node)
- self._iface["options"].append((name, value))
+ self._data["options"].append(option)
def _slaves(self, node, params):
- self._iface["slave_options"] = {}
self._list_init(node, params, "slaves", {"slave": self._slave})
def _slave(self, node, params):
+ slave = XmlData(node)
if self._has_attribute(node, "id"):
- slave_id = self._get_attribute(node, "id")
+ slave["id"] = self._get_attribute(node, "id")
else:
- slave_id = self._get_text_content(node)
-
- self._iface["slaves"].append(slave_id)
-
- self._iface["slave_options"][slave_id] = []
- self._slave_opts = self._iface["slave_options"][slave_id]
+ slave["id"] = self._get_text_content(node)
scheme = {"options": self._slave_options}
+ params = {"slave": slave}
self._process_child_nodes(node, scheme, params)
+ self._data["slaves"].append(slave)
+
def _slave_options(self, node, params):
+ if "options" not in params["slave"]:
+ params["slave"]["options"] = XmlCollection(node)
+ else:
+ msg = "Only a single <options> child allowed under <slave>."
+ raise RecipeError(msg, node)
+
scheme = {"option": self._slave_option}
self._process_child_nodes(node, scheme, params)
def _slave_option(self, node, params):
- name = self._get_attribute(node, "name")
+ option = XmlData(node)
+ option["name"] = self._get_attribute(node, "name")
if self._has_attribute(node, "value"):
- value = self._get_attribute(node, "value")
+ option["value"] = self._get_attribute(node, "value")
else:
- value = self._get_text_content(node)
+ option["value"] = self._get_text_content(node)
- self._slave_opts.append((name, value))
+ params["slave"]["options"].append(option)
def _list_init(self, node, params, node_name, scheme):
- self._iface[node_name] = []
+ if node_name not in self._data:
+ self._data[node_name] = XmlCollection(node)
+ else:
+ msg = "Only a single <%s> child allowed under <%s>." \
+ % (node_name, self._data["type"])
+ raise RecipeError(msg, node)
self._process_child_nodes(node, scheme, params)
- def _ignore_tag(self, node, params):
- pass
-
class ParamsParse(LnstParser):
- _params = None
-
- def set_target(self, target):
- self._params = target
-
def parse(self, node):
+ self._data = XmlCollection(node)
scheme = {"param": self._param}
self._process_child_nodes(node, scheme)
+ return self._data
def _param(self, node, params):
name = self._get_attribute(node, "name")
@@ -359,190 +257,134 @@ class ParamsParse(LnstParser):
param = XmlData(node)
param["name"] = name
param["value"] = value
- self._params.append(param)
+ self._data.append(param)
-class CommandSequenceParse(LnstParser):
+class TaskParse(LnstParser):
def parse(self, node):
- sequences = self._data["sequences"]
- sequences.append({})
- seq_num = len(sequences) - 1
- sequences[seq_num]["commands"] = []
-
- self._seq_num = seq_num
- self._seq_node = node
+ self._data = commands = XmlCollection(node)
+ task = XmlData(node)
+ task["commands"] = commands
if self._has_attribute(node, "quit_on_fail"):
- quit_on_fail = self._get_attribute(node, "quit_on_fail")
- sequences[seq_num]["quit_on_fail"] = quit_on_fail
- else:
- sequences[seq_num]["quit_on_fail"] = "no"
+ task["quit_on_fail"] = self._get_attribute(node, "quit_on_fail")
+
+ if self._has_attribute(node, "label"):
+ task["label"] = self._get_attribute(node, "label")
+
+ scheme = {"config": self._config,
+ "run": self._run,
+ "ctl_wait": self._ctl_wait,
+ "wait": self._wait,
+ "intr": self._intr,
+ "kill": self._kill}
- scheme = {"command": self._command}
self._process_child_nodes(node, scheme)
+ return task
+
+ def _options(self, node, params):
+ subparser = OptionsParse(self)
+ opts = subparser.parse(node)
+ params["cmd"]["options"] = opts
- self._check_sequence(sequences[seq_num])
-
- def _command(self, node, params):
- subparser = CommandParse(self)
- subparser.set_seq_num(self._seq_num)
- subparser.parse(node)
-
- def _check_sequence(self, sequence):
- err = False
- bg_ids = {}
- for i, command in enumerate(sequence["commands"]):
- machine_id = command["machine_id"]
- if not machine_id in bg_ids:
- bg_ids[machine_id] = set()
-
- cmd_type = command["type"]
- if cmd_type in ["wait", "intr", "kill"]:
- bg_id = command["value"]
- if bg_id in bg_ids[machine_id]:
- bg_ids[machine_id].remove(bg_id)
- else:
- logging.error("Found command \"%s\" for bg_id \"%s\" on "
- "machine \"%s\" which was not previously "
- "defined", cmd_type, bg_id, machine_id)
- err = True
-
- if "bg_id" in command:
- bg_id = command["bg_id"]
- if not bg_id in bg_ids[machine_id]:
- bg_ids[machine_id].add(bg_id)
- else:
- logging.error("Command \"%d\" uses bg_id \"%s\" on machine "
- "\"%s\" which is already used",
- i, bg_id, machine_id)
- err = True
-
- for machine_id in bg_ids:
- for bg_id in bg_ids[machine_id]:
- logging.error("bg_id \"%s\" on machine \"%s\" has no kill/wait "
- "command to it", bg_id, machine_id)
- err = True
- if err:
- msg = "Incorrect command sequence"
- raise XmlProcessingError(msg, self._seq_node)
-
-
-class CommandParse(LnstParser):
- _seq_num = None
- _cmd_num = None
-
- def set_seq_num(self, num):
- self._seq_num = num
+ def _config(self, node, params):
+ cmd = XmlData(node)
+ cmd["type"] = "config"
+ cmd["machine"] = self._get_attribute(node, "machine")
- def parse(self, node):
- recipe = self._data
- command = {}
- recipe["sequences"][self._seq_num]["commands"].append(command)
- self._cmd_num = len(recipe["sequences"][self._seq_num]["commands"]) - 1
+ if self._has_attribute(node, "persistent"):
+ cmd["persistent"] = self._get_attribute(node, "persistent")
- if self._has_attribute(node, "machine_id"):
- machine_id = self._get_attribute(node, "machine_id")
+ if self._has_attribute(node, "option"):
+ cmd["options"] = XmlCollection(node)
+ if self._has_attribute(node, "value"):
+ opt = XmlData(node)
+ opt["name"] = self._get_attribute(node, "option")
+ opt["value"] = self._get_attribute(node, "value")
+
+ cmd["options"] = XmlCollection(node)
+ cmd["options"].append(opt)
+ else:
+ raise RecipeError("Missing option value.", cmd)
else:
- machine_id = None
+ params = {"cmd": cmd}
+ scheme = {"options": self._options}
+ self._process_child_nodes(node, scheme, params)
- if machine_id and machine_id not in recipe["machines"]:
- raise XmlProcessingError("Invalid machine_id", node)
+ self._data.append(cmd)
- command["machine_id"] = machine_id
- command["type"] = self._get_attribute(node, "type")
+ def _run(self, node, params):
+ cmd = XmlData(node)
- if (command["type"] != "ctl_wait" and not machine_id) or\
- (machine_id and machine_id not in recipe["machines"]):
- raise XmlProcessingError("Invalid machine_id", node)
+ has_module = self._has_attribute(node, "module")
+ has_command = self._has_attribute(node, "command")
+ has_from = self._has_attribute(node, "from")
- command["value"] = None
- if self._has_attribute(node, "value"):
- command["value"] = self._get_attribute(node, "value")
+ if (has_module and has_command) or (has_module and has_from):
+ msg = "Invalid combination of attributes."
+ raise RecipeError(msg, cmd)
- if self._has_attribute(node, "pass_result"):
- command["pass_result"] = self._get_attribute(node, "pass_result",
- bool_it)
- if command["type"] == "system_config":
- msg = "Invalid attribute pass_result for command system_config"
- raise XmlProcessingError(msg, node)
+ if has_module:
+ cmd["type"] = "test"
+ cmd["module"] = self._get_attribute(node, "module")
- if self._has_attribute(node, "timeout"):
- command["timeout"] = self._get_attribute(node, "timeout", int)
+ params = {"cmd": cmd}
+ scheme = {"options": self._options}
+ self._process_child_nodes(node, scheme, params)
+ elif has_command:
+ cmd["type"] = "exec"
+ cmd["command"] = self._get_attribute(node, "command")
+
+ if self._has_attribute(node, "from"):
+ cmd["from"] = self._get_attribute(node, "from")
+
+ cmd["machine"] = self._get_attribute(node, "machine")
if self._has_attribute(node, "bg_id"):
- command["bg_id"] = self._get_attribute(node, "bg_id")
+ cmd["bg_id"] = self._get_attribute(node, "bg_id")
- if command["type"] in ["system_config", "wait", "intr", "kill"]:
- msg = "Command %s cannot be run in the background!" \
- % command["type"]
- raise XmlProcessingError(msg, node)
+ if self._has_attribute(node, "timeout"):
+ cmd["timeout"] = self._get_attribute(node, "timeout")
- if self._has_attribute(node, "desc"):
- command["desc"] = self._get_attribute(node, "desc")
+ if self._has_attribute(node, "expect"):
+ cmd["expect"] = self._get_attribute(node, "expect")
- if command["type"] == "system_config":
- if self._has_attribute(node, "option"):
- command["option"] = self._get_attribute(node, "option")
+ self._data.append(cmd)
- if self._has_attribute(node, "persistent"):
- command["persistent"] = self._get_attribute(node, "persistent",
- bool_it)
- else:
- command["persistent"] = False
- elif command["type"] == "exec":
- if self._has_attribute(node, "from"):
- command["from"] = self._get_attribute(node, "from")
- elif command["type"] == "ctl_wait":
- if command["machine_id"] != None:
- msg = "Invalid attribute machine_id for command ctl_wait"
- raise XmlProcessingError(msg, node)
-
- try:
- command["value"] = int(command["value"])
- except ValueError:
- msg = "Invalid value for command ctl_wait"
- raise XmlProcessingError(msg, node)
- for key in command.keys():
- if key != "type" and key != "value" and\
- key != "desc" and key != "machine_id":
- msg = "Invalid attribute %s for command ctl_wait" % key
- raise XmlProcessingError(msg, node)
-
- scheme = {"options": self._options}
- self._process_child_nodes(node, scheme)
+ def _ctl_wait(self, node, param):
+ cmd = XmlData(node)
+ cmd["type"] = "ctl_wait"
+ cmd["seconds"] = self._get_attribute(node, "seconds")
+ self._data.append(cmd)
- def _options(self, node, params):
- seq = self._seq_num
- cmd = self._cmd_num
- self._data["sequences"][seq]["commands"][cmd]["options"] = {}
+ def _signal_cmd(self, node, signal_name):
+ cmd = XmlData(node)
+ cmd["type"] = signal_name
+ cmd["machine"] = self._get_attribute(node, "machine")
+ cmd["bg_id"] = self._get_attribute(node, "bg_id")
+ self._data.append(cmd)
+ return cmd
- scheme = {"option": self._option}
- self._process_child_nodes(node, scheme)
+ def _intr(self, node, param):
+ self._signal_cmd(node, "intr")
- def _option(self, node, params):
- seq = self._seq_num
- cmd = self._cmd_num
- options = self._data["sequences"][seq]["commands"][cmd]["options"]
+ def _kill(self, node, param):
+ self._signal_cmd(node, "kill")
- name = self._get_attribute(node, "name")
- if not name in options:
- options[name] = []
+ def _wait(self, node, param):
+ self._signal_cmd(node, "wait")
- option = {}
- options[name].append(option)
+class OptionsParse(LnstParser):
+ def parse(self, node):
+ self._data = opts = XmlCollection(node)
- if self._has_attribute(node, "type"):
- opt_type = self._get_attribute(node, "type")
- option["type"] = opt_type
- else:
- opt_type = "default"
+ scheme = {"option": self._option}
+ self._process_child_nodes(node, scheme)
- if opt_type == "default":
- if self._has_attribute(node, "value"):
- value = self._get_attribute(node, "value")
- else:
- value = self._get_text_content(node)
+ return self._data
- option["value"] = value
- else:
- msg = "Unknown option type \"%s\"" % opt_type
- raise XmlProcessingError(msg, node)
+ def _option(self, node, params):
+ option = XmlData(node)
+ option["name"] = self._get_attribute(node, "name")
+ option["value"] = self._get_attribute(node, "value")
+
+ self._data.append(option)
10 years, 8 months
[lnst] ctl: Slight change of the interface of Interface
by Jiří Pírko
commit b243f102169945ec168306ae8eac1ddd0d0a2c78
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Tue Aug 6 13:41:03 2013 +0200
ctl: Slight change of the interface of Interface
The options are now stored in a different way on the controller. This
patch changes the interface for setting them to the Interface objects
so it is more straight-forward.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 1847adf..8fd8a40 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -366,11 +366,8 @@ class Interface(object):
def add_slave(self, iface):
self._slaves[iface.get_id()] = iface
- def set_slave_options(self, slave_options):
- self._slave_options = slave_options
-
- def get_slave_options(self):
- return self._slave_options
+ def set_slave_option(self, slave_id, name, value):
+ self._slave_options[slave_id] = (name, value)
def add_address(self, addr):
self._addresses.append(addr)
10 years, 8 months