Skip to content

Commit

Permalink
edac: introduce edac feature into lkvs
Browse files Browse the repository at this point in the history
Intel i10nm EDAC driver supports the Intel 10nm series server integrated
memory controller. Introduce this feature into lkvs test suite and add 2
test cases.

Signed-off-by: Lai, Yi1 <[email protected]>
  • Loading branch information
laifryiee committed May 27, 2024
1 parent 79c8a0e commit 3cb3a2c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
19 changes: 19 additions & 0 deletions BM/edac/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EDAC

EDAC (Error Detection and Correction) framework provides support for detecting and correcting memory errors on systems with ECC (Error-Correcting Code) memory or other error detection mechanism.

Intel i10nm EDAC driver supports the Intel 10nm series server integrated memory controller.

## Usage

You can run the cases one by one, e.g. command

```
./intel_edac.sh -t check_edac_bus
```
You also can run the cases together with runtests command, e.g.

```
cd ..
./runtests -f edac/tests -o logfile
```
66 changes: 66 additions & 0 deletions BM/edac/intel_edac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2022 Intel Corporation
# Description: Test script for Intel i10nm EDAC driver, which supports 10nm series server
# EDAC: Error Detection and Correction
# @Author Yi Lai [email protected]


cd "$(dirname "$0")" 2>/dev/null || exit 1
source ../.env

EDAC_BUS="/sys/bus/edac"
EDAC_DRIVER=i10nm_edac

: "${CASE_NAME:=""}"

usage() {
cat <<__EOF
usage: ./${0##*/} [-t TESTCASE_ID] [-H]
-t TEST CASE ID
-H show this
__EOF
}

edac_test() {
case $TEST_SCENARIO in
check_edac_bus)
edac_bus=$(ls $EDAC_BUS)
if [ -n "$edac_bus" ]; then
test_print_trc "EDAC bus is found"
else
die "EDAC bus is not found"
fi
;;
check_edac_driver)
test_print_trc "Check Intel i10nm edac driver"
lsmod | grep -q $EDAC_DRIVER
if ! lsmod | grep -q $EDAC_DRIVER; then
die "Intel i10nm edac driver is not loaded"
else
test_print_trc "Intel i10nm edac driver is loaded"
fi
;;
esac
}

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

edac_test
5 changes: 5 additions & 0 deletions BM/edac/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file collects Intel EDAC driver testcases which can run against
# on Intel 10nm series server

intel_edac.sh -t check_edac_bus
intel_edac.sh -t check_edac_driver

0 comments on commit 3cb3a2c

Please sign in to comment.