update missed 'x' operation bit

mcemenu and runmcetest are shell files and should own 'x' bit.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Fix matching issue when selecting test cases from the menu

Old logic will filter out comment lines and the words containing
on/off letters in case list files when executing case selecting.

Signed-off-by: Shaoyong Wang <shaoyongx.wang@intel.com>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Minor fixes for MCE-test

Many minor fixes are added. Some for compatibility, some for
enhancement, and the others for bug fixes.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
update the check method for debugfs

On some platforms old methods can't find debugfs correctly,
so a new way via /proc/mounts is used to find debugfs path.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Add SRAR DCU/IFU functional test case

This patch adds two SRAR functinal test cases (DCU & IFU). The
SRAR test is highly BIOS dependent so if BIOS is bogus, system
will be hang or panic. By default these two test cases are
disabled, if one wants to test SRAR, please open them.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Use BASH as default shell script interpreter

Some test scripts can't be recognized well on some Linux OS,
such as Ubuntu. Change default *sh* to *bash*.

Signed-off-by: Shaoyong Wang <shaoyongx.wang@intel.com>
Signed-off-by: Chen Gong <gong.chen@intel.com>
Update pfa test case

On some platforms original PFA case can't work well because
of no actual reading/writing action in time. This patch enhances
the reading/writing operations to ensure the error can be triggered.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Auto remove EDAC module for PFA test

Some EDAC modules will stop mcelog to collect the error log from
kernel mcelog buffer, which cause the mcelog PFA function invalid.
To avoid the influence from EDAC module, remove the specific EDAC
module before the test and restore it after the test.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Clear existed ERST record before the test

If ERST table is full, the test can't begin. To avoid
this potential issue, if existing ERST record, erase
one record to relase the storage space and let the test
go on.

Because the ERST test maybe damges the data in the ERST
table, please restore the valid data in the ERST to the
other safe place.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Add timeout condition in the PFA test

On some platforms PFA will not be triggered so that the PFA test
can't finish. So the timeout functionality is necessary to avoid
endless PFA test.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
add check for parameter notrigger in APEI/SRAR test case

On some platforms OS doesn't support parameter notrigger.
Under this kind of situation, injection procedure is dangerous
because it maybe causes sytem oops/crash. If no this parameter,
the test should be teminated.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Add workaround for dialog output because of its version

The output from special dialog version has double quote even if
--separate-output is used. If so, rip them to ensure the output
is like regular dialog output.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Update test result report information for ERST test

Add some information to remind one possible reasons
when meeting failures.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
mce-test: Fix she-bang in fs-metadata.sh and k-thread.sh

Some she-bang are missed in the bash header.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
mce-test: Fix pread and MAP_ANONYMOUS usage

_XOPEN_SOURCE=500 must be defined for pread
but this will result in MAP_ANONYMOUS not being defined
-> also define _BSD_SOURCE for MAP_ANONYMOUS

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
mce-test: OpenSUSE Build Service check wants to have the she-bang on top

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
mce-test: Add file attributes to open

This fixes a compile warning.

open(2) manpage says:
... mode specifies the permissions to use in case a new
file is created. This argument must be  supplied  when
O_CREAT is specified  in  flags; ...

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Remove coverage test cases

Coverage test cases are only for white-box test during development
of some RAS features in the kernel. By now it is totally obsolete.
Mask these test cases to avoid confusing users.

It will be removed from the test suite after some time, if no one
has complainant.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Add BSP online/offline test case

Basic BSP online/offline tests include 3 modes: PER-CPU mode
GROUP-CPU mode and S3/S4 with CPU0 onlined or offlined,
respectively.

Signed-off-by: Shaoyong Wang <shaoyongx.wang@intel.com>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Update missed file attribution

Add missed file attribution for BSP test case.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>