• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# APEI injection based test cases : memory patrol scrub cases: test cases
4# are triggered via the apei-inject, and they will not trigger kernel panic.
5#
6# Copyright (C) 2008, Intel Corp.
7#   Author: Huang Ying <ying.huang@intel.com>
8#           Zheng Jiajia <jiajia.zheng@intel.com>
9#
10# This file is released under the GPLv2.
11#
12
13. $ROOT/lib/functions.sh
14. $ROOT/lib/dirs.sh
15. $ROOT/lib/mce.sh
16. $ROOT/lib/apei-inject.sh
17
18enumerate()
19{
20    apei_inject_enumerate
21}
22
23trigger()
24{
25    case "$bcase" in
26        mem_uncorrected)
27            start_tracing "do_machine_check"
28            ;;
29        *)
30            echo '!!! Unknown case: $this_case !!!'
31    esac
32    apei_inject_trigger
33    stop_tracing
34}
35
36get_result()
37{
38    apei_inject_get_klog
39    get_gcov drivers/acpi/apei/einj.c
40
41    case "$bcase" in
42	mem_uncorrected)
43	    get_mcelog_from_dev $mcelog_result
44	    ;;
45	*)
46	    echo '!!! Unknown case: $this_case !!!'
47    esac
48}
49
50verify()
51{
52    case "$bcase" in
53	mem_uncorrected)
54	    apei_inject_verify_mcelog
55	    verify_klog $klog
56            apei_inject_verify_trace "do_machine_check"
57	    ;;
58	*)
59	    echo "!!! Unknown case: $this_case !!!"
60    esac
61}
62
63apei_inject_main "$@"
64