[lnst trac] #13: Controller Configuration Directory
by fedora-badges
#13: Controller Configuration Directory
-------------------------+-----------------------
Reporter: rpazdera | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone:
Component: component1 | Version:
Keywords: | Blocked By:
Blocking: #10 |
-------------------------+-----------------------
We'd like to have a support for configuration through a directory
available from multiple places on the controller machine. The purpose of
this is to store lab-specific controller resources configuration and
settings.
The structure should be following:
- .lnst/pool.d/ - drop-in pool of test machines that are available to the
controller. It should contain *.xml files with machine configs.
- ./lnst/conf - controller specific configuration values, such as address
ranges, etc. Format of this file remains undecided yet (we need to discuss
this further), but it should XML.
LNST will look for the '~/.lnst' dir in with higher priority and then in
'/etc/lnst'. LNST can be run completely without configuration. In these
cases warning should be printed and some default values used.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/13>
lnst <http://example.org/>
My example project
11 years, 6 months
[lnst trac] #10: Machine pool at controller
by fedora-badges
#10: Machine pool at controller
-------------------------+-----------------------
Reporter: rpazdera | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone:
Component: component1 | Version:
Keywords: | Blocked By:
Blocking: |
-------------------------+-----------------------
We discussed an idea concerning recipe execution today. Now you always
need to change some parameters of the recipe in case you want to run it on
a different set of test machines (which kinda sucks).
Jirka proposed, that we could have a local static configuration at each
controller, that would define a pool of available netmachineconfigs. Those
configs would be then
matched against some defined requirements for machines in the recipes and
allocated
for tests.
This would also solve the not-very-pretty <libvirt_create> tag, because it
would be abstracted within the pool. If there is a virtual machine in the
pool, the interfaces could be created automatically without any other
markup.
I thought about the pool and it could be a drop-in configuration directory
with netmachineconfig xmls. This approach would require a minimum of new
code. For instance a pool could look like this:
{{{
/etc/lnst.conf # ini or XML file with some general
# controller specific configuration
# like RPC ports, available IP/MAC addr ranges
/etc/lnst.pool.d/ # the drop-in netmachineconfig pool
/etc/lnst.pool.d/f14-peanut.xml # physical netmachineconfig
/etc/lnst.pool.d/RHEL6-clone.xml # virtual one
}}}
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/10>
lnst <http://example.org/>
My example project
11 years, 6 months
[lnst trac] #15: Matching Algorithm for MachineConfig Templates
by fedora-badges
#15: Matching Algorithm for MachineConfig Templates
-------------------------+-----------------------
Reporter: rpazdera | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone:
Component: component1 | Version:
Keywords: | Blocked By:
Blocking: #10 |
-------------------------+-----------------------
We will need to implement an algorithm for matching machineconfig
templates against machines within the controller pool.
We outlined it already at the meeting.
It will also be necessary to finalize the set of parameters on which the
templates will be matched (for instance, available interfaces and
connections, operating system version, kernel version, internet access,
hardware requirements, specific driver requirements etc.).
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/15>
lnst <http://example.org/>
My example project
11 years, 6 months
[lnst trac] #14: Support for machineconfig templates in NetTestParse
by fedora-badges
#14: Support for machineconfig templates in NetTestParse
-------------------------+-----------------------
Reporter: rpazdera | Owner: somebody
Type: enhancement | Status: new
Priority: major | Milestone:
Component: component1 | Version:
Keywords: | Blocked By:
Blocking: #10 |
-------------------------+-----------------------
NetTestParse class will require some modifications in order to make it
work together with the templates.
New bool attribute 'template' should be added to the tag to indicate
whether the config is complete or it's just a template request for a
machine in the controller pool.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/14>
lnst <http://example.org/>
My example project
11 years, 6 months
machineconfig templates: mapping of id's
by Radek Pazdera
Hi!
I'm currently working on incorporating the matching algorithm code (more
precisely a class) into LNST. I had to modify some parts of
NetTestParser, but I have those parts basically ready.
The matching algorithm is already wrapped-up in a class and ready as
well. But I can't figure out how to work with the matched ID's.
When a template topology's been successfully matched, we need to take
the <machineconfig>'s and put it into the recipe in place of the
teplates. But there will be different phys_id's, so we need to change
them somehow.
We could replace them according to the matches, but it turns
out we can't do that so easily :(. In case of a successful partial
match, there could be conflicts between id's from template namespace
and pool namespace. To illustrate this, let's match a template A on a
machine B:
* template A with 2 interfaces, id's 1 and 2
* pool machine B with 3 interfaces, id's 1, 2, 3
They could be matched like this:
A B
----- -----
1 --> 3
2 --> 2
unused 1
In this case, after replacing matched id's we'd get a machine with
devices 1,1,2.
One is unused, so we could just remove it, but I don't think it's a
good idea. If the device is unused for testing (not referenced from
the <netconfig>), LNST should make sure it is DOWN, so it cannot
affect the test results in some very obscure way.
We could also do it the other way around. Replace the references to
phys_id in <netconfig>'s. But that could be a little confusing at
times. In case the values are ever used for error reporting.
In my opinion, the best way would be to count in both id's and somehow
work with them both. Maybe create some abstract type for id? I don't
know ... But it's hard to do such changes to the structure of the recipe
variable, because it is used on many places across a lot of modules.
What do you think?
-Radek
11 years, 6 months
[lnst] recipes: add team link watch recipes
by Jiří Pírko
commit 44fc5e1a4ed1a9f63d096ff09a92f847770d7067
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Mon Sep 24 16:07:17 2012 +0200
recipes: add team link watch recipes
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/team/netconfig-team_ab_lw_001.xml | 25 ++++++++
recipes/team/netconfig-team_ab_lw_002.xml | 60 ++++++++++++++++++++
recipes/team/netconfig-team_ab_lw_003.xml | 31 ++++++++++
recipes/team/netconfig-team_ab_lw_004.xml | 68 ++++++++++++++++++++++
recipes/team/netconfig-team_ab_lw_005.xml | 30 ++++++++++
recipes/team/netconfig-team_ab_lw_006.xml | 65 +++++++++++++++++++++
recipes/team/netconfig-team_ab_lw_007.xml | 64 +++++++++++++++++++++
recipes/team/netconfig-team_ab_lw_008.xml | 87 +++++++++++++++++++++++++++++
recipes/team/recipey_ab_lw_001.xml | 21 +++++++
recipes/team/recipey_ab_lw_002.xml | 21 +++++++
recipes/team/recipey_ab_lw_003.xml | 21 +++++++
recipes/team/recipey_ab_lw_004.xml | 21 +++++++
recipes/team/recipey_ab_lw_005.xml | 21 +++++++
recipes/team/recipey_ab_lw_006.xml | 21 +++++++
recipes/team/recipey_ab_lw_007.xml | 21 +++++++
recipes/team/recipey_ab_lw_008.xml | 21 +++++++
16 files changed, 598 insertions(+), 0 deletions(-)
---
diff --git a/recipes/team/netconfig-team_ab_lw_001.xml b/recipes/team/netconfig-team_ab_lw_001.xml
new file mode 100644
index 0000000..5a59ab7
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_001.xml
@@ -0,0 +1,25 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" phys_id="3" type="eth"/>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"},
+ "link_watch": {"name": "ethtool"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_002.xml b/recipes/team/netconfig-team_ab_lw_002.xml
new file mode 100644
index 0000000..afbe591
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_002.xml
@@ -0,0 +1,60 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "ethtool",
+ "delay_up": 3000,
+ "delay_down": 3000
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "ethtool",
+ "delay_up": 1000,
+ "delay_down": 1000
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="3" phys_id="3" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "ethtool",
+ "delay_up": 500,
+ "delay_down": 500
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_003.xml b/recipes/team/netconfig-team_ab_lw_003.xml
new file mode 100644
index 0000000..8290c95
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_003.xml
@@ -0,0 +1,31 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" phys_id="3" type="eth"/>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"},
+ "link_watch": {
+ "name": "arp_ping",
+ "interval": 100,
+ "missed_max": 30,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_004.xml b/recipes/team/netconfig-team_ab_lw_004.xml
new file mode 100644
index 0000000..497b6e3
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_004.xml
@@ -0,0 +1,68 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "arp_ping",
+ "interval": 1000,
+ "missed_max": 5,
+ "init_wait": 10000,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "arp_ping",
+ "interval": 500,
+ "missed_max": 20,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="3" phys_id="3" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "arp_ping",
+ "interval": 100,
+ "missed_max": 30,
+ "init_wait": 0,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_005.xml b/recipes/team/netconfig-team_ab_lw_005.xml
new file mode 100644
index 0000000..68045a4
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_005.xml
@@ -0,0 +1,30 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth"/>
+ <interface id="2" phys_id="2" type="eth"/>
+ <interface id="3" phys_id="3" type="eth"/>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"},
+ "link_watch": {
+ "name": "nsna_ping",
+ "interval": 200,
+ "missed_max": 15,
+ "target_host": "fe01::2"
+ }
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_006.xml b/recipes/team/netconfig-team_ab_lw_006.xml
new file mode 100644
index 0000000..395c011
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_006.xml
@@ -0,0 +1,65 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "nsna_ping",
+ "interval": 1000,
+ "missed_max": 5,
+ "init_wait": 10000,
+ "target_host": "fe01::2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "nsna_ping",
+ "interval": 500,
+ "missed_max": 20,
+ "target_host": "fe01::2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="3" phys_id="3" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "nsna_ping",
+ "interval": 100,
+ "missed_max": 30,
+ "init_wait": 0,
+ "target_host": "fe01::2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_007.xml b/recipes/team/netconfig-team_ab_lw_007.xml
new file mode 100644
index 0000000..bc72e1b
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_007.xml
@@ -0,0 +1,64 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "ethtool",
+ "delay_up": 1000,
+ "delay_down": 1000
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "arp_ping",
+ "interval": 500,
+ "missed_max": 20,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="3" phys_id="3" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": {
+ "name": "nsna_ping",
+ "interval": 100,
+ "missed_max": 30,
+ "init_wait": 0,
+ "target_host": "fe01::2"
+ }
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/netconfig-team_ab_lw_008.xml b/recipes/team/netconfig-team_ab_lw_008.xml
new file mode 100644
index 0000000..af9f328
--- /dev/null
+++ b/recipes/team/netconfig-team_ab_lw_008.xml
@@ -0,0 +1,87 @@
+<netconfig>
+ <interface id="1" phys_id="1" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": [
+ {
+ "name": "nsna_ping",
+ "interval": 1000,
+ "missed_max": 5,
+ "init_wait": 10000,
+ "target_host": "fe01::2"
+ },
+ {
+ "name": "arp_ping",
+ "interval": 1000,
+ "missed_max": 5,
+ "init_wait": 13000,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ }]
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="2" phys_id="2" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": [
+ {
+ "name": "arp_ping",
+ "interval": 500,
+ "missed_max": 20,
+ "source_host": "192.168.111.1",
+ "target_host": "192.168.111.2"
+ },
+ {
+ "name": "ethtool",
+ "delay_up": 1000,
+ "delay_down": 1000
+ }]
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="3" phys_id="3" type="eth">
+ <options>
+ <option name="teamd_port_config">
+ {
+ "link_watch": [
+ {
+ "name": "nsna_ping",
+ "interval": 100,
+ "missed_max": 30,
+ "init_wait": 0,
+ "target_host": "fe01::2"
+ },
+ {
+ "name": "ethtool",
+ "delay_up": 500,
+ "delay_down": 500
+ }]
+ }
+ </option>
+ </options>
+ </interface>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "activebackup"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ <slave id="3"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ <address value="{$testip6}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/team/recipey_ab_lw_001.xml b/recipes/team/recipey_ab_lw_001.xml
new file mode 100644
index 0000000..36eb419
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_001.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_001.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_002.xml b/recipes/team/recipey_ab_lw_002.xml
new file mode 100644
index 0000000..697addd
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_002.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_002.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_003.xml b/recipes/team/recipey_ab_lw_003.xml
new file mode 100644
index 0000000..e375ccf
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_003.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_003.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_004.xml b/recipes/team/recipey_ab_lw_004.xml
new file mode 100644
index 0000000..885b31f
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_004.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_004.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_005.xml b/recipes/team/recipey_ab_lw_005.xml
new file mode 100644
index 0000000..2fe4276
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_005.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_005.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_006.xml b/recipes/team/recipey_ab_lw_006.xml
new file mode 100644
index 0000000..c0bf973
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_006.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_006.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_007.xml b/recipes/team/recipey_ab_lw_007.xml
new file mode 100644
index 0000000..170f3b0
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_007.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_007.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
diff --git a/recipes/team/recipey_ab_lw_008.xml b/recipes/team/recipey_ab_lw_008.xml
new file mode 100644
index 0000000..0b1b261
--- /dev/null
+++ b/recipes/team/recipey_ab_lw_008.xml
@@ -0,0 +1,21 @@
+<nettestrecipe>
+ <machines>
+ <define>
+ <alias name="testip" value="192.168.111.1/24"/>
+ <alias name="testip6" value="fe01::1/64"/>
+ </define>
+ <machine id="1">
+ <machineconfig source="machineconfig-peanut.xml"/>
+ <netconfig source="netconfig-team_ab_lw_008.xml"/>
+ </machine>
+ <define>
+ <alias name="testip" value="192.168.111.2/24"/>
+ <alias name="testip6" value="fe01::2/64"/>
+ </define>
+ <machine id="2">
+ <machineconfig source="machineconfig-dhcp-37-128.xml"/>
+ <netconfig source="netconfig-simple_br.xml"/>
+ </machine>
+ </machines>
+ <command_sequence source="sequence_ping_simple.xml"/>
+</nettestrecipe>
11 years, 7 months
[lnst trac] #22: Crash when rootpass is omitted
by fedora-badges
#22: Crash when rootpass is omitted
------------------------+-----------------------
Reporter: rpazdera | Owner: somebody
Type: defect | Status: new
Priority: minor | Milestone:
Component: component1 | Version:
Keywords: | Blocked By:
Blocking: |
------------------------+-----------------------
LNST crashes with a traceback and not at all descriptive message when the
rootpass is not specified in the recipe.
Log here:
{{{
# ./nettestctl.py -e -d rpm.xml run
17/09 08:33:32| (127.0.0.1)NetTestControll:0202| INFO: Preparing
machine a
17/09 08:33:32| (127.0.0.1)NetTestControll:0230| INFO: Remote app
exec on machine 192.168.122.11
17/09 08:33:32| (127.0.0.1) SshUtils:0336| DEBUG: Trying to
SCP with command 'scp -v -o UserKnownHostsFile=/dev/null -r -P 22
'lnst.tar.bz2' 'root@192.168.122.11://tmp/'', timeout 600s
17/09 08:33:42| (127.0.0.1) SshUtils:0281| ERROR: For logging
is necessary set rootpass in config.
17/09 08:33:42| (127.0.0.1) Logs:0022| DEBUG:
Traceback (most recent call last):
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestController.py", line 299, in _prepare
self._ntparse.parse_recipe()
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 35, in parse_recipe
self._parse(xml_dom)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 49, in _parse
self._process_child_nodes(xml_dom, scheme)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 278, in _process_child_nodes
default_handler)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 154, in _process_child_nodes
self._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 322, in _process_node
parent._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 166, in _process_node
handler(node, params)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 57, in _nettestrecipe
self._process_child_nodes(node, scheme)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 278, in _process_child_nodes
default_handler)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 154, in _process_child_nodes
self._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 322, in _process_node
parent._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 166, in _process_node
handler(node, params)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 62, in _machines
self._process_child_nodes(node, scheme)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 278, in _process_child_nodes
default_handler)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 154, in _process_child_nodes
self._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 322, in _process_node
parent._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 166, in _process_node
handler(node, params)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 67, in _machine
subparser.parse(node)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 171, in parse
self._process_child_nodes(node, scheme)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 278, in _process_child_nodes
default_handler)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 154, in _process_child_nodes
self._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 322, in _process_node
parent._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 166, in _process_node
handler(node, params)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 176, in _machineconfig
subparser.parse(node)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 237, in parse
self._process_child_nodes(node, scheme)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 278, in _process_child_nodes
default_handler)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 154, in _process_child_nodes
self._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 322, in _process_node
parent._process_node(node, handler, params)
File "/home/rpazdera/work/lnst-readonly-
clean/Common/XmlProcessing.py", line 166, in _process_node
handler(node, params)
File "/home/rpazdera/work/lnst-readonly-
clean/NetTest/NetTestParse.py", line 261, in _info
raise XmlProcessingError(str(exc), node)
XmlProcessingError: XmlProcessingError:rpm.xml:13: unsupported operand
type(s) for +: 'NoneType' and 'str'
17/09 08:33:42| (127.0.0.1)NetTestControll:0302| DEBUG: Exception
raised during recipe parsing. Deconfiguring machines.
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: Traceback
(most recent call last):
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"./nettestctl.py", line 165, in <module>
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: main()
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"./nettestctl.py", line 152, in main
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR:
packet_capture))
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"./nettestctl.py", line 80, in get_recipe_result
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR:
res_serializer, packet_capture)
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"./nettestctl.py", line 53, in process_recipe
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: return
nettestctl.run_recipe(packet_capture)
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"/home/rpazdera/work/lnst-readonly-clean/NetTest/NetTestController.py",
line 375, in run_recipe
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR:
self._prepare()
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: File
"/home/rpazdera/work/lnst-readonly-clean/NetTest/NetTestController.py",
line 306, in _prepare
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR: raise
exc
17/09 08:33:42| (127.0.0.1) stdio:0000| ERROR:
Common.XmlProcessing.XmlProcessingError: XmlProcessingError:rpm.xml:13:
unsupported operand type(s) for +: 'NoneType' and 'str'
17/09 08:33:42| (127.0.0.1) ShellProcess:0143| DEBUG: Process PID
14701 return 0
17/09 08:33:42| (127.0.0.1) ShellProcess:0140| DEBUG: Killing PID
14704
}}}
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/22>
lnst <http://example.org/>
My example project
11 years, 7 months
[lnst] Recipes and sourced bits can now be represented by HTTP urls
by Jiří Pírko
commit ee497ab18ba0e2c2b8ff74773688ab9c5cdb1652
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Sep 24 15:52:16 2012 +0200
Recipes and sourced bits can now be represented by HTTP urls
The change allows a user to specify both local file and http urls as
recipe and sourced recipe bits (using 'source' attribute). Relative
paths are automagically resolved. See usage below in tested scenarios.
Tested for following use cases:
1. url supplied to controller on command line
# nettestctl.py -c http://somedomain.com/jtluka/rhel63-tests/bond-tests/bond-mode5-scenario1...
# run
2. relative local file path supplied to controller
# nettestctl.py -c ./rhel63-tests/bond-tests/bond-mode5-scenario1.xml
# run
3. relative local directory path supplied to controller
# nettestctl.py -c ./rhel63-tests/bond-tests/ run
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Common/XmlProcessing.py | 13 +++++++------
NetTest/NetTestParse.py | 7 +++++--
nettestctl.py | 2 +-
3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/Common/XmlProcessing.py b/Common/XmlProcessing.py
index 5aa7ccd..2ae5f4c 100644
--- a/Common/XmlProcessing.py
+++ b/Common/XmlProcessing.py
@@ -15,6 +15,7 @@ import logging
from xml.dom.minidom import parseString
from xml import sax
from Common.XmlTemplates import XmlTemplates, XmlTemplateError
+from Common.RecipePath import RecipePath
class XmlProcessingError(Exception):
@@ -281,14 +282,17 @@ class RecipeParser(XmlParser):
old_include_root = None
if self._has_attribute(node, "source"):
source = self._get_attribute(node, "source")
- file_path = self._get_referenced_xml_path(source)
+
+ source_rp = RecipePath(self._include_root, source)
old_include_root = self._include_root
- self._include_root = os.path.dirname(file_path)
+ self._include_root = source_rp.get_root()
+ xmlstr = source_rp.to_str()
dom_init = XmlDomTreeInit()
try:
- dom = dom_init.parse_file(file_path)
+ dom = dom_init.parse_string(xmlstr,
+ filename=source_rp.abs_path())
except IOError, err:
msg = "Unable to resolve include: %s" % str(err)
raise XmlProcessingError(msg, node)
@@ -361,6 +365,3 @@ class RecipeParser(XmlParser):
self._template_proc.define_alias(name, value)
except XmlTemplateError, err:
raise XmlProcessingError(str(err), node)
-
- def _get_referenced_xml_path(self, filename):
- return os.path.normpath(os.path.join(self._include_root, os.path.expanduser(filename)))
diff --git a/NetTest/NetTestParse.py b/NetTest/NetTestParse.py
index 76068dd..bdf1721 100644
--- a/NetTest/NetTestParse.py
+++ b/NetTest/NetTestParse.py
@@ -18,20 +18,23 @@ from Common.XmlProcessing import XmlDomTreeInit
from Common.XmlProcessing import XmlProcessingError
from Common.NetUtils import normalize_hwaddr
from Common.Utils import bool_it
+from Common.RecipePath import RecipePath
class NetTestParse(RecipeParser):
def __init__(self, recipe_filepath):
super(NetTestParse, self).__init__()
self._filepath = recipe_filepath
- self._include_root = os.path.dirname(recipe_filepath)
+ self._rp = RecipePath(None, self._filepath)
+ self._include_root = self._rp.get_root()
self._recipe = {}
self._template_proc.set_definitions({"recipe": self._recipe})
def parse_recipe(self):
dom_init = XmlDomTreeInit()
- xml_dom = dom_init.parse_file(self._filepath)
+ rp = self._rp
+ xml_dom = dom_init.parse_string(rp.to_str(), rp.abs_path())
self._parse(xml_dom)
def _parse(self, xml_dom):
diff --git a/nettestctl.py b/nettestctl.py
index bc79398..f9973e4 100755
--- a/nettestctl.py
+++ b/nettestctl.py
@@ -47,7 +47,7 @@ def usage():
def process_recipe(action, file_path, remoteexec, cleanup,
res_serializer, packet_capture, config):
- nettestctl = NetTestController(os.path.realpath(file_path),
+ nettestctl = NetTestController(file_path,
remoteexec=remoteexec, cleanup=cleanup,
res_serializer=res_serializer,
config=config)
11 years, 7 months
[lnst] Adding RecipePath module to handle both local and http paths
by Jiří Pírko
commit acf93d4d820c2ae954dc060e68c02356ff03f5df
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Sep 24 15:50:59 2012 +0200
Adding RecipePath module to handle both local and http paths
RecipePath module is an abstraction over paths that can be specified on
command line and inside recipe files. Currently module supports local
files and HTTP urls but it's possible to extend the functionality for
other, e.g. FTP.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Common/RecipePath.py | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+), 0 deletions(-)
---
diff --git a/Common/RecipePath.py b/Common/RecipePath.py
new file mode 100644
index 0000000..b5f650c
--- /dev/null
+++ b/Common/RecipePath.py
@@ -0,0 +1,115 @@
+"""
+This module contains code code for LNST recipe paths and references.
+
+Copyright 2012 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+jtluka(a)redhat.com (Jan Tluka)
+"""
+
+import os
+from urlparse import urljoin
+from urllib2 import urlopen
+
+def get_recipepath_class(root, path):
+ if root == None:
+ if path.startswith('http'):
+ return HttpRecipePath(root, path)
+ else:
+ if os.access(path, os.R_OK):
+ return FileRecipePath(root, path)
+ else:
+ raise Exception("Recipe path does not exist \"%s\"!" % path)
+
+ if root.startswith('http'):
+ return HttpRecipePath(root, path)
+ elif os.access(root, os.R_OK):
+ return FileRecipePath(root, path)
+ else:
+ raise Exception("Could not recognize recipe path type \"%s\"" % path)
+
+class RecipePath:
+ def __init__(self, root, path):
+ self._recipepath_class = get_recipepath_class(root, path)
+
+ def get_root(self):
+ return self._recipepath_class.get_root()
+
+ def abs_path(self):
+ return self._recipepath_class.abs_path()
+
+ def to_str(self):
+ return self._recipepath_class.to_str()
+
+class RecipePathGeneric:
+ def __init__(self, root, path):
+ self._root = root
+ self._path = path
+ self._data = None
+
+ def get_root(self):
+ pass
+
+ def abs_path(self):
+ pass
+
+ def to_str(self):
+ pass
+
+class FileRecipePath(RecipePathGeneric):
+ def _load_file(self):
+ f = open(self.abs_path(),'r')
+ self._data = f.read()
+ f.close()
+
+ def to_str(self):
+ if not self._data:
+ self._load_file()
+
+ return self._data
+
+ def _append_path(self, path):
+ basedir = os.path.dirname(self._path)
+ return os.path.join(basedir, path)
+
+ def abs_path(self):
+ if self._root:
+ return os.path.normpath(os.path.join(self._root,
+ os.path.expanduser(self._path)))
+ else:
+ return os.path.normpath(os.path.expanduser(self._path))
+
+ def get_root(self):
+ return os.path.dirname(self.abs_path())
+
+class HttpRecipePath(RecipePathGeneric):
+ def _get_url(self):
+ url = self.abs_path()
+
+ try:
+ f = urlopen(url)
+ self._data = f.read()
+ except IOError, err:
+ msg = "Unable to resolve path: %s (%s)" % (url, str(err))
+ raise Exception(msg)
+
+ f.close()
+
+ def to_str(self):
+ if not self._data:
+ self._get_url()
+
+ return self._data
+
+ def abs_path(self):
+ if self._root:
+ return urljoin(self._root + '/', self._path)
+ else:
+ return self._path
+
+ def get_root(self):
+ url = self.abs_path()
+ return url.rpartition('/')[0]
11 years, 7 months