From 8ab9c3110aa8f271c03a86567e80f3f5887773f2 Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Fri, 2 Jul 2021 19:08:39 -0500 Subject: [PATCH] =?UTF-8?q?Agregu=C3=A9=20la=20ruta=20local=20en=20test-va?= =?UTF-8?q?riables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/report-basblocks | 56 ++++++++++++++++++++++++++++++++++++++++ scripts/test-variables | 2 ++ 2 files changed, 58 insertions(+) create mode 100755 scripts/report-basblocks diff --git a/scripts/report-basblocks b/scripts/report-basblocks new file mode 100755 index 0000000..fac3403 --- /dev/null +++ b/scripts/report-basblocks @@ -0,0 +1,56 @@ +#!/bin/bash + + +while getopts rq OPT 2>/dev/null ; do + case $OPT in + 'r') + REBUILD=1 + break + ;; + 'q') + QUIET=1 + break + ;; + esac +done + +OUTPUT_DIR=/output/hwtests + +[[ -f scripts.env ]] && source scripts.env + +HEADER='SERVER|DISK|SERIAL|RESULT|COMMENT' + +for SRV_DIR in $OUTPUT_DIR/* ; do + SERVER=`basename $SRV_DIR` + [[ $SERVER == snapshot ]] && continue + SERVERS+=" $SERVER" + #echo $SRV_DIR +done + +#echo $SERVERS + +if [[ -n $REBUILD ]] ; then + for SERVER in $SERVERS ; do + SRV_CSV=$OUTPUT_DIR/$SERVER/badblocks.csv + #echo $SRV_CSV + echo $HEADER > $SRV_CSV + DSK_DIR=$OUTPUT_DIR/$SERVER/disk + for CSV in $DSK_DIR/*.badblocks.csv ; do + if [[ -f $CSV ]] ; then + #echo $CSV + cat $CSV >> $SRV_CSV + fi + done + done + exit +fi + +if [[ -z $QUIET ]] ; then + echo $HEADER + for SERVER in $SERVERS ; do + SRV_CSV=$OUTPUT_DIR/$SERVER/badblocks.csv + if [[ -f $SRV_CSV ]] ; then + cat $SRV_CSV | grep -v 'SERVER' + fi + done +fi diff --git a/scripts/test-variables b/scripts/test-variables index bf9158f..29ddbda 100755 --- a/scripts/test-variables +++ b/scripts/test-variables @@ -15,3 +15,5 @@ RES_ULT=${BLD}RESULT${OFF} #RES_FAIL_BLINK="${RED_BLINK}FAIL${OFF}" RES_FAIL_BIG="${RED_BOLD}######## FAIL ########${OFF}" +export PATH=.:$PATH +