3 # common_tests - Shell script commonly used by pstore test scripts
5 # Copyright (C) Hitachi Ltd., 2015
6 # Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
8 # Released under the terms of the GPL v2.
16 absdir() { # file_path
17 (cd `dirname $1`; pwd)
20 show_result() { # result_value
30 TEST_STRING_PATTERN="Testing pstore: uuid="
31 UUID=`cat /proc/sys/kernel/random/uuid`
33 LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`_${UUID}/
36 LOG_FILE=$LOG_DIR/`basename $0`.log
37 mkdir -p $LOG_DIR || errexit "Failed to make a log directory: $LOG_DIR"
40 /bin/echo "$@" | tee -a $LOG_FILE
45 prlog "=== Pstore unit tests (`basename $0`) ==="
48 prlog -n "Checking pstore backend is registered ... "
49 backend=`cat /sys/module/pstore/parameters/backend`
51 prlog -e "\tbackend=${backend}"
52 prlog -e "\tcmdline=`cat /proc/cmdline`"
53 if [ $rc -ne 0 ]; then