diff --git a/.gitmodules b/.gitmodules index 68bf56d..d187df5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,3 +3,6 @@ url = https://github.com/intel/idxd-config.git active = true branch = stable +[submodule "BM/ras/mce-test"] + path = BM/ras/mce-test + url = https://github.com/laifryiee/mce-test.git diff --git a/BM/ras/Makefile b/BM/ras/Makefile new file mode 100644 index 0000000..3216cb7 --- /dev/null +++ b/BM/ras/Makefile @@ -0,0 +1,20 @@ +SUBDIRS := mce-test + +.PHONY: all +all: $(SUBDIRS) + +.PHONY: $(SUBDIRS) +$(SUBDIRS): + $(MAKE) -C $@ + +.PHONY: install +install: + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir install; \ + done + +.PHONY: clean +clean: + for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir clean; \ + done \ No newline at end of file diff --git a/BM/ras/mce-test b/BM/ras/mce-test new file mode 160000 index 0000000..6e39480 --- /dev/null +++ b/BM/ras/mce-test @@ -0,0 +1 @@ +Subproject commit 6e394800ff9e98837ad27b159822ab2c428d62c3 diff --git a/BM/ras/ras_test.sh b/BM/ras/ras_test.sh new file mode 100755 index 0000000..8199259 --- /dev/null +++ b/BM/ras/ras_test.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (c) 2024 Intel Corporation +# Author: Yi Lai +# @Desc Test script to verify Intel RAS functionality + +# Prerequisite +if ! rpm -q screen &> /dev/null; then + echo "screen is not installed. Installing now..." + sudo yum install -y screen +fi + +cd "$(dirname "$0")" 2>/dev/null || exit 1 +source ../.env + +usage() { + cat <<__EOF + usage: ./${0##*/} [-t TESTCASE_ID] [-H] + -t TEST CASE ID + -H show this +__EOF +} + +ras_check_result() { + local testcase=$1 + + if [ $? -eq 0 ]; then + test_print_trc "${testcase} Test PASS" + else + die "${testcase} Test FAIL" + fi +} + +ras_test() { + case $TEST_SCENARIO in + apei-inj) + cd mce-test/cases/function/apei-inj/ + sh runtest.sh + ;; + core_recovery_ifu) + cd mce-test/cases/function/core_recovery/ + sh runtest_ifu.sh + ;; + core_recovery_dcu) + cd mce-test/cases/function/core_recovery/ + sh runtest_dcu.sh + ;; + edac) + cd mce-test/cases/function/edac/ + sh runtest.sh + ;; + einj-ext) + cd mce-test/cases/function/einj-ext/ + sh runtest.sh + ;; + emca-inj) + cd mce-test/cases/function/emca-inj/ + sh runtest.sh + ;; + erst-inject) + cd mce-test/cases/function/erst-inject/ + sh runtest.sh + ;; + pfa) + cd mce-test/cases/function/pfa/ + sh runtest.sh + ;; + esac + ras_check_result $TEST_SCENARIO +} + +while getopts :t:H arg; do + case $arg in + t) + TEST_SCENARIO=$OPTARG + ;; + H) + usage && exit 0 + ;; + \?) + usage + die "Invalid Option -$OPTARG" + ;; + :) + usage + die "Option -$OPTARG requires an argument." + ;; + esac +done + +ras_test diff --git a/BM/ras/tests b/BM/ras/tests new file mode 100644 index 0000000..c6a910b --- /dev/null +++ b/BM/ras/tests @@ -0,0 +1,12 @@ +# This file collects Intel RAS/MCE testcases which can run against +# IntelĀ® Architecture-based platforms. +# @other_dep: general_test.sh -t module -p einj @ No module einj + +ras_test.sh -t apei-inj +ras_test.sh -t core_recovery_ifu +ras_test.sh -t core_recovery_dcu +ras_test.sh -t edac +ras_test.sh -t einj-ext +ras_test.sh -t emca-inj +ras_test.sh -t erst-inject +ras_test.sh -t pfa