22
22
Mutest (μtest)
23
23
==============
24
24
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
26
26
of any skill level. The test developer writes test cases, one per file, which
27
27
are made up of steps. Normally, these steps are commands to send (perhaps
28
28
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
46
46
resulting topology. The munet topology is launched at the start and brought down
47
47
at the end of each test script.
48
48
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
+
49
78
Writing Mutest Tests
50
79
--------------------
51
80
52
81
.. currentmodule :: munet.mutest.userapi
53
82
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.
55
87
56
88
Here is a simple example test case:
57
89
0 commit comments