XmlProcessing: Split into two separate modules

I added a few new classes to the XmlProcessing file and split it into
two separate modules XmlProcessing and XmlParser.

The XmlProcessing module now contains only the basic classes and the
parser bases were moved to the new module.

New classes:

    class XmlData - a structure representing XML data
    class XmlCollection - an array (collection) of XmlData structures

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlTemplates: Return XmlTemplateString

This patch modifies the XmlTemplates processor to return processed data
unevaluated, but wrapped in the XmlTemplateString wrapper. The
controller will evaluate the templates later on during sematic
processing.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
SlaveMachineParse: Decouple parsing and semantics

This patch makes several changes in SlaveMachineParse and SlavePool
classes. The parser will process the file only into the internal XmlData
representation. The semantic checks are performed later on using this
structure in the SlavePool.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
utils: Extend bool_it to support yes/no

We are using yes/no for some boolean values within the recipe. This
patch extends the bool_it function, so it can be used to handle the
conversions instead of any other approaches.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
slave: Support the new interface of Config cmd

The interface of the NetTestCommandConfig has changed a bit. This commit
makes the necessary modifications for the slave side.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Common: Adding XmlTemplateString support to parser

The _get_attribute() method now returns XmlTemplateString instead of
plain strings. In case of includes, we need to convert them to string,
before we pass them on.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
results: Support the new command sequence format

This patch contains updates for the NetTestResultSerializer class that
were necessary due to the transition from command sequences to tasks.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
XmlTemplates: Template functions are now objects

With the introduction of lazy evaluation using the XmlTemplateString,
the template functions were converted to classes which are instatiated
and used in the XmlTemplateString objects. These don't have to be
evaluated until the template is conveted to string.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ctl: Slightly changing the interface of SlavePool

This patch contains a small change in the provision_machines() function
that is used to find a match for a network setup. The dictionary for
results is no longer constructed within the object; it is pased to the
function via a parameter and the machines are filled in.

The method then returns a boolean value that indicates whether the
matching was successful or not.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ctl: Slight change of the interface of Interface

The options are now stored in a different way on the controller. This
patch changes the interface for setting them to the Interface objects
so it is more straight-forward.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ctl: Massive refactoring of the RecipeParser

Basicaly the whole parser was changed. The parser no longer directs the
execution of the controller. This means the controller hooks were
completely removed and all the semantic checks were moved to
NetTestController.

Apart from that, this commit also contains many structural changes in
the recipe XML file. The <commans_sequence> tag changed to <task>
and the all of the command were changed as well.

For the new format, please refer to the example recipes or to the
documentation that is available online.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
commands: Changing the internal structures

The structure of command sequences changed dramatically. This commit
contains the changes to the internal structures that are sent between
the controller and it slaves.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ctl: Changing pass_result to expect

The pass_result was changed to expect. Additionaly, LNST was failing in
case the pass_result was false. In that case the "err_msg" was not set
properly. This patch also fixes the problem.

I added a FIXME comment there, because this (in my opinion) should be
done earlier on the slave rather than here. This way, the slave prints
ERROR as if the command failed (because it had in fact failed on the
slave), but the controller knows it was expected and puts PASS to the
summary. This is confusing.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
ctl: Massive refactoring of NetTestController

This patch contains the second part of the changes that were done in the
RecipeParser. Many semantic checks were moved from the parser to the
controller, which now properly controls the execution of recipes.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
misc: Updating the recipe conversion script

The recipe conversion has been updated to be able to convert the old
command sequences to the new task syntax.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: Updating example recipes

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: Updating multicast recipes

The multicast recipes were converted to use the new <task> syntax
instead of <command_sequence>.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: Updating the team recipes

The team recipes has been converted to tasks.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
recipes: Updating smoke tests

This patch contains updates of the smoke test suite to reflect the
recent facelift of the command sequences.

Signed-off-by: Radek Pazdera <rpazdera@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>