README.md
1# KConfig Tests
2
3## confserver.py tests
4
5Install pexpect (`pip install pexpect`).
6
7Then run the tests manually like this:
8
9```
10./test_confserver.py --logfile tests.log
11```
12
13If a weird error message comes up from the test, check the log file (`tests.log`) which has the full interaction session (input and output) from confserver.py - sometimes the test suite misinterprets some JSON-like content in a Python error message as JSON content.
14
15Note: confserver.py prints its error messages on stderr, to avoid overlap with JSON content on stdout. However pexpect uses a pty (virtual terminal) which can't distinguish stderr and stdout.
16
17Test cases apply to `KConfig` config schema. Cases are listed in `testcases.txt` and are each of this form:
18
19```
20* Set TEST_BOOL, showing child items
21> { "TEST_BOOL" : true }
22< { "values" : { "TEST_BOOL" : true, "TEST_CHILD_STR" : "OHAI!", "TEST_CHILD_BOOL" : true }, "ranges": {"TEST_CONDITIONAL_RANGES": [0, 100]}, "visible": {"TEST_CHILD_BOOL" : true, "TEST_CHILD_STR" : true} }
23
24```
25
26* First line (`*`) is description
27* Second line (`>`) is changes to send
28* Third line (`<`) is response to expect back
29* (Blank line between cases)
30
31Test cases are run in sequence, so any test case depends on the state changes caused by all items above it.
32
33