Skip to content

Commit

Permalink
Merge pull request #6 from garlick/gigabyte_md90-fs0-zb
Browse files Browse the repository at this point in the history
dmi.t: handle dmidecode output from Gigabyte md90
  • Loading branch information
elgeoman authored Jan 19, 2018
2 parents aa9e0bc + 57134ef commit e1c3251
Show file tree
Hide file tree
Showing 5 changed files with 3,653 additions and 3 deletions.
6 changes: 3 additions & 3 deletions diags/dmi.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ DMIDECODE="dmidecode ${DMIDECODE_DUMP_FILE:+--from-dump=$DMIDECODE_DUMP_FILE}"
# into one space. Remove leading and trailing spaces.
dmi_normalize_whitespace()
{
sed -e 's/#.*//' -e 's/[[:space:]]\+/\ /g' -e 's/[[:space:]]\+$//g' \
-e 's/^[[:space:]]\+//g'
sed -e 's/#.*//g' -e 's/[[:space:]]\+/\ /g' -e 's/[[:space:]]\+$//g' \
-e 's/^[[:space:]]\+//g' -e '/^\s*$/d'
}

# Usage: diag_test_dmi keyword wantval
Expand All @@ -60,7 +60,7 @@ dmi_check()
local keyword="$1"
shift
local wantval=$(echo $* |dmi_normalize_whitespace)
local val=$($DMIDECODE -s $keyword|head -1|dmi_normalize_whitespace)
local val=$($DMIDECODE -s $keyword|dmi_normalize_whitespace|head -1)
if [ -z "$wantval" ]; then
diag_skip "$keyword not configured"
elif [ "$val" != "$wantval" ] && ! [[ "$val" =~ $wantval ]]; then
Expand Down
9 changes: 9 additions & 0 deletions test/gbmd90/dmi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
DIAG_BIOS_DATE="05/05/2014"
DIAG_CPUFREQ_MHZ="2300 MHz"
DIAG_CPU_VERSION="Intel(R) Xeon(R) CPU E7-4870 v2 @ 2.30GHz"
DIAG_MOTHERPROD_NAME="0Y4CNC"
DIAG_MOTHERVER_NUM="A01"
DIAG_MEMTYPE_NAME="DDR3"
DIAG_MEMSPEED_MHZ="1600"
DIAG_MEMORY_TOTAL_MB="3145728"
Binary file added test/gbmd90/dmidecode
Binary file not shown.
Loading

0 comments on commit e1c3251

Please sign in to comment.