Skip to content

Commit

Permalink
ras: introduce ras feature into lkvs
Browse files Browse the repository at this point in the history
Introduce RAS (Reliability, Availability, and Serviceability) into lkvs.
Add several error injection test cases.

Signed-off-by: Lai, Yi1 <[email protected]>
  • Loading branch information
laifryiee committed Aug 20, 2024
1 parent eb53cef commit 0ca2007
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
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
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

0 comments on commit 0ca2007

Please sign in to comment.