all appied, thanks
Wed, Sep 04, 2013 at 01:35:59PM CEST, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
The following patch series refactors how lnst works with command results.
The most visible change is the change in results showing up in logs, where we
now show formatted result data along with the simple PASS/FAIL result of the
command. The same formatted result data is also shown in the result summary at
the end of a lnst-ctl run.
From an advanced users point of view the interface of setting results in your
custom test modules changed a bit. You are now required to use methods
set_pass() or set_fail() to correctly set a result. By limiting the interface
to these two functions we can easily ensure that the result object will
correctly constructed to suit the rest of lnst.
Both of these methods take a single argument res_data that can contain any
additional data you want to append to the results. These might be messages to
be printed or measured values or anything really. The only restriction here is
that it must contain only nested dictionaries, lists, and stringable objects.
The reason behind this is that we serialize this into an xml file (-x argument)
which also restrict you to use strings that will be valid in the xml file.
Formatting of the reported result data was also moved from the controller to
the slave, directly into the corresponding command object. This simplifies code
and also enables users to implement their own format_res_data function in their
custom test module classes that will be used to format the result data passed
to the set_{pass, fail} functions. The formatting function is called
automatically so you only need to override it.
Finally the NetTestResultSerializer class was reimplemented to better suit the
current model of result handling. The results are no longer stored as a DOM
tree and then transformed into the summary at end. Instead the data is stored
in a better custom data structure that can be easily iterated over to generate
both the summary and xml output.
The rest of the changes are small adjustments to numerous parts of lnst code so
that everything works.
Ondrej Lichtner (9):
NetTestResultSerializer: rename cmd_seq to task
NetTestCommand: command result interface change
NetTestCommand: fix control commands
Machine: remove expect checking
NetTestController: accept new result dictionaries
NetTestResultSerializer: new results reimplementation
smoke tests: move expect attribute of bg cmd
test_modules: update result reporting
NetTestCommand: add method check_res_data
lnst-ctl | 2 +-
lnst/Common/NetTestCommand.py | 151 +++++++++++++---
lnst/Common/TestsCommon.py | 26 ++-
lnst/Controller/Machine.py | 7 -
lnst/Controller/NetTestController.py | 27 ++-
lnst/Controller/NetTestResultSerializer.py | 265 ++++++++++-------------------
lnst/Slave/NetTestSlave.py | 6 +-
recipes/smoke/lib/task-bg.xml | 4 +-
test_modules/TestDummyFailing.py | 3 +-
test_modules/TestIcmp6Ping.py | 14 +-
test_modules/TestIcmpPing.py | 14 +-
test_modules/TestIperf.py | 5 +-
test_modules/TestMulticast.py | 3 +-
test_modules/TestNetCat.py | 6 +-
test_modules/TestPacketAssert.py | 3 +-
test_modules/TestPktgenTx.py | 3 +-
16 files changed, 290 insertions(+), 249 deletions(-)
--
1.8.3.1
_______________________________________________
LNST-developers mailing list
LNST-developers(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers