Controller: rename 'machine' to 'host'

This commit renames the internally used 'machine' keyword to 'host', and
'command_sequence' to 'task' also updating relevant output messages. The
reson for this is the automatic generation of result xmls, that use this
keyword and were inconsistent with the recipe xml format.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
add result_xslt folder

This folder contains 3 files:
xml_to_html.xsl - a XSLT stylesheet that transforms result xml files
    into a HTML file viewable in a web browser
xml_to_html.js - a javascript file that is referenced by the created
    HTML file, it defines a single function that shows/hides the result
    data returned by a test
xml_to_html.css - a CSS file that is referenced by the created HTML
    file, it contains some basic formatting

These files should be uploaded to a 'well known' location so that they
can be properly linked which will result in a very convenient use of the
result xml files - a user opens them in a web browser, and everything
just works.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Config: add xslt_url option

This is a Controller specific option, the value is a path or a URL to
the XSLT document that should be referenced in a result xml file if the
option -x is supplied.

The default value points to the xml_to_html.xsl file in this repository
but this should change shortly when we have the files uploaded
somewhere.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ResultSerializer: use the xslt_url option

This patch makes it so that the XSLT reference is automatically added
when creating a result xml file.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ResultSerializer: add type attribute to serialized objects

We serialize the result_data structure automatically into an arbitrary
xml file. This is not well suited for processing by an XSLT stylesheet.
This patch adds a 'type' attribute to created elements that the XSLT
stylesheet can use to determine the proper transformation.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
RecipeParser: sepparate vlan parsing/validation

This commit separates the parsing/validation of <vlan> elements from the
group of virtual devices. The main reason is to check that the element
has _exactly one_ slave defined. Checking this in a different place
would be problematic...

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Machine: allow multiple non-primary interface masters

In the kernel a net_device uses two lists (upper and lower) to create
a hierarchy between the interfaces. This patch makes LNST reflect that
hierarchy - lower == Interface._slaves and upper == Interface._master
the patch also sepparates the master list into two parts - the _primary_
master (e.g. bridge, bond, team) and _other_ masters (e.g. vlan
interfaces). There can only be one primary master!

Since the other masters are not required by the slave configuration
(yet) the Slave modules don't have to be changed.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
InterfaceManager: use conf["name"] when Device not initialized

When using NetworkManager we don't create devices until we have created
connection objects for all the configured interfaces. The corresponding
Device objects therefore weren't initialized which caused crashes when
creating connection objects of devices that were higher in the
hierarchy. This patch fixes that.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
InterfaceManager: reconstruct upper/lower hierarchy

This patch makes the internal Device objects reconstruct the upper/lower
device hierarchy that can be found in the kernel. This is usefull when
we are deconfiguring devices without information from the kernel - the
upper and lower references will ensure the proper ordering of
deconfiguration.

Internal variables are named like on the controller:
upper == master
lower == slaves
master["primary"] is the primary master of an interface (IFLA_MASTER)

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>