NetTestResultSerializer: adjust xml_to_html transformation

This patch works around some issues with the old version of lxml library
available in RHEL6.

The first change is parsing the xslt document from a URL needs to
happen first otherwise the parser is unable to access URLs - know bug in
the old lxml library that is fixed in newer versions.

The second is that the tostring() method didn't support a doctype
parameter in older versions so instead we add the DOCTYPE manually.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
SlavePool: parallel pool machine checks

This patch implements parallel pool machine availability checking.
Availability is checked by creating a nonblocking TCP socket and
connecting to the slave. This way we can connect to all the slaves at
once instead of one-by-one.

This patch also introduces proper support for multiple pool directories.
Until now all slaves were put in a single pool, this could cause name
conflicts and network label conflicts, leading to confusion for users.
From now we clearly separate individual directories and machines from
two different pool directories can't be present in a single match.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Phase 1 regression tests + quick guides examples

* Added phase 1 regression tests.
    + Each test has its own .README file describing topology,
    test scenario and other useful info
    + Some tests do not work well with NetworkManager or/and
    with older distros
    + Test virtual_bridge_2_vlans_over_round_robin is currently
    broken for unknown reason
* Added quick guides examples
    + Added some examples from wiki pages

Signed-off-by: Jiri Prochazka <jprochaz@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Tests from phase1 renamed

Tests renamed to avoid confusion with team tests from phase2. Now bond tests have _bond suffix, and team tests will have _team suffix

Signed-off-by: Jiri Prochazka <jprochaz@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Phase 2 team tests added

First version of phase 2 tests added.
* Tests included:
    + team vs team
    + team vs bond
    + team vs eth
    + 3 VLANs over team

Signed-off-by: Jiri Prochazka <jprochaz@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: remove offload setting for non-existing device in vland over bond test

Fix for 3_vlans_over_bond.py task that was requesting non existing
device causing an exception. Machine 'm2' has only one ethernet device.

Signed-off-by: Jan Tluka <jtluka@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: fix description of vlan over bond tests

Match README files to recipe xmls.

Signed-off-by: Jan Tluka <jtluka@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
OvS support: fix adding bonds and add support for bond options

This patch fixes a problem with Open vSwitch bridge bonds. Adding a bond
requires specifying ports that should be bonded, however this command
also adds those ports to the ovs bridge so they shouldn't be added by
the ovs-vsctl add-port command.

This patch also adds support for specifying bond options. These are
verified by the ovs-vsctl command so LNST doesn't check their validity.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Phase 2 add Open vSwitch recipes

This patch adds 3 Open vSwitch test recipes. These were created from
Phase 1 bridge tests by instead using Open vSwitch bridges, and
utilizing their bonding and VLAN features.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
setup.py: install recipes files

The setup.py script will now also install the contents of the recipes/
directory. This will be used to create a new lnst-recipes package.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Virtual bridge 2 VLANs over round-robin tests removed

Signed-off-by: Jiri Prochazka <jprochaz@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Controller: sync resources also to namespaces

Using reduced syncing and MachineAPI.sync_resources() shows that the
resources are properly synced however not available for commands or
test modules run in specific netns. This patch extends resource syncing
to slavemachine's configured namespaces.

I had to add netns parameter to copy_file_to_machine method, too.
Copying the same file to slave machine is not the most efficient
approach, however it fixes the issue until better approach is found.

Signed-off-by: Jan Tluka <jtluka@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetUtils: fix PEP8 issues

Having automated flake8 testing it is easier to catch some
issues prior they will cause real bugs; but to be used
with flake8, the code must be PEP8-compliant.

Signed-off-by: Peter V. Saveliev <peter@svinota.eu>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
NetUtils: use IPRoute instead of IPRSocket

Since IPRoute became threadless, it is simpler to use IPRoute
methods like `get_links()` to gather the info.

Signed-off-by: Peter V. Saveliev <peter@svinota.eu>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
6 release

Signed-off-by: Jiri Pirko <jiri@resnulli.us>