xref: /aosp_15_r20/external/ltp/testcases/realtime/README (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker/******************************************************************************/
2*49cdfc7eSAndroid Build Coastguard Worker/*                                                                            */
3*49cdfc7eSAndroid Build Coastguard Worker/* Copyright (c) International Business Machines  Corp., 2007                 */
4*49cdfc7eSAndroid Build Coastguard Worker/*                                                                            */
5*49cdfc7eSAndroid Build Coastguard Worker/* This program is free software;  you can redistribute it and/or modify      */
6*49cdfc7eSAndroid Build Coastguard Worker/* it under the terms of the GNU General Public License as published by       */
7*49cdfc7eSAndroid Build Coastguard Worker/* the Free Software Foundation; either version 2 of the License, or          */
8*49cdfc7eSAndroid Build Coastguard Worker/* (at your option) any later version.                                        */
9*49cdfc7eSAndroid Build Coastguard Worker/*                                                                            */
10*49cdfc7eSAndroid Build Coastguard Worker/* This program is distributed in the hope that it will be useful,            */
11*49cdfc7eSAndroid Build Coastguard Worker/* but WITHOUT ANY WARRANTY;  without even the implied warranty of            */
12*49cdfc7eSAndroid Build Coastguard Worker/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  */
13*49cdfc7eSAndroid Build Coastguard Worker/* the GNU General Public License for more details.                           */
14*49cdfc7eSAndroid Build Coastguard Worker/*                                                                            */
15*49cdfc7eSAndroid Build Coastguard Worker/* You should have received a copy of the GNU General Public License          */
16*49cdfc7eSAndroid Build Coastguard Worker/* along with this program;  if not, write to the Free Software               */
17*49cdfc7eSAndroid Build Coastguard Worker/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    */
18*49cdfc7eSAndroid Build Coastguard Worker/*                                                                            */
19*49cdfc7eSAndroid Build Coastguard Worker/******************************************************************************/
20*49cdfc7eSAndroid Build Coastguard Worker
21*49cdfc7eSAndroid Build Coastguard Workerrealtime tests is an open-source testsuite for testing real-time Linux.  It is
22*49cdfc7eSAndroid Build Coastguard Workerlicensed under the GPL.  The latest version of this testsuite is available
23*49cdfc7eSAndroid Build Coastguard Workerfrom http://rt.wiki.kernel.org.  This testsuite is maintained by the IBM
24*49cdfc7eSAndroid Build Coastguard WorkerReal-Time team.  Please send bug reports, contributions, questions to
25*49cdfc7eSAndroid Build Coastguard Workerthe discussion list also available at: http://rt.wiki.kernel.org.
26*49cdfc7eSAndroid Build Coastguard Worker
27*49cdfc7eSAndroid Build Coastguard WorkerThe testsuite contains some functional tests and a few performance
28*49cdfc7eSAndroid Build Coastguard Workerand latency measurement tests.  This is still a work in (early) progress!
29*49cdfc7eSAndroid Build Coastguard Worker
30*49cdfc7eSAndroid Build Coastguard Worker
31*49cdfc7eSAndroid Build Coastguard WorkerDEPENDENCIES
32*49cdfc7eSAndroid Build Coastguard Worker============
33*49cdfc7eSAndroid Build Coastguard WorkerThe testsuite expects glibc ("C" library) (version 2.4 onwards) and
34*49cdfc7eSAndroid Build Coastguard Workerthe underlying kernel (version 2.6.18 onwards) to support
35*49cdfc7eSAndroid Build Coastguard WorkerRobust and Priority Inheritance (PI) Mutexes.
36*49cdfc7eSAndroid Build Coastguard Worker
37*49cdfc7eSAndroid Build Coastguard WorkerMost of the tests need the user to have a privileges that allow
38*49cdfc7eSAndroid Build Coastguard Workerhim/her to create SCHED_FIFO threads of priorities upto 99
39*49cdfc7eSAndroid Build Coastguard Worker
40*49cdfc7eSAndroid Build Coastguard WorkerRUNNING TESTS THROUGH LTP
41*49cdfc7eSAndroid Build Coastguard Worker=========================
42*49cdfc7eSAndroid Build Coastguard WorkerSimplest method to run realtime tests through LTP is:
43*49cdfc7eSAndroid Build Coastguard WorkerThe command will configure,build and run tests specified through
44*49cdfc7eSAndroid Build Coastguard Workerargument provided to the script.
45*49cdfc7eSAndroid Build Coastguard Worker
46*49cdfc7eSAndroid Build Coastguard WorkerRun command below from LTP root directory with argument:
47*49cdfc7eSAndroid Build Coastguard Worker
48*49cdfc7eSAndroid Build Coastguard Worker        $./testscripts/test_realtime.sh -t $arg
49*49cdfc7eSAndroid Build Coastguard Worker
50*49cdfc7eSAndroid Build Coastguard Worker        or
51*49cdfc7eSAndroid Build Coastguard Worker
52*49cdfc7eSAndroid Build Coastguard Worker        $./test_realtime.sh -t $arg   # From $LTPROOT/testscripts directory
53*49cdfc7eSAndroid Build Coastguard Worker
54*49cdfc7eSAndroid Build Coastguard WorkerHere $arg takes values as :
55*49cdfc7eSAndroid Build Coastguard Worker
56*49cdfc7eSAndroid Build Coastguard Worker        func =        all functional tests will be run "
57*49cdfc7eSAndroid Build Coastguard Worker        stress =      all stress tests will be run "
58*49cdfc7eSAndroid Build Coastguard Worker        perf =        all perf tests will be run "
59*49cdfc7eSAndroid Build Coastguard Worker        all =         all tests will be run "
60*49cdfc7eSAndroid Build Coastguard Worker        list =        all available tests will be listed "
61*49cdfc7eSAndroid Build Coastguard Worker        clean =       all logs deleted, make clean performed "
62*49cdfc7eSAndroid Build Coastguard Worker        test_name =   only test_name subdir will be run (e.g: func/pi-tests) "
63*49cdfc7eSAndroid Build Coastguard Worker
64*49cdfc7eSAndroid Build Coastguard Worker
65*49cdfc7eSAndroid Build Coastguard WorkerBUILD
66*49cdfc7eSAndroid Build Coastguard Worker=====
67*49cdfc7eSAndroid Build Coastguard WorkerTo build the tests execute the following command:
68*49cdfc7eSAndroid Build Coastguard Worker
69*49cdfc7eSAndroid Build Coastguard Worker		$make
70*49cdfc7eSAndroid Build Coastguard Worker
71*49cdfc7eSAndroid Build Coastguard Worker
72*49cdfc7eSAndroid Build Coastguard WorkerRUNNING THE TESTS
73*49cdfc7eSAndroid Build Coastguard Worker==================
74*49cdfc7eSAndroid Build Coastguard WorkerThe top level script run.sh can be used to invoke all or a subset of tests.
75*49cdfc7eSAndroid Build Coastguard Worker
76*49cdfc7eSAndroid Build Coastguard Worker1. Running the script with no arguments will list usage:
77*49cdfc7eSAndroid Build Coastguard Worker
78*49cdfc7eSAndroid Build Coastguard Worker		$run.sh
79*49cdfc7eSAndroid Build Coastguard Worker
80*49cdfc7eSAndroid Build Coastguard Worker
81*49cdfc7eSAndroid Build Coastguard Worker2. Running the script with the list option will list the available tests.
82*49cdfc7eSAndroid Build Coastguard Worker
83*49cdfc7eSAndroid Build Coastguard Worker		$run.sh -t list
84*49cdfc7eSAndroid Build Coastguard Worker
85*49cdfc7eSAndroid Build Coastguard Worker   Note that the tests available are determined by the presence
86*49cdfc7eSAndroid Build Coastguard Worker   of a local script run_auto.sh in the individual test subdirectories
87*49cdfc7eSAndroid Build Coastguard Worker   at this time.
88*49cdfc7eSAndroid Build Coastguard Worker
89*49cdfc7eSAndroid Build Coastguard Worker
90*49cdfc7eSAndroid Build Coastguard Worker3. Individual tests can also be run. For example, to run the prio-wake tests
91*49cdfc7eSAndroid Build Coastguard Worker   for 20 iterations:
92*49cdfc7eSAndroid Build Coastguard Worker
93*49cdfc7eSAndroid Build Coastguard Worker		$run.sh -t func/prio-wake -l 20
94*49cdfc7eSAndroid Build Coastguard Worker
95*49cdfc7eSAndroid Build Coastguard Worker   Note, the test must be specified with the path relative to the test
96*49cdfc7eSAndroid Build Coastguard Worker   home (where run.sh lives).
97*49cdfc7eSAndroid Build Coastguard Worker
98*49cdfc7eSAndroid Build Coastguard Worker
99*49cdfc7eSAndroid Build Coastguard Worker4. Alternatively, you can run the individual tests from their local directory.
100*49cdfc7eSAndroid Build Coastguard Worker   For example, to run the prio-wake tests:
101*49cdfc7eSAndroid Build Coastguard Worker
102*49cdfc7eSAndroid Build Coastguard Worker		$cd func/prio-wake
103*49cdfc7eSAndroid Build Coastguard Worker		$./run_auto.sh
104*49cdfc7eSAndroid Build Coastguard Worker
105*49cdfc7eSAndroid Build Coastguard Worker
106*49cdfc7eSAndroid Build Coastguard Worker5. You can also run sets of tests:
107*49cdfc7eSAndroid Build Coastguard Worker
108*49cdfc7eSAndroid Build Coastguard Worker		$run.sh -t func
109*49cdfc7eSAndroid Build Coastguard Worker
110*49cdfc7eSAndroid Build Coastguard Worker        will run all the functional tests once
111*49cdfc7eSAndroid Build Coastguard Worker
112*49cdfc7eSAndroid Build Coastguard Worker		$run.sh -t perf -l 3
113*49cdfc7eSAndroid Build Coastguard Worker
114*49cdfc7eSAndroid Build Coastguard Worker        will run all the perf tests (if any!) thrice
115*49cdfc7eSAndroid Build Coastguard Worker
116*49cdfc7eSAndroid Build Coastguard Worker        Use the -h option to see the various arguments taken.
117*49cdfc7eSAndroid Build Coastguard Worker
118*49cdfc7eSAndroid Build Coastguard Worker6. Or you can run the binaries...
119*49cdfc7eSAndroid Build Coastguard Worker
120*49cdfc7eSAndroid Build Coastguard Worker
121*49cdfc7eSAndroid Build Coastguard Worker
122*49cdfc7eSAndroid Build Coastguard WorkerRESULTS
123*49cdfc7eSAndroid Build Coastguard Worker=======
124*49cdfc7eSAndroid Build Coastguard WorkerAll the automated run scripts set up logging in the logs/ directory.  Not all
125*49cdfc7eSAndroid Build Coastguard Workerthe tests have a clear PASS/FAIL outcome quite yet.  Work on parsing results
126*49cdfc7eSAndroid Build Coastguard Workeris ongoing.
127*49cdfc7eSAndroid Build Coastguard Worker
128