systemctl status kdump.service | grep -q "active"
========>In RHEL7.X, kdump status "Active: active" / "Active: inactive", so $? always is 0
| if [ $? -ne 0 ]; then
| service kdump status | grep "operational"
========>In RHEL6.X kdump status "operational" / "not operational", so $? always is 0
| if [ $? -eq 0 ]; then
| LogMsg "Kdump is active after reboot"
| echo "Success: kdump service is active after reboot." >> ~/summary.log
| else
| LogMsg "ERROR: kdump service is not active after reboot!"
| echo "ERROR: kdump service is not active after reboot!" >> ~/summary.log
| UpdateTestState "TestAborted"
| exit 1
| fi
| else
| LogMsg "Kdump is active after reboot"
| echo "Success: kdump service is active after reboot." >> ~/summary.log
| fi
issue coe:
========>In cases.xml utils.sh is pushed to vm, after source it, we can use $DISTRO to check Red5., Red6., Red7. and Ubuntu13, Ubuntu14, after get them, here, we use redhat and ubuntu* to match
========>In cases.xml utils.sh is pushed to vm, after source it, we can use LogMsg directly
Source utils.sh in kdump_execute.sh to use global variable DISTRO and other functions.
I have submitted one Pull Requests to fix wrong kdump service status check.
Kdump_Execute.sh:
issue code:
systemctl status kdump.service | grep -q "active" ========>In RHEL7.X, kdump status "Active: active" / "Active: inactive", so $? always is 0 | if [ $? -ne 0 ]; then | service kdump status | grep "operational"
========>In RHEL6.X kdump status "operational" / "not operational", so $? always is 0 | if [ $? -eq 0 ]; then | LogMsg "Kdump is active after reboot" | echo "Success: kdump service is active after reboot." >> ~/summary.log | else | LogMsg "ERROR: kdump service is not active after reboot!" | echo "ERROR: kdump service is not active after reboot!" >> ~/summary.log | UpdateTestState "TestAborted" | exit 1 | fi | else | LogMsg "Kdump is active after reboot" | echo "Success: kdump service is active after reboot." >> ~/summary.log | fi
issue coe: ========>In cases.xml utils.sh is pushed to vm, after source it, we can use $DISTRO to check Red5., Red6., Red7. and Ubuntu13, Ubuntu14, after get them, here, we use redhat and ubuntu* to match ========>In cases.xml utils.sh is pushed to vm, after source it, we can use LogMsg directly
LogMsg() | { | # To add the time-stamp to the log file | echo
date "+%a %b %d %T %Y"
": ${1}" | } | | UpdateTestState() | { | echo $1 >> ~/state.txt | } | | ####################################################################### | # | # LinuxRelease() | # | ####################################################################### | LinuxRelease() | { | DISTRO=grep -ihs "buntu\|Suse\|Fedora\|Debian\|CentOS\|Red Hat Enterprise Linux" /etc/{issue,*release,*version}
| | case $DISTRO in | buntu) | echo "UBUNTU";; | Fedora) | echo "FEDORA";; | CentOS) | echo "CENTOS";; | SUSE) | echo "SLES";; | RedHat) | echo "RHEL";; | Debian) | echo "DEBIAN";; | esac | }