diff options
author | Chen Gong <gong.chen@linux.intel.com> | 2012-07-23 11:16:31 +0800 |
---|---|---|
committer | Chen, Gong <gong.chen@linux.intel.com> | 2015-01-21 21:23:59 -0500 |
commit | 80a63c7a7f74a8f0661006e51a48f122fe3a3858 (patch) | |
tree | 1edbb9d1cdb560a418975b79144a62bfe188fccf | |
parent | 3793ad983b1fe2873c55c6a4066669d2b95fc871 (diff) | |
download | mce-test-80a63c7a7f74a8f0661006e51a48f122fe3a3858.tar.gz |
Minor fixes for MCE-test
Many minor fixes are added. Some for compatibility, some for
enhancement, and the others for bug fixes.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | cases/function/hwpoison/Makefile | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | cases/function/hwpoison/random_offline | 0 | ||||
-rwxr-xr-x | mcemenu | 2 | ||||
-rwxr-xr-x | runmcetest | 27 |
5 files changed, 26 insertions, 6 deletions
@@ -14,5 +14,4 @@ install: reset: rm -rf bin/* rm -rf work/* - rm -rf results/* diff --git a/cases/function/hwpoison/Makefile b/cases/function/hwpoison/Makefile index 1256feb..fb2fca6 100644 --- a/cases/function/hwpoison/Makefile +++ b/cases/function/hwpoison/Makefile @@ -10,7 +10,7 @@ all: ${EXE} install: all cp ttranshuge ../../../bin/ -tinjpage: LDFLAGS += -lpthread +tinjpage: LDFLAGS += -pthread clean: rm -f ${EXE} ${OBJ} diff --git a/cases/function/hwpoison/random_offline b/cases/function/hwpoison/random_offline index ecd0b3e..ecd0b3e 100644..100755 --- a/cases/function/hwpoison/random_offline +++ b/cases/function/hwpoison/random_offline @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ################################################################################ ## ## ## This program is free software; you can redistribute it and#or modify ## @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ################################################################################ ## ## ## This program is free software; you can redistribute it and#or modify ## @@ -47,16 +47,37 @@ NOCASE_MSG="The case list file is not valid, please check \ and run again." ROUND_MSG="The running time is not a valid value, please make use of a nonnegtive integer and run again." +EXIT_MSG="Delete all files under temporary directory" # Function: cleanup # # Description: Remove all temporary files created by this program. Cleanup # always called on program exit. + cleanup() { if ! [ "X${TMP_DIR}" == "X" ] then - rm -rf $TMP_DIR/* + answer="" + # if this script is called by mcemenu, skip query part + pid=`echo $$` + ppid=`pgrep mcemenu` + for id in $ppid; do + pgrep -P $id | grep $pid + if [ $? -eq 0 ]; then + answer="YES" + break; + fi + done + if [ -z $answer ]; then + read -p "$EXIT_MSG \"${TMP_DIR}\"? [Yes/No]:" answer + answer=`echo $answer | tr 'a-z' 'A-Z'` + fi + if [ "${answer}" == "Y" -o "${answer}" == "YES" \ + -o "${answer}" == "" ] + then + rm -rf $TMP_DIR/* + fi fi } @@ -174,7 +195,7 @@ usage() usage: ${0##*/} [ -t TMPDIR ] [ -s SUMFILE ] [ -o OUTDIR ] [ -b TOODIR ] [ -l CASEFILE ] [ -r RUNTIMES ] - -t TMPDIR Directory where temporary files will be created. + -t TMPDIR Directory where temporary files will be created. Don't use important directory. -s SUMDIR Directory where summary files will be created. -o OUTDIR Directory where raw test outputs will be created. -b TOODIR Directory where tool utilities will be placed. |