Skip to content

Commit e457e4f

Browse files
committed
doc: add section on log files.
1 parent 3dd9990 commit e457e4f

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

doc/source/mutest.rst

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Mutest (μtest)
2323
==============
2424

25-
~mutest~ is a simplified testing framework designed for use by test developers
25+
Mutest is a simplified testing framework designed for use by test developers
2626
of any skill level. The test developer writes test cases, one per file, which
2727
are made up of steps. Normally, these steps are commands to send (perhaps
2828
repeatedly) to a target and a matching regular expression for the command output
@@ -46,12 +46,44 @@ topology with the given configuration file and execute each test on the
4646
resulting topology. The munet topology is launched at the start and brought down
4747
at the end of each test script.
4848

49+
Log Files
50+
---------
51+
52+
A run of mutest generates 3 log files, ``mutest-exec.log``,
53+
``mutest-output.log`` and ``mutest-results.log``. They are created in the root
54+
of the mutest run directory which by default is ``/tmp/mutest``. These same 3
55+
log files are also generated per test case (script) within the test case
56+
directories which are named after the tests and also reside in ``/tmp/mutest``.
57+
58+
The log files have the following content:
59+
60+
``mutest-exec.log``
61+
Contains all logging for the execution of mutest and munet (i.e., from
62+
the root logger), as well as the logging from the other 2 log files.
63+
64+
``mutest-output.log``
65+
Contains the all the test commands and their output.
66+
67+
``mutest-results.log``
68+
Contains the results in an easy to read format, for each test
69+
step, test case and finally the entire run.
70+
71+
For the advanced user this logging can be customized with python logging
72+
configuration. The logging channels are the root logger for
73+
``mutest-exec.log``, ``mutest.output`` and it's sub-loggers for
74+
``mutest-output.log``, and ``mutest.results`` and it's sub-loggers for
75+
``mutest-results.log``.
76+
77+
4978
Writing Mutest Tests
5079
--------------------
5180

5281
.. currentmodule:: munet.mutest.userapi
5382

54-
Probably the most common step that is specified is a call to :py:func:`match_step`
83+
As described earlier, a test script is a collection of steps. Each step is a
84+
call to a mutest API function. One common step is a call to
85+
:py:func:`match_step`. This step sends a command to a target and applies a
86+
regular expression search on the output. If a match is found the step succeeds.
5587

5688
Here is a simple example test case:
5789

0 commit comments

Comments
 (0)