aboutsummaryrefslogtreecommitdiff
path: root/testcases/kdump
diff options
context:
space:
mode:
authorsubrata_modak <subrata_modak>2007-11-22 14:28:14 +0000
committersubrata_modak <subrata_modak>2007-11-22 14:28:14 +0000
commit179a37ad9997e47ac0fd661f0cc5149a8eea4141 (patch)
tree0857cbaa2b0a1432dd9dfa8086ef7e779ed2bff4 /testcases/kdump
parentbad4dde1c9e3748e79ecd0b96e5ff8469258805c (diff)
Existing code in LTP Kdump has been enhanced to test dump on network and
different partitions. The attached patch supports following features -Dump on EXT3 partition, partition referenced by partition name, Label and UUID -Dump on raw partition -Dump on Network dump server -Test dump filtering feature of Kdump -Test Link Delay feature of Kdump -Result analysis has been implemented for local dumping and network dumping. -Result analysis has been implemented for filtering as well as link delay. But the analysis part can be enahnced further -'setup' file has been modified * To accept inputs from user or file * To automate configuration of bootloader file to reserve memory for crashkernel * To test basic or exchausted list of LKDTM test * To accept user inputs for dumping on different partitions and for network dumping -'master' file has been modified *To invoke result analysis code of dumping in different destinations *to remove cronjob when execution is done, this is a bug fix -'test' file has been modifed *To set kdump.conf file based on user input and trigger crash -'Makefile' has been modified not to run 'setup' -Added new files *kdump_propogate ->To add ssh public keys to network dump server *verify_dump ->To verify dump in different partitions and network dumping *lkdtm.orig is replaced with lkdtm.base for basic testcases of lkdtm, lkdtm.exha for exhausted list of lkdtm testcases. Submitted by: Poornima Nayak <Poornima.Nayak@in.ibm.com>
Diffstat (limited to 'testcases/kdump')
-rw-r--r--testcases/kdump/Makefile1
-rw-r--r--testcases/kdump/README36
-rw-r--r--testcases/kdump/TEST_PLAN.txt12
-rw-r--r--testcases/kdump/kdump_propagate26
-rw-r--r--testcases/kdump/master159
-rw-r--r--testcases/kdump/setup255
-rw-r--r--testcases/kdump/test76
-rw-r--r--testcases/kdump/testlists/lkdtm.base4
-rw-r--r--testcases/kdump/testlists/lkdtm.exha (renamed from testcases/kdump/testlists/lkdtm.orig)0
-rw-r--r--testcases/kdump/verify_dump156
10 files changed, 589 insertions, 136 deletions
diff --git a/testcases/kdump/Makefile b/testcases/kdump/Makefile
index 963196393..10585a38c 100644
--- a/testcases/kdump/Makefile
+++ b/testcases/kdump/Makefile
@@ -4,7 +4,6 @@ all:
chmod 755 crash_cmds distro master setup summary sysinfo test tests verify
./distro
make -C tools all
- ./setup
clean:
make -C tools clean
diff --git a/testcases/kdump/README b/testcases/kdump/README
index da97d5b19..343258cb1 100644
--- a/testcases/kdump/README
+++ b/testcases/kdump/README
@@ -15,7 +15,8 @@ The testscripts cycle through a series of crash scenarios. Each test cycle does
The scripts make use of the crasher module for basic testing of kdump and the
new Linux Kernel Dump Test Module (LKDTM) for more involved testing. LKDTM makes
use of the kprobes infrastructure for inserting crashpoints into the kernel at
-run-time. Thus the kernel need not be patched and rebuilt.
+run-time. Thus the kernel need not be patched and rebuilt.This script also tests kdump
+dumping on different destinations like ext3, raw and network dump.
KDUMP TEST INSTRUCTION
----------------------
@@ -35,33 +36,24 @@ For SLES10 Distro :
* kernel-source
* kexec-tools
* zlib-64bit-<xxx> (ppc64 only)
+ * expect
For RHEL5 distro :
* kexec-tools
* kernel-debuginfo rpm
* kernel-kdump ( only for ppc64 )
+ * expect
2. Make sure the partition where the tests are running has space for the tests
-results and one vmcore file (size of physical memory) (Currently the test suite
-support copying of the dump to the local disk only).
+results and one vmcore file (size of physical memory).
-3. Check if kernel has been booted with 'crashkernel=' parameter. If not, edit
-the appropriate bootloader configuration file and make the following changes:
+3. Setup script is enhanced to update menu.lst file with 'crashkernel=' parameter based
+on architecture.
- * On i386 & x86_64, edit /boot/grub/menu.lst and add "crashkernel=128M@16M" to
- the kernel boot parameters. This reserves 128MB of memory for the kdump
- kernel starting at address 0x1000000.
- * On PPC64, edit /etc/yaboot.conf and add "crashkernel=128M@32M xmon=off" to
- the kernel boot parameters. This reserves 128MB of memory for the kdump
- kernel starting at address 0x2000000 and makes sure xmon is off.
-
-4. Edit the bootloader configuration file to also add appropriate
+4. Edit the bootloader configuration file to add appropriate
'nmi_watchdog=' parameter.
-5. Reboot. Verify that the output of /proc/iomem indicates that space has been
-reserved for the crashkernel (for i386 & x86_64 only).
-
6. 'cd' to the test suite directory and run "make". Carefully check for any
errors. If at some point you need to restart the tests from the beginning,
simply run "make clean" followed by "make" again.
@@ -71,8 +63,13 @@ captured, path to vmlinux with debug info needs to be provided at the time of
setup (the path would generally be
/usr/lib/debug/lib/modules/<kernel version>/vmlinux).
-8. Run "./master run". Make sure no other copy of master is running before
-launching the master script.
+8. To start the kdump test run './setup test'. Inputs to the script can be provided interactively
+or through the data file, format of data in input file should be like exampledata file bundled
+along with ltp kdump code.
+
+9. Setup script can also be executed as './setup enable' to enable
+kdump to dump on network dump server, information required for dumping i.e network dump server
+and password should be provided in 'enable_data'.
Few Important points to remember:
@@ -95,3 +92,6 @@ boot message into a file to enable the debugging the cause of the hang.
* The test machine would be unavailabe for any other work during the period of
the test run.
+* System will hang if incorrect partition information is provided for dumping, like specifying
+a partition which does not exist, specifying a parition label which does not exist. This is not
+ltp kdump bug.
diff --git a/testcases/kdump/TEST_PLAN.txt b/testcases/kdump/TEST_PLAN.txt
index 8f2e7bbdb..0af949ce6 100644
--- a/testcases/kdump/TEST_PLAN.txt
+++ b/testcases/kdump/TEST_PLAN.txt
@@ -3,10 +3,10 @@ Following is the Tentative plan for improving LTP-KDUMP Test-cases:
===========================================================================================================
||S.NO|| ACTIVITY || TENTATIVE-TIME ||
===========================================================================================================
-|| 1 || Test and integrate kdump's netdump patch to LTP || SEP/OCT-2007 ||
-|| 2 || Modify ltp-kdump to automate all usecases of || SEP/OCT-2007 ||
-|| || kdump-network dumping usecases || ||
-|| 3 || Enhance error handler for kdump test || OCT/NOV-2007 ||
-|| || automation script || ||
-|| 4 || Enhance result analysis module of ltp-kdump || OCT/NOV-2007 ||
+|| 1 || Enhance result analysis code of Link Delay || JAN 2008 ||
+|| || and dump filtering || ||
+|| 2 || Develop failure recovery code for failures which || JAN 2008 ||
+|| || could be identified and fixed || ||
+|| 3 || Enhance ltp kdump to support kdump testing || DEC 2007 ||
+|| || on open suse and fedora || ||
===========================================================================================================
diff --git a/testcases/kdump/kdump_propagate b/testcases/kdump/kdump_propagate
new file mode 100644
index 000000000..66473c8a7
--- /dev/null
+++ b/testcases/kdump/kdump_propagate
@@ -0,0 +1,26 @@
+#!/usr/bin/expect
+
+if {$argc!=1} {
+ send_user "usage: $argv0 password \n"
+ exit
+}
+set password [lindex $argv 0]
+set prompt "(%|#|\\$) $"
+
+spawn service kdump propagate
+expect {
+ "* you sure you want to continue connecting *" {
+ send "yes\n"
+ expect {
+ "*?assword:" {
+ send "$password\n"
+ expect "$prompt"
+ }
+ }
+ }
+
+ "*?assword:" {
+ send "$password\n"
+ expect "$prompt"
+ }
+}
diff --git a/testcases/kdump/master b/testcases/kdump/master
index b83a6d219..5026313b5 100644
--- a/testcases/kdump/master
+++ b/testcases/kdump/master
@@ -2,12 +2,13 @@
. /etc/sysconfig/kdump
. ./config
+. ./control
reset()
{
echo "CUR_TEST=0" > $TEST_BASE_DIR/control
echo "PREV_TEST=-1" >> $TEST_BASE_DIR/control
- echo "ITERATION=0" >> $TEST_BASE_DIR/control
+ echo "ITERATION=1" >> $TEST_BASE_DIR/control
}
run_test()
@@ -18,9 +19,10 @@ run_test()
declare -i CUR_TEST
declare -i PREV_TEST
declare -i ITERATION
-
+
if [ ! -f ./control ]; then
echo "Control file not found... exiting"
+ mv /etc/kdump.conf_bak /etc/kdump.conf
exit
fi
@@ -31,78 +33,101 @@ run_test()
#
if [ ! -f $TESTFILE ]; then
echo "Test file ($TESTFILE) not found... exiting"
+ mv /etc/kdump.conf_bak /etc/kdump.conf
exit
fi
TESTS=( `cat $TESTFILE | tr '\n' ' '` )
LAST_TEST=${#TESTS[*]}-1
- if [ $PREV_TEST -gt -1 ] ; then
- if [ $DISTRO == "RH" ]; then
- #
- # Verify results of previous test
- #
- VMCORE="${VMCORE}/`date +%F-%H`*"
- RESULTS_FILE=${RESULTS_DIR}/${ITERATION}.${TESTS[$PREV_TEST]}.`date +%F-%T`
- if [ -f ${VMCORE}/vmcore ]; then
- mv ${VMCORE}/vmcore ${TEST_BASE_DIR}/results/vmcore
- rm -rf $VMCORE
- VMCORE=${TEST_BASE_DIR}/results/vmcore
- # Delay 1 minute to make sure the machine has fully booted
- sleep 1m
- echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
- ${RESULTS_DIR}/status
- $VERIFY_SCR $VMCORE > $RESULTS_FILE
- rm -rf $VMCORE
- VMCORE="/var/crash"
+ if [ $PREV_TEST -gt -1 ]; then
+ TESTCASE_NAME=${TESTS[${PREV_TEST}]}
+ if [ ${TESTCASE_NAME:0:2} = KL -o ${TESTCASE_NAME:0:2} = KN ]; then
+ ./verify_dump $TESTCASE_NAME
else
- echo "`date +%F-%T`: Verification failed for test " \
- "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
- ${RESULTS_DIR}/status
- echo "vmcore NOT FOUND!" > $RESULTS_FILE
- fi
+ if [ $DISTRO == "RH" ]; then
+ #
+ # Verify results of previous test
+ #
+ VMCORE="${VMCORE}/`date +%F-%H`*"
+ RESULTS_FILE=${RESULTS_DIR}/${ITERATION}.${TESTS[$PREV_TEST]}.`date +%F-%T`
+ if [ -f ${VMCORE}/vmcore ]; then
+ mv ${VMCORE}/vmcore ${TEST_BASE_DIR}/results/vmcore
+ rm -rf $VMCORE
+ VMCORE=${TEST_BASE_DIR}/results/vmcore
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
+ ${RESULTS_DIR}/status
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -rf $VMCORE
+ VMCORE="/var/crash"
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
- if [ $CUR_TEST -eq -1 ] ; then
- if [ $ITERATION -eq $NUM_ITERATIONS ] ; then
- #
- # Change settings back
- #
- crontab -r
- fi
+ fi
+ if [ $DISTRO == "SUSE" ]; then
+ #
+ # Verify results of previous test
+ #
+ RESULTS_FILE=${RESULTS_DIR}/${ITERATION}.${TESTS[$PREV_TEST]}.`date +%F-%T`
+ if [ ${TESTS[$PREV_TEST]} = "KEXEC-L" ]; then
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
+ ${RESULTS_DIR}/status
+ echo "kexec -l SUCCEEDED" > $RESULTS_FILE
+ else if [ -f $VMCORE ]; then
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
+ ${RESULTS_DIR}/status
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ fi
fi
- fi
- if [ $DISTRO == "SUSE" ]; then
- #
- # Verify results of previous test
- #
- RESULTS_FILE=${RESULTS_DIR}/${ITERATION}.${TESTS[$PREV_TEST]}.`date +%F-%T`
- if [ ${TESTS[$PREV_TEST]} = "KEXEC-L" ]; then
- echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
- ${RESULTS_DIR}/status
- echo "kexec -l SUCCEEDED" > $RESULTS_FILE
- else if [ -f $VMCORE ]; then
- # Delay 1 minute to make sure the machine has fully booted
- sleep 1m
- echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> \
- ${RESULTS_DIR}/status
- $VERIFY_SCR $VMCORE > $RESULTS_FILE
- rm $VMCORE
- else
- echo "`date +%F-%T`: Verification failed for test " \
- "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
- ${RESULTS_DIR}/status
- echo "vmcore NOT FOUND!" > $RESULTS_FILE
- fi
- fi
- fi
+ fi
else
echo "first test"
#
# First test, collect system info
#
+
+ # Moved from setup file to makefile to automate reserving memory
+ # Make sure kernel was booted with proper crashkernel values
+ cat /proc/cmdline | grep -e $CRASHKERNEL >/dev/null
+ RET=$?
+ if [ $RET -eq 0 ]; then
+ echo "Kernel has reserved memory for kdump kernel..."
+ echo " "
+ else
+ echo "Kernel DOES NOT have reserved memory for kdump kernel..."
+ echo "Please add appropriate crashkernel parameter to kernel cmdline"
+ echo " "
+ echo "Fix it and run setup again."
+ mv /etc/kdump.bak /etc/kdump.conf
+ crontab -r
+ exit
+ fi
+
+ # Activating kdump moved from setup file to master
+ echo "Activating kdump service..."
+ chkconfig kdump on
+ echo "Making sure kdump kernel can be loaded..."
+ service kdump restart
+
+
RESULTS_DIR=${RESULTS_DIR}/`hostname`.`date +%F-%T`
mkdir -p $RESULTS_DIR
- echo "`date +%F-%T`: Starting test run" >> ${RESULTS_DIR}/status
+ echo "`date +%F-%T`: Starting test run" >> ${RESULTS_DIR}/status
if [ $DISTRO == "RH" ]; then
cp /proc/config.gz ${RESULTS_DIR}
fi
@@ -120,13 +145,15 @@ run_test()
#
if [ $CUR_TEST -eq -1 ] ; then
echo "`date +%F-%T`: Test run complete" >> ${RESULTS_DIR}/status
+ crontab -r
+ echo "removed crontab "
exit
fi
#
# Set up for next test
#
-
+ echo " current test $CUR_TEST last test $LAST_TEST"
if [ $CUR_TEST -eq $LAST_TEST ] ; then
if [ $ITERATION -eq $NUM_ITERATIONS ] ; then
# This is the last test, we're done
@@ -134,22 +161,19 @@ run_test()
else
# Starting new iteration
NEXT_TEST=0
+ let "ITERATION++"
fi
else
- NEXT_TEST=CUR_TEST+1
+ NEXT_TEST=$((CUR_TEST+1))
fi
-
- #
- # Are we starting a new iteration?
- #
- if [ $CUR_TEST -eq 0 ] ; then
- let "ITERATION++"
- fi
echo "CUR_TEST="$NEXT_TEST > $TEST_BASE_DIR/control
echo "PREV_TEST="$CUR_TEST >> $TEST_BASE_DIR/control
echo "ITERATION="$ITERATION >> $TEST_BASE_DIR/control
echo "RESULTS_DIR="$RESULTS_DIR >> $TEST_BASE_DIR/control
+
+ # Write Current test in control file usefule for result verification
+ echo "PREV_TESTCASE="$TEST_SCR ${TESTS[${CUR_TEST}]} >> $TEST_BASE_DIR/control
#
# Run current test
@@ -174,6 +198,7 @@ case "$1" in
;;
*)
echo $"Usage: $0 {run|reset|results}"
+ mv /etc/kdump.conf_bak /etc/kdump.conf
exit 1
esac
diff --git a/testcases/kdump/setup b/testcases/kdump/setup
index f3e2673a4..cc2544ee1 100644
--- a/testcases/kdump/setup
+++ b/testcases/kdump/setup
@@ -11,6 +11,9 @@ declare -i CRASH_FOUND=0
# ARCH = 1 means it's ia32/x86_64 arch
# ARCH = 2 means it's ppc64 arch
declare -i ARCH
+declare -i DATA_AUTO=0
+declare -i LINK_DELAY=0
+
CRASHKERNEL='crashkernel=[0-9]\+M@[0-9]\+M'
USE_CRASH="n"
@@ -20,23 +23,81 @@ USE_MOD="1"
VMLINUX_DEBUG=""
LINUX_2_6_16=2616
+#test if input file is available
+if [ -z "$1" ]; then
+ echo "usage: $0 test or enable"
+ echo "enable: argument will enable kdump to capture dump and dump in network dump server"
+ exit
+else
+ TEST=$1
+fi
+
+if [ -f $CONFIG_FILE -a -s $CONFIG_FILE ]; then
+ rm $CONFIG_FILE
+fi
+
+#test if input file is available
+if [ -f ./data_file -a $TEST="test" ]; then
+ DATA_AUTO=1
+ . ./data_file
+fi
+
+#Create testfile if kdump has to be enabled while testing other testsuites
+rm -f testfile
+if [ -f ./enable_data -a $TEST="enable" ]; then
+ DATA_AUTO=1
+ . ./enable_data
+ echo -e "KDENB" > testfile
+ echo "SCP_PATH=$SCP_PATH" >> $CONFIG_FILE
+ echo "DEST_PASS_WD=$DEST_PASS_WD" >> $CONFIG_FILE
+
+fi
+
+# Create a backup of kdump.conf file
+if [ -f /etc/kdump.orig ]; then
+ cp /etc/kdump.orig /etc/kdump.conf
+else
+ cp /etc/kdump.conf /etc/kdump.orig
+fi
+
# Determine architecture we're running on
+#Modify menu.lst file to reserve memory while booting
arch=`uname -m`
+cat /proc/cmdline | grep -e $CRASHKERNEL >/dev/null
+RET=$?
if [ `echo $arch |grep -e "i[3-6]86"` ]
then
ARCH=1
+ if [ $RET -ne 0 ]; then
+ cat /boot/grub/menu.lst | sed -e 's/^[ ]*//' | sed -e '/^kernel/s/$/ crashkernel=64M\@16M/' > menu.lst
+ fi
+ echo "CRASHKERNEL=64M@16M" >> $CONFIG_FILE
else if [ $arch == "x86_64" ]
then
ARCH=1
+ if [ $RET -ne 0 ]; then
+ cat try.lst | sed -e 's/^[ ]*//' | sed -e '/^kernel/s/$/ crashkernel=64M\@16M/' > menu.lst
+ fi
+ echo "CRASHKERNEL=64M@16M" >> $CONFIG_FILE
else if [ $arch == "ppc64" ]
then
ARCH=2
+ if [ $RET -ne 0 ]; then
+ cat try.lst | sed -e 's/^[ ]*//' | sed -e '/^kernel/s/$/ crashkernel=64M\@32M/' > menu.lst
+ fi
+ echo "CRASHKERNEL=64M@32M" >> $CONFIG_FILE
else
echo "Unsupported architecture... exiting"
exit
fi
fi
fi
+
+#copy menu.lst to /boot/grub/menu.lst only if menu.lst size is not zero
+if [ -f menu.lst -a -s menu.lst ]; then
+ mv menu.lst /boot/grub/menu.lst
+fi
+
# Determine the Kernel Version
KERNEL_VERSION=$(uname -r | awk -F . '{ print $1 $2 $3}' | awk -F - '{ print $1 }' )
if [ $KERNEL_VERSION -lt $LINUX_2_6_16 ]; then
@@ -46,15 +107,20 @@ fi
# Determine the distribution we are running on
DISTRO=`./distro`
-echo "DISTRO=$DISTRO" > $CONFIG_FILE
+echo "DISTRO=$DISTRO" >> $CONFIG_FILE
echo "Using the crash command and the kernel debug info during results"
echo "verfication is optional. If you choose to do so, they must be"
echo "installed on the system before running this script."
echo ""
-read -p "Do you want to use crash and the kernel debug info? (y/n): " USE_CRASH
+if [ $DATA_AUTO -eq 0 -a $TEST="test" ]; then
+ read -p "Do you want to use crash and the kernel debug info? (y/n): " USE_CRASH
+fi
+
if [ $USE_CRASH = "y" ]; then
- read -p "Enter the location of the kernel debug binary: " VMLINUX_DEBUG
+ if [ $DATA_AUTO -eq 0 -a $TEST="test" ]; then
+ read -p "Enter the location of the kernel debug binary: " VMLINUX_DEBUG
+ fi
if [ ! -f $VMLINUX_DEBUG ]; then
echo "${VMLINUX_DEBUG} NOT FOUND... crash won't be used during verify"
VMLINUX=""
@@ -71,7 +137,9 @@ fi
echo "CRASH_FOUND=${CRASH_FOUND}" >> $CONFIG_FILE
# How many times to iterate through the tests
-read -p "How many interations of the the test set do you want to run? (default is 1): " NUM_ITERATIONS
+if [ $DATA_AUTO -eq 0 -a $TEST="test" ]; then
+ read -p "How many interations of the the test set do you want to run? (default is 1): " NUM_ITERATIONS
+fi
if [ $NUM_ITERATIONS -le 0 ]; then
NUM_ITERATIONS=1
fi
@@ -80,24 +148,134 @@ echo "NUM_ITERATIONS=${NUM_ITERATIONS}" >> $CONFIG_FILE
# Create testfile with the commands to be run depending on the module to be
# used for testing
-rm -f testfile
-read -p "Use lkdtm or crasher module (1/2) :" USE_MOD
-if [ $USE_MOD -eq 1 ]; then
- cp -f testlists/lkdtm.orig testlists/lkdtm
- ln -s testlists/lkdtm testfile
-
- read -p "Are SCSI disks present (y/n) :" SCSI
- if [ $SCSI = "y" ]; then
- echo -e "KPSB\nKPSE\nKPSL\nKPSP" >> testfile
- fi
+if [ $DATA_AUTO -eq 0 -a $TEST="test" ]; then
+ read -p "Want to run test with lkdtm or crasher module (y/n) :" LK_CR
+fi
+if [ $LK_CR = "y" ]; then
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Use lkdtm or crasher module (1/2) :" USE_MOD
+ fi
+ if [ $USE_MOD -eq 1 ]; then
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Test exhaustive cases of lkdtm (y/n) :" EXHAUST
+ fi
+ if [ $EXHAUST = "y" ]; then
+ cp -f testlists/lkdtm.exha testlists/lkdtm
+ ln -s testlists/lkdtm testfile
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Are SCSI disks present (y/n) :" SCSI
+ fi
+ if [ $SCSI = "y" ]; then
+ echo -e "KPSB\nKPSE\nKPSL\nKPSP" >> testfile
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Are IDE disks present (y/n) :" IDE
+ fi
+ if [ $IDE = "y" ]; then
+ echo -e "KPIB\nKPIE\nKPIL\nKPIP" >> testfile
+ fi
+
+ else
+ cp -f testlists/lkdtm.base testlists/lkdtm
+ ln -s testlists/lkdtm testfile
+ fi
+
+ else
+ ln -s testlists/crasher testfile
+ fi
+fi
+
+# Create testfile for Kdump dump commands testing
+if [ $DATA_AUTO -eq 0 -a $TEST="test" ]; then
+ read -p "Test kdump dumping on different destinations (y/n):" DUMP_TEST
+fi
+if [ $DUMP_TEST = "y" ]; then
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test ext3 partition on /dev/part enter /dev/part else press Enter: " EXT3_PARTITION
+ fi
+ if [ $EXT3_PARTITION ]; then
+ echo -e "KLEXT" >> testfile
+ echo "EXT3_PARTITION=$EXT3_PARTITION" >> $CONFIG_FILE
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test ext3 partition with partition LABEL enter LABEL else press Enter: " EXT3_LABEL
+ fi
+ if [ $EXT3_LABEL ]; then
+ echo -e "KLLBL" >> testfile
+ echo "EXT3_LBL=$EXT3_LABEL" >> $CONFIG_FILE
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test ext3 partition with partition UID enter UID else press Enter: " EXT3_UID
+ fi
+ if [ $EXT3_UID ]; then
+ echo -e "KLUID" >> testfile
+ echo "EXT3_UID=$EXT3_UID" >> $CONFIG_FILE
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test raw partition on /dev/part enter /dev/part else press Enter: " RAW_PART
+ fi
+ if [ $RAW_PART ]; then
+ echo -e "KLRAW" >> testfile
+ echo "RAW_PARTITION=$RAW_PART" >> $CONFIG_FILE
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test network dumping enter <user@server> else press Enter: " SCP_PATH
+ if [ $SCP_PATH ]; then
+ read -p "Enter root password for $SCP_PATH: " DEST_PASS_WD
+ fi
+ fi
+ if [ $SCP_PATH ]; then
+ echo -e "KNSCP" >> testfile
+ echo "SCP_PATH=$SCP_PATH" >> $CONFIG_FILE
+ echo "DEST_PASS_WD=$DEST_PASS_WD" >> $CONFIG_FILE
+ fi
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test network dump on nfs mounted path enter <server:path> else press Enter: " NFS_PATH
+ fi
+ if [ $NFS_PATH ]; then
+ echo -e "KNNFS" >> testfile
+ echo "NFS_PATH=$NFS_PATH" >> $CONFIG_FILE
+ fi
+
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "To test link delay for network dump enter delay in seconds else press Enter " LINK_DELAY
+ if [ $LINK_DELAY -gt 0 ]; then
+
+ read -p "Enter dump server for network dumping: <user@server> " LDSCP_PATH
+ read -p "Enter root password for $SCP_PATH: " LDDEST_PASS_WD
+ fi
+ fi
+ if [ $LDSCP_PATH ]; then
+ echo -e "KNLD" >> testfile
+ echo "LDSCP_PATH=$LDSCP_PATH" >> $CONFIG_FILE
+ echo "LDDEST_PASS_WD=$LDDEST_PASS_WD" >> $CONFIG_FILE
+ echo "LINK_DELAY=$LINK_DELAY" >> $CONFIG_FILE
+ fi
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Enable dump with filtering (y/n):" FILTER
+ fi
+ echo "FILTER=$FILTER" >> $CONFIG_FILE
+ if [ $FILTER = "y" ]; then
+ if [ $DATA_AUTO -eq 0 ]; then
+ read -p "Enter makedumpfile options: <[-c|-E] [-d dump_level] -i config_file dump_mem dump_file> " MAKE_OPTS
+ fi
+ echo "MAKE_OPTIONS=$MAKE_OPTS" >> $CONFIG_FILE
+ fi
- read -p "Are IDE disks present (y/n) :" IDE
- if [ $IDE = "y" ]; then
- echo -e "KPIB\nKPIE\nKPIL\nKPIP" >> testfile
- fi
-else
- ln -s testlists/crasher testfile
fi
+
+if [ ! -f testfile ]; then
+ echo -e "check your inputs !!!\n"
+ echo -e "Testfile is not created \n"
+ exit
+fi
+
#
# Checks
@@ -135,19 +313,15 @@ if [ $DISTRO == "SUSE" ] || [ $DISTRO == "RH" ]; then
fi
echo " "
fi
-fi
-
-# Make sure kernel was booted with proper crashkernel values
-cat /proc/cmdline | grep -e $CRASHKERNEL >/dev/null
-RET=$?
-if [ $RET -eq 0 ]; then
- echo "Kernel has reserved memory for kdump kernel..."
- echo " "
-else
- echo "Kernel DOES NOT have reserved memory for kdump kernel..."
- echo "Please add appropriate crashkernel parameter to kernel cmdline"
- echo " "
- let "ERRORS++"
+ REQ_FOUND=$(rpm -qa | grep expect 2>/dev/null)
+ if [ $REQ_FOUND ]; then
+ echo "Found expect rpm..."
+ echo " "
+ else
+ echo "expect rpm NOT FOUND..."
+ echo "Please install expect rpm and run the setup"
+ let "ERRORS++"
+ fi
fi
if [ $ERRORS -gt 0 ]; then
@@ -202,7 +376,7 @@ echo "LKDTM=\$TEST_BASE_DIR/tools/lkdtm_mod/lkdtm.ko" >> $CONFIG_FILE
echo "Creating control file..."
echo "CUR_TEST=0" > $CONTROL_FILE
echo "PREV_TEST=-1" >> $CONTROL_FILE
-echo "ITERATION=0" >> $CONTROL_FILE
+echo "ITERATION=1" >> $CONTROL_FILE
#
# Create the crontab file
@@ -231,14 +405,8 @@ if [ $DISTRO == "SUSE" ]; then
echo "KDUMP_IMMEDIATE_REBOOT=\"yes\"" >> $SYSCONFIG_FILE
fi
-# Make sure the kdump service is on and
-# the kdump kernel is loaded
+# Activating cron
if [ -f /bin/rpm ]; then
- echo "Activating kdump service..."
- chkconfig kdump on
- echo "Making sure kdump kernel can be loaded..."
- service kdump restart
-
echo "Activating cron..."
if [ $DISTRO == "SUSE" ]; then
chkconfig cron on
@@ -249,6 +417,9 @@ if [ -f /bin/rpm ]; then
fi
else
echo "There is no rpm on your machine."
- echo "Please make sure that kdump and cron are enabled by
+ echo "Please make sure that kdump and cron is enabled by
default."
fi
+
+sleep 60
+reboot
diff --git a/testcases/kdump/test b/testcases/kdump/test
index 427135f62..c85d857fd 100644
--- a/testcases/kdump/test
+++ b/testcases/kdump/test
@@ -186,6 +186,78 @@ c/cmdline`"
echo 1 > /proc/sys/kernel/panic_on_oops
insmod $LKDTM cpoint_name=IDE_CORE_CP cpoint_type=OVERFLOW cpoint_count=01
;;
+ "KLEXT")
+ echo -e "ext3 $EXT3_PARTITION" > /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KLLBL")
+ echo -e "ext3 LABEL=$EXT3_LBL" > /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KLUID")
+ echo -e "ext3 UUID=$EXT3_UID" > /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KLRAW")
+ echo -e "raw $RAW_PARTITION" > /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KNSCP")
+ echo -e "net $SCP_PATH" > /etc/kdump.conf
+ ./kdump_propagate $DEST_PASS_WD
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KNNFS")
+ echo -e "net $NFS_PATH" > /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KNLD")
+ echo -e "net $LDSCP_PATH" > /etc/kdump.conf
+ echo -e "link_delay $LINK_DELAY" >> /etc/kdump.conf
+ if [ $FILTER = "y" ]; then
+ echo -e "core_collector makedumpfile $MAKE_OPTS" >> /etc/kdump.conf
+ fi
+ ./kdump_propagate $LDDEST_PASS_WD
+ service kdump restart
+ echo c > /proc/sysrq-trigger
+ ;;
+
+ "KDENB")
+ echo -e "net $SCP_PATH" > /etc/kdump.conf
+ ./kdump_propagate $DEST_PASS_WD
+ service kdump restart
+ ;;
+
*)
echo "Unknown test"
;;
@@ -196,5 +268,5 @@ esac
# or leave it working. But we need to do all tests. So
# we are going to reboot if we are in wrong place.
-sleep 30
-reboot \ No newline at end of file
+sleep 60
+reboot
diff --git a/testcases/kdump/testlists/lkdtm.base b/testcases/kdump/testlists/lkdtm.base
new file mode 100644
index 000000000..672a1c75a
--- /dev/null
+++ b/testcases/kdump/testlists/lkdtm.base
@@ -0,0 +1,4 @@
+KPIDB
+KPIEB
+KPTEE
+KPBL
diff --git a/testcases/kdump/testlists/lkdtm.orig b/testcases/kdump/testlists/lkdtm.exha
index 6cd1c0814..6cd1c0814 100644
--- a/testcases/kdump/testlists/lkdtm.orig
+++ b/testcases/kdump/testlists/lkdtm.exha
diff --git a/testcases/kdump/verify_dump b/testcases/kdump/verify_dump
new file mode 100644
index 000000000..2d695d078
--- /dev/null
+++ b/testcases/kdump/verify_dump
@@ -0,0 +1,156 @@
+. ./config
+. ./control
+
+TESTS=( `cat $TESTFILE | tr '\n' ' '` )
+RESULTS_FILE=${RESULTS_DIR}/${ITERATION}.${TESTS[$PREV_TEST]}.`date +%F-%T`
+echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+
+#unmount mnt if already mounted in previous test
+echo `umount /mnt`
+
+case $1 in
+ "KLEXT")
+ mount $EXT3_PARTITION /mnt
+ VMCORE="/mnt/var/crash/127.0.0.1-`date +%F-%H`*"
+ if [ -f ${VMCORE}/vmcore ]; then
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ mv ${VMCORE}/vmcore ${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ rm -rf $VMCORE
+ VMCORE="${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore"
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+ "KLLBL")
+ mount -L $EXT3_LBL /mnt
+ VMCORE="/mnt/var/crash/127.0.0.1-`date +%F-%H`*"
+ if [ -f ${VMCORE}/vmcore ]; then
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ mv ${VMCORE}/vmcore ${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ rm -rf $VMCORE
+ VMCORE="${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore"
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+
+ "KLUID")
+ mount /dev/disk/by-uuid/$EXT3_UID /mnt
+ VMCORE="/mnt/var/crash/127.0.0.1-`date +%F-%H`*"
+ if [ -f ${VMCORE}/vmcore ]; then
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ mv ${VMCORE}/vmcore ${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ rm -rf $VMCORE
+ VMCORE="${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore"
+ echo " print vmcore file path $VMCORE"
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+ "KLRAW")
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ dd if=$RAW_PARTITION of=${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore bs=1024
+ VMCORE=${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ if [ -f ${VMCORE} ]; then
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+ "KNSCP")
+ SERVER=${SCP_PATH#*@}
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ FILE_PATH="/var/crash/`host "$(hostname)" | cut -f4 -d" " `-`date +%F-%H`*"
+ # Delay 1 minute to make sure the machine has fully booted
+ #sleep 1m
+ SRC=$SERVER:$FILE_PATH/vmcore
+ DEST=${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ echo "server is $SERVER src is $SRC dest is $DEST"
+ echo `scp root@${SRC} ${DEST}`
+ VMCORE="${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore"
+ if [ -f ${VMCORE} ]; then
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+ "KNNFS")
+ mount $NFS_PATH /mnt
+ VMCORE="/mnt/var/crash/`host "$(hostname)" | cut -f4 -d" " `-`date +%F-%H`*"
+ if [ -f ${VMCORE}/vmcore ]; then
+ # Delay 1 minute to make sure the machine has fully booted
+ sleep 1m
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ mv ${VMCORE}/vmcore ${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ rm -rf $VMCORE
+ VMCORE=${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+ "KNLD")
+ SERVER=${LDSCP_PATH#*@}
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ FILE_PATH="/var/crash/`host "$(hostname)" | cut -f4 -d" " `-`date +%F-%H`*"
+ # Delay 1 minute to make sure the machine has fully booted
+ #sleep 1m
+ SRC=$SERVER:$FILE_PATH/vmcore
+ DEST=${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore
+ echo `scp root@${SRC} ${DEST}`
+ VMCORE="${RESULTS_DIR}/${TESTS[$PREV_TEST]}vmcore"
+ if [ -f ${VMCORE} ]; then
+ echo "`date +%F-%T`: Verifying test ${TESTS[${PREV_TEST}]}" >> ${RESULTS_DIR}/status
+ $VERIFY_SCR $VMCORE > $RESULTS_FILE
+ rm -f $VMCORE
+ else
+ echo "`date +%F-%T`: Verification failed for test " \
+ "${TESTS[${PREV_TEST}]}: vmcore NOT FOUND" >> \
+ ${RESULTS_DIR}/status
+ echo "vmcore NOT FOUND!" > $RESULTS_FILE
+ fi
+ ;;
+
+esac