Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ras init #359

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions BM/ras/Makefile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions BM/ras/mce-test
Submodule mce-test added at 6e3948
91 changes: 91 additions & 0 deletions BM/ras/ras_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2024 Intel Corporation
# Author: Yi Lai <[email protected]>
# @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
12 changes: 12 additions & 0 deletions BM/ras/tests
Original file line number Diff line number Diff line change
@@ -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
Loading