Remove a useless field
[platform/core/system/dlog.git] / tests / README.testsuite.in
1 The dlog testsuite consists of a bash script and config files, shipped as a
2 separate rpm file. The script is capable of testing both backends, chosen by
3 providing proper argument:
4 - for pipe backend:
5 $ @bindir@/dlog_test pipe
6 - for android logger backend:
7 $ @bindir@/dlog_test logger
8
9 The test environment setup is separate for both backends but performed tests
10 are the same. Pipe backend environment setup looks as follows:
11 - a proper config file is installed by rpm in @datadir@/dlog-pipe.conf.test.It
12 stores paths to sockets used by daemon, util and libdlog based apps during tests
13 which are separate from those used in production mode
14 - DLOG_CONFIG_PATH envirinment variable is set to point at installed config file
15 - a dlog daemon is started, it creates pipe sockets in location specified in
16 config file pointed by DLOG_CONFIG_PATH env variable - /var/lib/dlog-tests/
17 - testsuite tests are performed, dlogutil, dlogsend and libdlog based test
18 apps use socket files specified in config file pointed by DLOG_CONFIG_PATH env
19 variable
20 - a test summary is printed, showing total, failed and passed tests count
21 - daemon and all test apps are killed on exit
22
23 Android logger testing is a little bit more tricky, since we cannot just run
24 separate instance of daemon and communicate with it using separate sockets.
25 It uses a kernel buffer which is system-wide and shared between all applications
26 that wish to read or write log entries. Since there are multiple applications
27 running on target and utilizing dlog all the time, it would be hard to
28 read/write test log entries along with them and be 100% sure that no test log
29 entries are lost (for example by overwriting them by entries written by other
30 applications). However, there is a configuration setting called "platform
31 logging", normally set to 1, which enables or disables writing to all buffers
32 except apps buffer.
33
34 Taking this into account, android logger environment setup works as follows:
35 - an overlay config file is installed in
36 @sysconfdir@/dlog.conf.d/99-dlog-logger.disable-platform-logging-for-testsuite.conf.
37 It contains only one config entry that disables platform logging. It's being
38 interpreted as a last config file, so we can be sure nothing else overwrites
39 this setting. The bottleneck of this approach is that since we need to be sure
40 that all system apps using libdlog will take this setting into account, a reboot
41 is required after installing testsuite.
42 - along with an overlay config file, a proper test config file is installed by
43 rpm in @datadir@/dlog-logger.conf.test. It contains standard settings for
44 android backend, but it has platform logging ENABLED
45 - after reboot, all buffer except apps buffer are free of any log entries
46 (platform logging disabled)
47 - DLOG_CONFIG_PATH envirinment variable is set to point at installed config file
48 @datadir@/dlog-logger.conf.test. It has platform logging enabled, so all
49 dlogutil, dlogsend and libdlog based applications run from now on in this
50 environment will have write access to all buffers.
51 - testsuite tests are performed, both dlogutil and libdlog test apps use
52 settings specified in config file pointed by DLOG_CONFIG_PATH env variable
53 - a test summary is printed, showing total, failed and passed tests count
54 - since an overlay config file is installed in a standard config files location
55 and is interpreted on each startup, it's advised to uninstall dlog testsuite
56 after performing tests. This will remove the file and enable platform logging to
57 all system applications.
58
59 Tests are common for both backends and consist of testing if:
60 - dlogutil -d quits after printing logs
61 - -t and -u arguments are parsed properly
62 - limiting printed log count with -t works as expected
63 - reading from an unknown buffer returns an error
64 - ireading from empty buffer returns zero entries
65 - dlogutil -c empties all buffers
66 - writing to an empty buffer works as expected
67 - log level filters work
68 - "silent" filter works
69 - writing buffer size with dlogutil -g works as expected
70 - reading all entries to a single file works
71 - reading all entries to rotating files works
72 - all print formats work as expected (regex based matching)
73 - pid/tid filtering works
74 - sorting by timestamp works