[lnst] recipes: update recipes to the new format
by Jiří Pírko
commit 31c7ce5aa5b66d7d507bf7898050b04a16f477e2
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu May 23 12:33:35 2013 +0200
recipes: update recipes to the new format
This commit updates some of the recipes in our library to the new
format. I've also tested the recipe schema on these recipes.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/examples/quick_guides/ping_check.xml | 90 +++++++++++++-------------
recipes/multicast/multicast-all.xml | 45 +++++--------
recipes/smoke/lib/conf-bond.xml | 8 +-
recipes/smoke/lib/conf-eth.xml | 4 +-
recipes/smoke/lib/conf-team.xml | 8 +-
recipes/smoke/lib/conf-vlan.xml | 6 +-
6 files changed, 75 insertions(+), 86 deletions(-)
---
diff --git a/recipes/examples/quick_guides/ping_check.xml b/recipes/examples/quick_guides/ping_check.xml
index 64e2fa3..73495f6 100644
--- a/recipes/examples/quick_guides/ping_check.xml
+++ b/recipes/examples/quick_guides/ping_check.xml
@@ -5,52 +5,50 @@ is available on LNST wiki page:
https://fedorahosted.org/lnst/wiki/QuickGuides/QuickGuidePingCheck
-->
<lnstrecipe>
- <machines>
- <machine id="testmachine1">
- <machineconfig>
- <!-- Change hostname bellow -->
- <info hostname="192.168.1.2"/>
- <netdevices>
- <!-- Change hwaddr here -->
- <netdevice type="eth" network="tnet" hwaddr="52:54:01:00:00:05"
- phys_id="1"/>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testifc1" phys_id="1" type="eth"/>
- <addresses>
- <address value="192.168.200.2/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
+ <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>
+ </eth>
+ </interfaces>
+ </machine>
- <machine id="testmachine2">
- <machineconfig>
- <!-- Change hostname bellow -->
- <info hostname="192.168.1.3"/>
- <netdevices>
- <!-- Change hwaddr here -->
- <netdevice type="eth" network="tnet" hwaddr="52:54:01:00:00:06"
- phys_id="1"/>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testifc2" phys_id="1" type="eth">
- <addresses>
- <address value="192.168.200.3/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
- </machines>
+ <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>
+ </eth>
+ </interfaces>
+ </machine>
+ </machines>
- <command_sequence>
- <command type="test" machine_id="testmachine1" value="IcmpPing">
- <options>
- <option name="addr" value="{ip(testmachine2,testifc2)}"/>
- <option name="count" value="3"/>
- </options>
- </command>
- </command_sequence>
+ <command_sequence>
+ <command type="test" machine_id="testmachine1" value="IcmpPing">
+ <options>
+ <option name="addr" value="{ip(testmachine2,testifc2)}"/>
+ <option name="count" value="3"/>
+ </options>
+ </command>
+ </command_sequence>
</lnstrecipe>
diff --git a/recipes/multicast/multicast-all.xml b/recipes/multicast/multicast-all.xml
index bdd22d7..5378195 100644
--- a/recipes/multicast/multicast-all.xml
+++ b/recipes/multicast/multicast-all.xml
@@ -10,44 +10,35 @@
</define>
<machines>
<machine id="1">
- <machineconfig>
- <info hostname="{$hostname1}" libvirt_domain="{$virtdomain1}"/>
- <netdevices>
- <libvirt_create>
- <netdevice network="tnet" phys_id="1" type="eth"/>
- <netdevice network="tnet" phys_id="2" type="eth"/>
- </libvirt_create>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testiface" phys_id="1" type="eth">
+ <params>
+ <param name="hostname" value="{$hostname1}"/>
+ <param name="libvirt_domain" value="{$virtdomain1}"/>
+ </params>
+ <interfaces>
+ <eth id="testiface" network="tnet">
<addresses>
<address value="192.168.100.226/24"/>
</addresses>
- </interface>
- <interface id="2" phys_id="2" type="eth">
+ </eth>
+ <eth id="2" network="tnet">
<addresses>
<address value="192.168.100.240/24"/>
</addresses>
- </interface>
- </netconfig>
+ </eth>
+ </interfaces>
</machine>
<machine id="2">
- <machineconfig>
- <info hostname="{$hostname2}" libvirt_domain="{$virtdomain2}"/>
- <netdevices>
- <libvirt_create>
- <netdevice network="tnet" phys_id="1" type="eth"/>
- </libvirt_create>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testiface" phys_id="1" type="eth">
+ <params>
+ <param name="hostname" value="{$hostname2}"/>
+ <param name="libvirt_domain" value="{$virtdomain2}"/>
+ </params>
+ <interfaces>
+ <eth id="testiface" network="tnet">
<addresses>
<address value="192.168.100.215/24"/>
</addresses>
- </interface>
- </netconfig>
+ </eth>
+ </interfaces>
</machine>
</machines>
diff --git a/recipes/smoke/lib/conf-bond.xml b/recipes/smoke/lib/conf-bond.xml
index b69401d..269b123 100644
--- a/recipes/smoke/lib/conf-bond.xml
+++ b/recipes/smoke/lib/conf-bond.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="if-2" network="net" type="eth"/>
- <interface id="testiface" type="bond">
+ <eth id="if-1" network="net"/>
+ <eth id="if-2" network="net"/>
+ <bond id="testiface">
<slaves>
<slave id="if-1"/>
<slave id="if-2"/>
@@ -9,5 +9,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </bond>
</interfaces>
diff --git a/recipes/smoke/lib/conf-eth.xml b/recipes/smoke/lib/conf-eth.xml
index a31e095..a4562ea 100644
--- a/recipes/smoke/lib/conf-eth.xml
+++ b/recipes/smoke/lib/conf-eth.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="testiface" network="net" type="eth">
+ <eth id="testiface" network="net">
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </eth>
</interfaces>
diff --git a/recipes/smoke/lib/conf-team.xml b/recipes/smoke/lib/conf-team.xml
index f8e23c6..cf5aac8 100644
--- a/recipes/smoke/lib/conf-team.xml
+++ b/recipes/smoke/lib/conf-team.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="if-2" network="net" type="eth"/>
- <interface id="testiface" type="team">
+ <eth id="if-1" network="net"/>
+ <eth id="if-2" network="net"/>
+ <team id="testiface" type="team">
<options>
<option name="teamd_config">
{
@@ -16,5 +16,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </team>
</interfaces>
diff --git a/recipes/smoke/lib/conf-vlan.xml b/recipes/smoke/lib/conf-vlan.xml
index aa95e5a..92d5e23 100644
--- a/recipes/smoke/lib/conf-vlan.xml
+++ b/recipes/smoke/lib/conf-vlan.xml
@@ -1,6 +1,6 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="testiface" type="vlan">
+ <eth id="if-1" network="net"/>
+ <vlan id="testiface" type="vlan">
<options>
<option name="vlan_tci" value="10"/>
</options>
@@ -10,5 +10,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </vlan>
</interfaces>
10 years, 10 months
[lnst] Logs: message type format fix
by Jiří Pírko
commit 527ddc4a9989c18a087c05aa84d942d555895814
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Thu May 16 15:23:58 2013 +0200
Logs: message type format fix
When logging warning messages the "WARNING:" would get trimmed because
of the format.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Common/Logs.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py
index 284ecc2..379405c 100644
--- a/lnst/Common/Logs.py
+++ b/lnst/Common/Logs.py
@@ -97,7 +97,7 @@ class LoggingCtl:
self.formatter = MultilineFormater(
- '%(asctime)s| %(address)17.17s| %(levelname)5.5s: '
+ '%(asctime)s| %(address)17.17s| %(levelname)7.7s: '
'%(message)s', '%Y-%m-%d %H:%M:%S', " "*4)
10 years, 10 months
[PATCH] recipe format: <options> under <eth> moved under <slave>
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
Until now when setting options of team interface slaves the options had
to be specified under the <netdevice> or <eth> tag (in the new format).
However the new format didn't accept any <options> tags under the <eth>
tag. This commit fixes that by moving the <options> tag under its
respective <slave> tag. The team configuration now looks something like
this:
<eth id="1" network="A"/>
<team id="testiface">
<options>
<option>...</option>
</options>
<slaves>
<slave id="1">
<options>
<option name="teamd_port_config">
{
"prio": -10,
"sticky": true
}
</option>
</options>
</slave>
</slaves>
<addresses>
<address>...</address>
</addresses>
</team>
This doesn't change the behaviour of <options> tag that are under the
not-eth tags.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Machine.py | 10 +++++++++-
lnst/Controller/NetTestController.py | 1 +
lnst/Controller/RecipeParse.py | 21 +++++++++++++++++++++
lnst/Slave/NetConfigCommon.py | 10 ++++++++++
lnst/Slave/NetConfigDevice.py | 5 +++--
5 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 78f4c70..d8162fc 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -309,6 +309,7 @@ class Interface(object):
self._network = None
self._slaves = {}
+ self._slave_options = {}
self._addresses = []
self._options = []
@@ -351,6 +352,12 @@ 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 add_address(self, addr):
self._addresses.append(addr)
@@ -360,7 +367,8 @@ class Interface(object):
def _get_config(self):
config = {"hwaddr": self._hwaddr, "type": self._type,
"addresses": self._addresses, "slaves": self._slaves.keys(),
- "options": self._options}
+ "options": self._options,
+ "slave_options": self._slave_options}
if self._type == "eth":
config["phys_id"] = self.get_id()
return config
diff --git a/lnst/Controller/NetTestController.py b/lnst/Controller/NetTestController.py
index 9f1c9fa..a43c299 100644
--- a/lnst/Controller/NetTestController.py
+++ b/lnst/Controller/NetTestController.py
@@ -153,6 +153,7 @@ class NetTestController:
if "slaves" in ifconfig:
for slave_id in ifconfig["slaves"]:
iface.add_slave(machine.get_interface(slave_id))
+ iface.set_slave_options(ifconfig["slave_options"])
if "addresses" in ifconfig:
for addr in ifconfig["addresses"]:
diff --git a/lnst/Controller/RecipeParse.py b/lnst/Controller/RecipeParse.py
index 9a91a7c..8cac525 100644
--- a/lnst/Controller/RecipeParse.py
+++ b/lnst/Controller/RecipeParse.py
@@ -296,6 +296,7 @@ class InterfaceParse(LnstParser):
self._iface["options"].append((name, value))
def _slaves(self, node, params):
+ self._iface["slave_options"] = {}
self._list_init(node, params, "slaves", {"slave": self._slave})
def _slave(self, node, params):
@@ -306,6 +307,26 @@ class InterfaceParse(LnstParser):
self._iface["slaves"].append(slave_id)
+ self._iface["slave_options"][slave_id] = []
+ self._slave_opts = self._iface["slave_options"][slave_id]
+
+ scheme = {"options": self._slave_options}
+ self._process_child_nodes(node, scheme, params)
+
+ def _slave_options(self, node, params):
+ scheme = {"option": self._slave_option}
+ self._process_child_nodes(node, scheme, params)
+
+ def _slave_option(self, node, params):
+ name = self._get_attribute(node, "name")
+
+ if self._has_attribute(node, "value"):
+ value = self._get_attribute(node, "value")
+ else:
+ value = self._get_text_content(node)
+
+ self._slave_opts.append((name, value))
+
def _list_init(self, node, params, node_name, scheme):
self._iface[node_name] = []
diff --git a/lnst/Slave/NetConfigCommon.py b/lnst/Slave/NetConfigCommon.py
index f3f2f5d..c60419b 100644
--- a/lnst/Slave/NetConfigCommon.py
+++ b/lnst/Slave/NetConfigCommon.py
@@ -25,3 +25,13 @@ def get_option(netdev, opt_name):
if option == opt_name:
return value
return None
+
+def get_slave_option(netdev, slave_id, opt_name):
+ try:
+ options = netdev["slave_options"][slave_id]
+ except KeyError:
+ return None
+ for option, value in options:
+ if option == opt_name:
+ return value
+ return None
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index c781e83..d9806db 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -15,7 +15,7 @@ import logging
import re
import sys
from lnst.Common.ExecCmd import exec_cmd
-from lnst.Slave.NetConfigCommon import get_slaves, get_option
+from lnst.Slave.NetConfigCommon import get_slaves, get_option, get_slave_option
from lnst.Common.Utils import kmod_in_use, bool_it
class NetConfigDeviceGeneric:
@@ -270,7 +270,8 @@ class NetConfigDeviceTeam(NetConfigDeviceGeneric):
dev_name = self._netdev["name"]
port_netdev = self._config[slaveid]
port_name = port_netdev["name"]
- teamd_port_config = get_option(port_netdev, "teamd_port_config")
+ teamd_port_config = get_slave_option(self._netdev,
+ slaveid, "teamd_port_config")
dbus_option = "-D" if self._should_enable_dbus() else ""
if teamd_port_config:
teamd_port_config = prepare_json_str(teamd_port_config)
--
1.7.11.7
10 years, 10 months
<options> under <eth>
by Ondrej Lichtner
Hi everyone,
while rewriting a team recipe to suit the new format I came across a
problem. The old files contain <options> tags under the <eth> tags.
For example the file recipes/team/netconfig-team_ab.xml contains the
following:
<eth id="1" network="A">
<options>
<option name="teamd_port_config">
{
"prio": -10,
"sticky": true
}
</option>
</options>
</eth>
This was previously possible because our parser accepted the <options> tag
under any type of <interface> tag. However after the recent changes, to
use the type of the interface as the name of the tag, we have agreed
to only accept <params> and <addresses> tags for the <eth> tag. This is
because lnst currently doesn't do any other sort of configuration than
setting a network address, and params are used for machine matching.
The <options> tag is only used in the case the interface is a slave to a
team interface. The values that are being set are also directly related
to the team driver. For this reason I suggest moving these <options>
tags and placing them directly under the <slave> tag that binds the
<eth> interface to the <team> interface. The recipe would then look
something like this:
<eth id="1" network="A"/>
<team id="testiface">
<options>
<option>...</option>
</options>
<slaves>
<slave id="1">
<options>
<option name="teamd_port_config">
{
"prio": -10,
"sticky": true
}
</option>
</options>
</slave>
</slaves>
<addresses>
<address>...</address>
</addresses>
</team>
This would of course require bigger changes than just accepting the
<options> tag under the <eth> tag just as before, but not by much. This
format, in my opinion, makes more sense.
The usability of this format depends on what kind of options can team
use here, and if this could be also used for other types of interfaces
that have slaves.
I would like to hear your oppinions on this.
-Ondrej
10 years, 10 months
[PATCH] recipes: update recipes to the new format
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit updates some of the recipes in our library to the new
format. I've also tested the recipe schema on these recipes.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
recipes/examples/quick_guides/ping_check.xml | 90 ++++++++++++++--------------
recipes/multicast/multicast-all.xml | 45 ++++++--------
recipes/smoke/lib/conf-bond.xml | 8 +--
recipes/smoke/lib/conf-eth.xml | 4 +-
recipes/smoke/lib/conf-team.xml | 8 +--
recipes/smoke/lib/conf-vlan.xml | 6 +-
6 files changed, 75 insertions(+), 86 deletions(-)
diff --git a/recipes/examples/quick_guides/ping_check.xml b/recipes/examples/quick_guides/ping_check.xml
index 64e2fa3..73495f6 100644
--- a/recipes/examples/quick_guides/ping_check.xml
+++ b/recipes/examples/quick_guides/ping_check.xml
@@ -5,52 +5,50 @@ is available on LNST wiki page:
https://fedorahosted.org/lnst/wiki/QuickGuides/QuickGuidePingCheck
-->
<lnstrecipe>
- <machines>
- <machine id="testmachine1">
- <machineconfig>
- <!-- Change hostname bellow -->
- <info hostname="192.168.1.2"/>
- <netdevices>
- <!-- Change hwaddr here -->
- <netdevice type="eth" network="tnet" hwaddr="52:54:01:00:00:05"
- phys_id="1"/>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testifc1" phys_id="1" type="eth"/>
- <addresses>
- <address value="192.168.200.2/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
+ <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>
+ </eth>
+ </interfaces>
+ </machine>
- <machine id="testmachine2">
- <machineconfig>
- <!-- Change hostname bellow -->
- <info hostname="192.168.1.3"/>
- <netdevices>
- <!-- Change hwaddr here -->
- <netdevice type="eth" network="tnet" hwaddr="52:54:01:00:00:06"
- phys_id="1"/>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testifc2" phys_id="1" type="eth">
- <addresses>
- <address value="192.168.200.3/24"/>
- </addresses>
- </interface>
- </netconfig>
- </machine>
- </machines>
+ <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>
+ </eth>
+ </interfaces>
+ </machine>
+ </machines>
- <command_sequence>
- <command type="test" machine_id="testmachine1" value="IcmpPing">
- <options>
- <option name="addr" value="{ip(testmachine2,testifc2)}"/>
- <option name="count" value="3"/>
- </options>
- </command>
- </command_sequence>
+ <command_sequence>
+ <command type="test" machine_id="testmachine1" value="IcmpPing">
+ <options>
+ <option name="addr" value="{ip(testmachine2,testifc2)}"/>
+ <option name="count" value="3"/>
+ </options>
+ </command>
+ </command_sequence>
</lnstrecipe>
diff --git a/recipes/multicast/multicast-all.xml b/recipes/multicast/multicast-all.xml
index bdd22d7..5378195 100644
--- a/recipes/multicast/multicast-all.xml
+++ b/recipes/multicast/multicast-all.xml
@@ -10,44 +10,35 @@
</define>
<machines>
<machine id="1">
- <machineconfig>
- <info hostname="{$hostname1}" libvirt_domain="{$virtdomain1}"/>
- <netdevices>
- <libvirt_create>
- <netdevice network="tnet" phys_id="1" type="eth"/>
- <netdevice network="tnet" phys_id="2" type="eth"/>
- </libvirt_create>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testiface" phys_id="1" type="eth">
+ <params>
+ <param name="hostname" value="{$hostname1}"/>
+ <param name="libvirt_domain" value="{$virtdomain1}"/>
+ </params>
+ <interfaces>
+ <eth id="testiface" network="tnet">
<addresses>
<address value="192.168.100.226/24"/>
</addresses>
- </interface>
- <interface id="2" phys_id="2" type="eth">
+ </eth>
+ <eth id="2" network="tnet">
<addresses>
<address value="192.168.100.240/24"/>
</addresses>
- </interface>
- </netconfig>
+ </eth>
+ </interfaces>
</machine>
<machine id="2">
- <machineconfig>
- <info hostname="{$hostname2}" libvirt_domain="{$virtdomain2}"/>
- <netdevices>
- <libvirt_create>
- <netdevice network="tnet" phys_id="1" type="eth"/>
- </libvirt_create>
- </netdevices>
- </machineconfig>
- <netconfig>
- <interface id="testiface" phys_id="1" type="eth">
+ <params>
+ <param name="hostname" value="{$hostname2}"/>
+ <param name="libvirt_domain" value="{$virtdomain2}"/>
+ </params>
+ <interfaces>
+ <eth id="testiface" network="tnet">
<addresses>
<address value="192.168.100.215/24"/>
</addresses>
- </interface>
- </netconfig>
+ </eth>
+ </interfaces>
</machine>
</machines>
diff --git a/recipes/smoke/lib/conf-bond.xml b/recipes/smoke/lib/conf-bond.xml
index b69401d..269b123 100644
--- a/recipes/smoke/lib/conf-bond.xml
+++ b/recipes/smoke/lib/conf-bond.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="if-2" network="net" type="eth"/>
- <interface id="testiface" type="bond">
+ <eth id="if-1" network="net"/>
+ <eth id="if-2" network="net"/>
+ <bond id="testiface">
<slaves>
<slave id="if-1"/>
<slave id="if-2"/>
@@ -9,5 +9,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </bond>
</interfaces>
diff --git a/recipes/smoke/lib/conf-eth.xml b/recipes/smoke/lib/conf-eth.xml
index a31e095..a4562ea 100644
--- a/recipes/smoke/lib/conf-eth.xml
+++ b/recipes/smoke/lib/conf-eth.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="testiface" network="net" type="eth">
+ <eth id="testiface" network="net">
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </eth>
</interfaces>
diff --git a/recipes/smoke/lib/conf-team.xml b/recipes/smoke/lib/conf-team.xml
index f8e23c6..cf5aac8 100644
--- a/recipes/smoke/lib/conf-team.xml
+++ b/recipes/smoke/lib/conf-team.xml
@@ -1,7 +1,7 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="if-2" network="net" type="eth"/>
- <interface id="testiface" type="team">
+ <eth id="if-1" network="net"/>
+ <eth id="if-2" network="net"/>
+ <team id="testiface" type="team">
<options>
<option name="teamd_config">
{
@@ -16,5 +16,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </team>
</interfaces>
diff --git a/recipes/smoke/lib/conf-vlan.xml b/recipes/smoke/lib/conf-vlan.xml
index aa95e5a..92d5e23 100644
--- a/recipes/smoke/lib/conf-vlan.xml
+++ b/recipes/smoke/lib/conf-vlan.xml
@@ -1,6 +1,6 @@
<interfaces>
- <interface id="if-1" network="net" type="eth"/>
- <interface id="testiface" type="vlan">
+ <eth id="if-1" network="net"/>
+ <vlan id="testiface" type="vlan">
<options>
<option name="vlan_tci" value="10"/>
</options>
@@ -10,5 +10,5 @@
<addresses>
<address value="{$testip}"/>
</addresses>
- </interface>
+ </vlan>
</interfaces>
--
1.7.11.7
10 years, 10 months
[lnst trac] #59: TestPacketAssert: pipe buffering bug
by fedora-badges
#59: TestPacketAssert: pipe buffering bug
----------------------+------------------
Reporter: olichtne | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
----------------------+------------------
There seems to be a bug caused by using pipes for reading output of the
tcpdump command. Parts of the output are not read often resulting in fail
state of the command.
I think it is connected to buffering of these pipes as sometimes it does
appear and other times it works correctly. The problem could also be
connected to the fact that the program is being run in the background and
is therefore interrupted by a signal, the handler of the signal doesn't
read the rest of the output which it probably should.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/59>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 10 months
[PATCH] RelaxNG schema
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The following patch adds the hopefully complete RelaxNG schema. To validate your
recipe use the validation script attached to Jans email [1]. I'm not sending the
script as a patch to the git repo because I don't know if this will be the way
we validate our recipes. That needs to be discussed.
There are a few details that I wasn't sure of so they might be changed later.
For example the schema will validate the following:
<option name="a" value="b">c</option>
Which the recipe parser will accept, by using the value 'b', but I think this
might be confusing and there should be at least a warning if not an error. The
error could be solved in the schema.
[1] https://lists.fedorahosted.org/pipermail/lnst-developers/2013-May/001198....
Ondrej Lichtner (1):
add recipe-schema.rng
recipe-schema.rng | 447 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 447 insertions(+)
create mode 100644 recipe-schema.rng
--
1.7.11.7
10 years, 10 months
[PATCH 0/2] Recipe xml validation
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
The following two patches add files required for recipe validation and
impplement a basic form of validation with the XML Schema file provided. At the
moment the validation relies on the schema file to be in the same directory as
the lnst-ctl script. In the future this should be changed to a more
standardized location.
At the moment though this should be sufficient to try out the validation, it
reflects the currently accepted recipe format so it can help with changing your
older recipes to the new format.
Ondrej Lichtner (2):
add recipe.xsd and recipe.dtd
lnst-ctl: add recipe validation
lnst-ctl | 22 +++++++
recipe.dtd | 56 ++++++++++++++++++
recipe.xsd | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 274 insertions(+)
create mode 100644 recipe.dtd
create mode 100644 recipe.xsd
--
1.7.11.7
10 years, 10 months
[PATCH] Logs: message type format fix
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
When logging warning messages the "WARNING:" would get trimmed because
of the format.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/Logs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Common/Logs.py b/lnst/Common/Logs.py
index 284ecc2..379405c 100644
--- a/lnst/Common/Logs.py
+++ b/lnst/Common/Logs.py
@@ -97,7 +97,7 @@ class LoggingCtl:
self.formatter = MultilineFormater(
- '%(asctime)s| %(address)17.17s| %(levelname)5.5s: '
+ '%(asctime)s| %(address)17.17s| %(levelname)7.7s: '
'%(message)s', '%Y-%m-%d %H:%M:%S', " "*4)
--
1.7.11.7
10 years, 10 months
[lnst trac] #71: "Unknown RPC method" not handled
by fedora-badges
#71: "Unknown RPC method" not handled
----------------------+-----------------------------
Reporter: rpazdera | Owner: olichtne
Type: defect | Status: new
Priority: minor | Milestone: Stable Release
Component: lnst-ctl | Version: git
Keywords: | Blocked By:
Blocking: |
----------------------+-----------------------------
There is a minor issue in the controller; it seems to crash when it
receives an "unknown RPC method" error as an answer to a RPC call. This
doesn't happen very often, but it should be supported.
Reproducer:
Change the 'hello' rpc call in the code to "wtfomg" and it should produce
this error.
--
Ticket URL: <https://fedorahosted.org/lnst/ticket/71>
lnst <https://fedorahosted.org/lnst/>
Linux Network Stack Test
10 years, 10 months