Mon, Jul 15, 2013 at 12:54:10PM CEST, rpazdera(a)redhat.com wrote:
Hello again :-),
This RFC is also related to the command sequences. They are great,
because if you know what you're doing you can do whatever you want with
them. However, when the tests get more complex and spread across
multiple sequences, they might be quite hard to follow.
What I think would increase the readability of the tests in some cases
are test fixtures. We could support them as an alternative to more
general command sequences and work with them internally as with command
sequences as their behaviour can be simulated with a series of multiple
command sequences like this:
<!-- SETUP -->
<command_sequence quit_on_fail="yes">
<command type="system_config" ...>
<command type="exec" ...>
<command type="exec" ...>
</command_sequence>
<!-- TEST CASES -->
<command_sequence quit_on_fail="no">
<command type="test" ...>
<command type="test" ...>
<command type="test" ...>
</command_sequence>
<command_sequence quit_on_fail="no">
<command type="test" ...>
</command_sequence>
<!-- TEARDOWN -->
<command_sequence quit_on_fail="yes">
<command type="system_config" ...>
<command type="intr" ...>
<command type="kill" ...>
<command type="exec" ...>
</command_sequence>
My proposal is to add an syntactic alternative to this as follows:
<!-- Not sure about the name, maybe only 'test' would be better? -->
<test_unit desc="TCP Tests">
<!-- The setup section is optional and the quit_on_fail
option is set by default. -->
<setup>
<command type="system_config" ...>
<command type="exec" ...>
<command type="exec" ...>
</setup>
<!-- There must be at least one. The name could be 'case' only.
If a command within the testcase fails, the case is
terminated, but LNST would carry on with the following
test case. -->
<test_case desc="Handshake">
<command type="test" ...>
<command type="test" ...>
</test_case>
<test_case desc="Load balance">
<command type="test" ...>
</test_case>
<test_case desc="Checksums">
<command type="test" ...>
</test_case>
<!-- This section is again optional -->
<teardown>
<command type="system_config" ...>
<command type="intr" ...>
<command type="kill" ...>
<command type="exec" ...>
</teardown>
</test_unit>
Seems too complicated to me... Not sure...
We could also provide some documentation for the test cases and units
directly with the tags and use them to print a nice coloured summary
after the test :-). Internally, a fixture could be handled as multiple
command sequences, so we wouldn't need to change that much (hopefully).
Cheers,
Radek
_______________________________________________
LNST-developers mailing list
LNST-developers(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers