xref: /aosp_15_r20/external/ltp/testcases/kdump/doc/README (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard WorkerKDUMP TESTS AUTOMATION SUITE
2*49cdfc7eSAndroid Build Coastguard Worker----------------------------
3*49cdfc7eSAndroid Build Coastguard Worker
4*49cdfc7eSAndroid Build Coastguard WorkerThe kdump test automation suite helps run the kdump tests and report
5*49cdfc7eSAndroid Build Coastguard Workerresults.  The testscripts cycle through a series of crash
6*49cdfc7eSAndroid Build Coastguard Workerscenarios. Each test cycle does the following:
7*49cdfc7eSAndroid Build Coastguard Worker
8*49cdfc7eSAndroid Build Coastguard Worker1.  Sets up a crash scenario.
9*49cdfc7eSAndroid Build Coastguard Worker2.  Forces a crash.
10*49cdfc7eSAndroid Build Coastguard Worker3.  Kdump kernel boots and saves a vmcore.
11*49cdfc7eSAndroid Build Coastguard Worker4.  System reboots to 1st kernel.
12*49cdfc7eSAndroid Build Coastguard Worker5.  vmcore is validated and results are saved.
13*49cdfc7eSAndroid Build Coastguard Worker6.  After a 1 to 2 minute delay, the next crash scenario is setup and
14*49cdfc7eSAndroid Build Coastguard Worker    run.
15*49cdfc7eSAndroid Build Coastguard Worker
16*49cdfc7eSAndroid Build Coastguard WorkerThe scripts make use of the crasher module for basic testing of kdump
17*49cdfc7eSAndroid Build Coastguard Workerand the new Linux Kernel Dump Test Module (LKDTM) for more involved
18*49cdfc7eSAndroid Build Coastguard Workertesting. LKDTM makes use of the kprobes infrastructure for inserting
19*49cdfc7eSAndroid Build Coastguard Workercrashpoints into the kernel at run-time. Thus the kernel need not be
20*49cdfc7eSAndroid Build Coastguard Workerpatched and rebuilt.This script also tests kdump dumping on different
21*49cdfc7eSAndroid Build Coastguard Workerdestinations like ext3, raw and network dump.
22*49cdfc7eSAndroid Build Coastguard Worker
23*49cdfc7eSAndroid Build Coastguard WorkerKDUMP TEST INSTRUCTION
24*49cdfc7eSAndroid Build Coastguard Worker----------------------
25*49cdfc7eSAndroid Build Coastguard Worker
26*49cdfc7eSAndroid Build Coastguard WorkerFollow the steps to setup kdump test automation suite.
27*49cdfc7eSAndroid Build Coastguard Worker
28*49cdfc7eSAndroid Build Coastguard WorkerThe tests are written for SuSE Linux Enterprise Server 10 (and onward
29*49cdfc7eSAndroid Build Coastguard Workerreleases), OpenSUSE, Fedora, Debian, as well as RedHat Enterprise Linux
30*49cdfc7eSAndroid Build Coastguard Worker5. Since KDUMP is supported by the above mentioned distro's the tests
31*49cdfc7eSAndroid Build Coastguard Workerwere written and tested on them. Contribution towards supporting more
32*49cdfc7eSAndroid Build Coastguard Workerdistributions are welcome.
33*49cdfc7eSAndroid Build Coastguard Worker
34*49cdfc7eSAndroid Build Coastguard Worker1. Install these additional packages:
35*49cdfc7eSAndroid Build Coastguard Worker
36*49cdfc7eSAndroid Build Coastguard WorkerFor SLES10 or OpenSUSE Distro :
37*49cdfc7eSAndroid Build Coastguard Worker
38*49cdfc7eSAndroid Build Coastguard Worker   * kernel-kdump
39*49cdfc7eSAndroid Build Coastguard Worker   * kernel-source
40*49cdfc7eSAndroid Build Coastguard Worker   * kexec-tools
41*49cdfc7eSAndroid Build Coastguard Worker   * zlib-64bit-<xxx> (ppc64 only)
42*49cdfc7eSAndroid Build Coastguard Worker   * expect (if dump to a network destination)
43*49cdfc7eSAndroid Build Coastguard Worker
44*49cdfc7eSAndroid Build Coastguard WorkerFor RHEL5 or Fedora distro :
45*49cdfc7eSAndroid Build Coastguard Worker
46*49cdfc7eSAndroid Build Coastguard Worker   * kexec-tools
47*49cdfc7eSAndroid Build Coastguard Worker   * kernel-devel
48*49cdfc7eSAndroid Build Coastguard Worker   * kernel-debuginfo rpm (if using crash to verify vmcore)
49*49cdfc7eSAndroid Build Coastguard Worker   * kernel-kdump ( only for ppc64 )
50*49cdfc7eSAndroid Build Coastguard Worker   * expect (if dump to a network destination)
51*49cdfc7eSAndroid Build Coastguard Worker
52*49cdfc7eSAndroid Build Coastguard Worker2.  Make sure the partition where the tests are running has space for
53*49cdfc7eSAndroid Build Coastguard Workerthe tests results and one vmcore file (size of physical memory).
54*49cdfc7eSAndroid Build Coastguard Worker
55*49cdfc7eSAndroid Build Coastguard Worker3. Modify configuration file runkdump.conf or copy a existing one from
56*49cdfc7eSAndroid Build Coastguard Workersample/.
57*49cdfc7eSAndroid Build Coastguard Worker
58*49cdfc7eSAndroid Build Coastguard Worker4.  Run "runkdump.sh". Carefully check for any errors.
59*49cdfc7eSAndroid Build Coastguard Worker
60*49cdfc7eSAndroid Build Coastguard WorkerFew Important points to remember:
61*49cdfc7eSAndroid Build Coastguard Worker
62*49cdfc7eSAndroid Build Coastguard Worker* If you need to stop the tests before all tests have run, run "crontab
63*49cdfc7eSAndroid Build Coastguard Worker-r" and "killall runkdump.sh" within 1 minute after the 1st kernel
64*49cdfc7eSAndroid Build Coastguard Workerreboots. Then, if you'd like to carry on tests from the point on, run
65*49cdfc7eSAndroid Build Coastguard Worker"crontab kdump.cron", and "./runkdump.sh". If you'd like to start tests
66*49cdfc7eSAndroid Build Coastguard Workerfrom the beginning, modify the configuration file, and set
67*49cdfc7eSAndroid Build Coastguard Worker"REBOOT=0". Then, "./runkdump.sh"
68*49cdfc7eSAndroid Build Coastguard Worker
69*49cdfc7eSAndroid Build Coastguard Worker* A failure is likely to occur when booting the kdump kernel. If this
70*49cdfc7eSAndroid Build Coastguard Workerhappens, you'll need to manually reset the system so it reboots back to
71*49cdfc7eSAndroid Build Coastguard Workerthe 1st kernel and continues on to the next test. For this reason, it's
72*49cdfc7eSAndroid Build Coastguard Workerbest to monitor the tests from a console. If possible, setup a serial
73*49cdfc7eSAndroid Build Coastguard Workerconsole (not a must, any type of console setup will do). If using
74*49cdfc7eSAndroid Build Coastguard Workerminicom, enable saving of kernel messages displayed on minicom into a
75*49cdfc7eSAndroid Build Coastguard Workerfile, by pressing ctrl+a+l on the console. Else, when it is observed
76*49cdfc7eSAndroid Build Coastguard Workerthat the kdump kernel has failed to boot, manually copy the boot message
77*49cdfc7eSAndroid Build Coastguard Workerinto a file to enable the debugging the cause of the hang.
78*49cdfc7eSAndroid Build Coastguard Worker
79*49cdfc7eSAndroid Build Coastguard Worker* The results are saved in
80*49cdfc7eSAndroid Build Coastguard Worker<kdump-test-dir>/log/<hostname>.<date-time>. The "status" file in that
81*49cdfc7eSAndroid Build Coastguard Workerdirectory shows where you are in the test run. When the "Test run
82*49cdfc7eSAndroid Build Coastguard Workercomplete" entry appears in that file, you're done. Verbose log can be
83*49cdfc7eSAndroid Build Coastguard Workerfound at /tmp/kdump.log.
84*49cdfc7eSAndroid Build Coastguard Worker
85*49cdfc7eSAndroid Build Coastguard Worker* The test machine would be unavailable for any other work during the
86*49cdfc7eSAndroid Build Coastguard Workerperiod of the test run.
87*49cdfc7eSAndroid Build Coastguard Worker
88*49cdfc7eSAndroid Build Coastguard Worker* System may hang if incorrect partition information is provided for
89*49cdfc7eSAndroid Build Coastguard Workerdumping, like specifying a partition which does not exist, specifying a
90*49cdfc7eSAndroid Build Coastguard Workerpartition label which does not exist. This is not ltp kdump bug.
91