1#!/bin/bash 2# 3# Simulate the environment of mce-test driver or test case shell 4# script, used for debugging. You can invoking mce-test library 5# functions directly in shell created. 6# 7# Copyright (C) 2009, Intel Corp. 8# Author: Huang Ying <ying.huang@intel.com> 9# 10# This file is released under the GPLv2. 11# 12 13sd=$(dirname "$0") 14export ROOT=`(cd $sd/..; pwd)` 15 16if [ $# -eq 1 ]; then 17 export driver=$1 18else 19 export driver=simple 20fi 21 22tmpfile=$(mktemp) 23 24trap "rm $tmpfile" EXIT 25 26cat <<"EOF" > $tmpfile 27if [ -f /etc/bash.bashrc ]; then 28 source /etc/bash.bashrc 29fi 30 31if [ -f $HOME/.bashrc ]; then 32 source $HOME/.bashrc 33fi 34 35. $ROOT/lib/functions.sh 36setup_path 37. $ROOT/lib/dirs.sh 38. $ROOT/lib/mce.sh 39. $ROOT/lib/soft-inject.sh 40 41export PS1="MDE $driver: " 42 43echo "-----------------------------------------------------" 44echo "| MCE-test shell, You can use mce internal function |" 45echo "-----------------------------------------------------" 46EOF 47 48export PS1="MCE $driver: " 49/bin/bash --rcfile $tmpfile 50rm $tmpfile 51