1#!/bin/bash 2# 3# Software injection based test cases: test cases are triggered via 4# the mce-inject tool. 5# 6# Copyright (C) 2009, Intel Corp. 7# Author: Huang Ying <ying.huang@intel.com> 8# 9# This file is released under the GPLv2. 10# 11 12. $ROOT/lib/functions.sh 13. $ROOT/lib/dirs.sh 14. $ROOT/lib/mce.sh 15. $ROOT/lib/soft-inject.sh 16 17enumerate() 18{ 19 soft_inject_enumerate 20} 21 22trigger() 23{ 24 reset_severity_cov 25 soft_inject_trigger 26} 27 28get_result() 29{ 30 soft_inject_get_klog 31 get_gcov arch/x86/kernel/cpu/mcheck/mce.c 32 soft_inject_get_mcelog 33 get_severity_cov 34} 35 36verify() 37{ 38 local removes="TSC TIME PROCESSOR" 39 local over_exp="Overflowed uncorrected" 40 local fatal_panic=": Fatal Machine check" 41 local curr_cpu_panic=": Fatal machine check on current CPU" 42 case "$bcase" in 43 uc_over|uc_over_corrected) 44 soft_inject_verify_mcelog 45 verify_klog $klog 46 soft_inject_verify_panic "$fatal_panic" 47 soft_inject_verify_exp "$over_exp" 48 ;; 49 uc_over_timeout) 50 soft_inject_verify_mcelog 51 verify_klog $klog 52 soft_inject_verify_panic "$curr_cpu_panic" 53 soft_inject_verify_exp "$over_exp" 54 soft_inject_verify_timeout 55 ;; 56 *) 57 echo "!!! Unknown case: $this_case !!!" 58 esac 59} 60 61soft_inject_main "$@" 62