microsoft / lis-test

Contains test infrastructure for testing Linux virtual machines on Windows Azure and Hyper-V.
32 stars 72 forks source link

Kdump_Execute.sh: Critical issue for check kdump service status in RHEL #728

Closed yangboroy closed 7 years ago

yangboroy commented 7 years ago

Kdump_Execute.sh:

  1. 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

  2. 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   | }

yangboroy commented 7 years ago

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.

yangboroy commented 7 years ago

Have submitted one Pull requests to fix.