From: Ondrej Lichtner olichtne@redhat.com
The following set of patches further improves network namespace support in LNST.
Most of the patch set implements support for veth devices. Since veth devices are always created in pairs they're represented a bit differently in the recipe XML - by encompasing two <veth> tags within a <veth_pair> tag.
The first patch of the set also takes care of remounting sysfs on namespace creation which makes it usable for configuration again.
Example recipe with veth devices: <lnstrecipe> <network> <host id="testmachine1"> <interfaces> <eth id="out_if" label="tnet"/> <veth_pair> <veth id="testifc1" netns="xyz"> <addresses> <address value="192.168.200.2/24"/> </addresses> </veth> <veth id="testifc2"/> </veth_pair> <bridge id="br"> <slaves> <slave id="out_if"/> <slave id="testifc2"/> </slaves> </bridge> </interfaces> </host>
<host id="testmachine2"> <interfaces> <eth id="testifc2" label="tnet"> <addresses> <address value="192.168.200.3/24"/> </addresses> </eth> </interfaces> </host> </network>
<task> <run host="testmachine1" module="IcmpPing" netns="xyz"> <options> <option name="addr" value="{ip(testmachine2,testifc2)}"/> <option name="count" value="40"/> <option name="interval" value="1"/> </options> </run> </task> </lnstrecipe>
Ondrej Lichtner (10): NetTestSlave: remount sysfs in new net namespace ConnectionHandler: check specific connections schema-recipe: add support for veth interfaces RecipeParser: support parsing veth interfaces NetTestSlave: extend communication options between namespaces NetTestSlave: make return_if_netns method recursive *ConfigDevice: split device creation and configuration *ConfigDevice: add VEth classes NetTestSlave: add methods {create, deconfigure}_if_pair Machine: Interface class veth support
lnst/Common/ConnectionHandler.py | 8 +- lnst/Controller/Machine.py | 39 +++++++-- lnst/Controller/NetTestController.py | 3 + lnst/Controller/RecipeParser.py | 16 +++- lnst/Slave/InterfaceManager.py | 57 ++++++++++++- lnst/Slave/NetConfigDevice.py | 108 ++++++++++++++---------- lnst/Slave/NetTestSlave.py | 155 +++++++++++++++++++++++++++++++++-- lnst/Slave/NmConfigDevice.py | 15 +++- schema-recipe.rng | 36 ++++++++ 9 files changed, 369 insertions(+), 68 deletions(-)