• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Software injection based test cases: test cases are triggered via
4# 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 fatal_panic=": Fatal Machine check"
40    local curr_cpu_panic=": Fatal machine check on current CPU"
41    local unknown_src_panic=": Machine check from unknown source"
42    local no_eripv_exp="Neither restart nor error IP"
43    case "$bcase" in
44	s0_ar1)
45	    soft_inject_verify_mcelog
46	    verify_klog $klog
47	    soft_inject_verify_panic "$fatal_panic"
48	    soft_inject_verify_exp "Illegal combination (UCNA with AR=1)"
49	    ;;
50	srar_over)
51	    soft_inject_verify_mcelog
52	    verify_klog $klog
53	    soft_inject_verify_panic "$fatal_panic"
54	    soft_inject_verify_exp "Action required with lost events"
55	    ;;
56	srar_unkown)
57	    soft_inject_verify_mcelog
58	    verify_klog $klog
59	    soft_inject_verify_panic "$fatal_panic"
60	    soft_inject_verify_exp "Action required; unknown MCACOD"
61	    ;;
62        srar_no_en)
63            soft_inject_verify_mcelog
64            verify_klog $klog
65            soft_inject_verify_panic "Machine check from unknown source"
66            ;;
67	srao_mem_scrub_noripv|srao_ewb_noripv)
68            soft_inject_verify_mcelog
69            verify_klog $klog
70            soft_inject_verify_panic "$fatal_panic"
71            soft_inject_verify_exp "$no_eripv_exp"
72            ;;
73	*)
74	    echo "!!! Unknown case: $this_case !!!"
75    esac
76}
77
78soft_inject_main "$@"
79