xfstests.zsh: Lots of updates for parallel xfstests
Also download the xunit reports generated during testing and store them for later Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
3a2a30af33
commit
50fcd690ba
|
@ -2,54 +2,85 @@ import sys
|
|||
import re
|
||||
import termcolor
|
||||
|
||||
PROTO_COLORS = { "tcp":"white", "rdma":"yellow" }
|
||||
PROTO = sys.argv[1]
|
||||
|
||||
VERS_COLORS = { "v3":"red", "v4.0":"green", "v4.1":"blue", "v4.2":"yellow" }
|
||||
VERS = f"v{sys.argv[2]}"
|
||||
COLOR = VERS_COLORS[VERS]
|
||||
|
||||
prefix = termcolor.colored("[", "white", attrs=["bold"])
|
||||
prefix += termcolor.colored(sys.argv[1].rjust(4), "red", attrs=["bold"])
|
||||
prefix += ","
|
||||
prefix += termcolor.colored(f"v{sys.argv[2]}".ljust(4), "magenta")
|
||||
prefix += termcolor.colored(PROTO.rjust(4), PROTO_COLORS[PROTO], attrs=["dark"])
|
||||
prefix += termcolor.colored(",", "white", attrs=["bold"])
|
||||
prefix += termcolor.colored(VERS.ljust(4), COLOR, attrs=["bold"])
|
||||
prefix += termcolor.colored("] ", "white", attrs=["bold"])
|
||||
|
||||
#proto = sys.argv[1].rjust(4)
|
||||
#vers = sys.argv[2].ljust(3)
|
||||
def print_prefix():
|
||||
print(prefix, end="")
|
||||
# termcolor.cprint("[", "white", attrs=["bold"], end="")
|
||||
#termcolor.cprint(proto, "red", attrs=["bold"], end="")
|
||||
#termcolor.cprint(",", "white", end="")
|
||||
#termcolor.cprint(f"v{vers}", "magenta", end="")
|
||||
#termcolor.cprint("] ", "white", attrs=["bold"], end="")
|
||||
CONFIG = [ ]
|
||||
def add_config(line):
|
||||
[ key, val ] = [ s.strip() for s in re.split("--", line) ]
|
||||
if key == "MKFS_OPTIONS":
|
||||
return
|
||||
elif key == "MOUNT_OPTIONS" and val[:2] != "-o":
|
||||
return
|
||||
|
||||
text = ""
|
||||
def print_text(color, attr=None):
|
||||
global text
|
||||
termcolor.cprint(text, color=color, attrs=[attr] if attr else None, end="")
|
||||
text = ""
|
||||
parts = [ prefix ]
|
||||
parts.append(termcolor.colored(key.ljust(14), COLOR, attrs=["bold"]))
|
||||
parts.append(termcolor.colored("-- ", "white", attrs=["dark"]))
|
||||
parts.append(termcolor.colored(val, "white", attrs=["bold"]))
|
||||
CONFIG.append("".join(parts))
|
||||
|
||||
def print_config():
|
||||
global text
|
||||
key, val = re.split("--", text)
|
||||
if key != "MKFS_OPTIONS " and val[:3] != " -o":
|
||||
print_prefix()
|
||||
termcolor.cprint(key, "cyan", attrs=["bold"], end="")
|
||||
termcolor.cprint("--", "white", end="")
|
||||
termcolor.cprint(val, "white", attrs=["bold"], end="")
|
||||
text = ""
|
||||
if len(CONFIG) > 0:
|
||||
print("\n".join(CONFIG), end="\n\n")
|
||||
CONFIG.clear()
|
||||
|
||||
while c := sys.stdin.read(1):
|
||||
text += c
|
||||
if re.match("^PLATFORM.*PREEMPT", text):
|
||||
text += "\n"
|
||||
def print_test(match):
|
||||
parts = [ prefix ]
|
||||
parts.append(termcolor.colored(match.group(1), COLOR, attrs=["bold"]))
|
||||
|
||||
if m := re.match("(\[not run\])(.*?\n)", match.group(2)):
|
||||
return
|
||||
parts.append(termcolor.colored(m.group(1), "yellow"))
|
||||
parts.append(termcolor.colored(m.group(2), "white", attrs=["bold"]))
|
||||
elif m := re.match("(\d+s)( ... +)(\d+s\n)", match.group(2)):
|
||||
parts.append(termcolor.colored(m.group(1), "green"))
|
||||
parts.append(termcolor.colored(m.group(2), "white", attrs=["dark"]))
|
||||
parts.append(termcolor.colored(m.group(3), "green"))
|
||||
elif re.match("\d+s\n", match.group(2)):
|
||||
parts.append(termcolor.colored(match.group(2), "green"))
|
||||
else: # Test failed
|
||||
line = re.sub("\]-", "\] -", match.group(2))
|
||||
parts.append(termcolor.colored(line, "magenta", attrs=["bold"]))
|
||||
|
||||
print("".join(parts), end="")
|
||||
|
||||
def print_diff(line):
|
||||
print(prefix, end="")
|
||||
if re.match(" +@@.*?@@\n", line):
|
||||
termcolor.cprint(line, color="yellow", attrs=["dark"], end="")
|
||||
elif re.match(" +-", line):
|
||||
termcolor.cprint(line, color="magenta", attrs=["dark"], end="")
|
||||
elif re.match(" +\+", line):
|
||||
termcolor.cprint(line, color="cyan", attrs=["dark"], end="")
|
||||
elif re.match(" +\(Run", line):
|
||||
termcolor.cprint(line, color="magenta", attrs=["bold"], end="")
|
||||
else:
|
||||
termcolor.cprint(line, color="white", attrs=["dark"], end="")
|
||||
|
||||
|
||||
for line in sys.stdin:
|
||||
if line == "\n":
|
||||
print_config()
|
||||
text = "COMPILED --"
|
||||
elif re.match("^[A-Z_]+[ ]+-- .*?\n", text):
|
||||
print_config()
|
||||
elif re.match("[a-z]+/[\d]+[ ]", text):
|
||||
print_prefix()
|
||||
print_text("blue")
|
||||
elif re.match("[ ]?[\d]+s", text):
|
||||
print_text("green")
|
||||
elif re.match(" ... ", text):
|
||||
print_text("white")
|
||||
elif re.match("\[not run\]", text):
|
||||
print_text("yellow", "bold")
|
||||
elif c == "\n":
|
||||
print_text("white", "bold")
|
||||
elif re.match("^[A-Z_]+[ ]+-- .*?\n", line):
|
||||
if match := re.match("(^PLATFORM(.*?)PREEMPT)(.*?\n)", line):
|
||||
add_config(match.group(1))
|
||||
line = f"COMPILED -- {match.group(3)}"
|
||||
add_config(line)
|
||||
elif match := re.match("(^[a-z]+/[\d]+[ | ]+)(.*?\n)", line):
|
||||
print_test(match)
|
||||
elif match := re.match("^ (.*?)\n", line):
|
||||
print_diff(line)
|
||||
else:
|
||||
#pass
|
||||
print(prefix, end="")
|
||||
print(line, end="")
|
||||
|
|
|
@ -2,22 +2,33 @@
|
|||
|
||||
zparseopts -D -K -server:=SERVER -opts:=OPTS -user:=USER \
|
||||
-export:=EXPORT -mountpoint:=MOUNTPOINT \
|
||||
-scratch:=SCRATCH -scratchmnt:=SCRATCHMNT
|
||||
-scratch:=SCRATCH -scratchmnt:=SCRATCHMNT \
|
||||
-proto:=PROTO -version:=VERSION
|
||||
|
||||
xdir=$(echo "nfsv${VERSION[-1]}${PROTO[-1]}" | sed 's/\.//' | sed 's/v40/v4/')
|
||||
|
||||
cd /home/${USER[-1]}/xfstests-dev
|
||||
export TEST_DEV=${SERVER[-1]}:${EXPORT[-1]}/${USER[-1]}/xfstests
|
||||
export TEST_DIR=${MOUNTPOINT[-1]}
|
||||
export SCRATCH_DEV=${SERVER[-1]}:${SCRATCH[-1]}/${USER[-1]}/xfstests
|
||||
export SCRATCH_MNT=${SCRATCHMNT[-1]}
|
||||
export NFS_MOUNT_OPTIONS="-o ${OPTS[-1]}"
|
||||
export TEST_DEV=${SERVER[-1]}:${EXPORT[-1]}/${USER[-1]}/$xdir
|
||||
export TEST_DIR=${MOUNTPOINT[-1]}/$xdir
|
||||
export SCRATCH_DEV=${SERVER[-1]}:${SCRATCH[-1]}/${USER[-1]}/$xdir
|
||||
export SCRATCH_MNT=${SCRATCHMNT[-1]}/$xdir
|
||||
export NFS_MOUNT_OPTIONS="-o proto=${PROTO[-1]},v${VERSION[-1]},${OPTS[-1]}"
|
||||
export RESULT_BASE=/home/${USER[-1]}/xfstests-dev/results/${PROTO[-1]}/${VERSION[-1]}
|
||||
|
||||
mkdir -p $TEST_DIR
|
||||
mkdir -p $SCRATCH_MNT
|
||||
[ -e local.config ] && rm -f local.config
|
||||
|
||||
echo "TIME -- $(date)"
|
||||
echo "TEST_DEV -- $TEST_DEV"
|
||||
echo "TEST_DIR -- $TEST_DIR"
|
||||
echo "SCRATCH_DEV -- $SCRATCH_DEV"
|
||||
echo "SCRATCH_MNT -- $SCRATCH_MNT"
|
||||
echo "MOUNT_OPTIONS -- ${OPTS[-1]}"
|
||||
echo "MOUNT_OPTIONS -- $NFS_MOUNT_OPTIONS"
|
||||
|
||||
if [ ! -z "$*" ]; then
|
||||
echo "XFSTESTS_ARGS -- $*"
|
||||
fi
|
||||
./check -nfs $*
|
||||
|
||||
#./check -nfs -r -R xunit $*
|
||||
./check -nfs -R xunit $*
|
||||
|
|
32
xfstests.zsh
32
xfstests.zsh
|
@ -21,7 +21,12 @@ zparseopts -D -K \
|
|||
BIN=$HOME/bin
|
||||
COLOR=$BIN/colors/xfstests.py
|
||||
RUN_XFSTESTS="sudo run-xfstests.zsh"
|
||||
OPTIONS="sec=sys"
|
||||
USER=$(whoami)
|
||||
TODAY=$(date +%Y/%m/%d)
|
||||
NOW=$(date +%H:%M:%S)
|
||||
REMOTE_RESULTS=xfstests-dev/results/
|
||||
RESULTS=$HOME/.local/share/xfstests/${SERVER[-1]}/$TODAY
|
||||
|
||||
#
|
||||
# Prepare to test
|
||||
|
@ -30,7 +35,7 @@ $BIN/vm.zsh boot ${CLIENT[-1]} ${SERVER[-1]}
|
|||
$BIN/install-scripts.zsh ${CLIENT[-1]}
|
||||
if [ ${#RDMA} -gt 0 ]; then
|
||||
PROTO+=(rdma)
|
||||
$BIN/rdma.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
|
||||
$BIN/rping.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
|
||||
fi
|
||||
|
||||
ssh ${CLIENT[-1]} "sudo setup-xfstests.zsh ${SERVER[-1]} ${EXPORT[-1]} ${MOUNTPOINT[-1]} \
|
||||
|
@ -42,22 +47,31 @@ for arg in $*; do
|
|||
testargs+=($(printf '%q' "$arg"))
|
||||
done
|
||||
|
||||
run_xfs_tests() {
|
||||
ssh ${CLIENT[-1]} "$RUN_XFSTESTS --server ${SERVER[-1]} \
|
||||
--export ${EXPORT[-1]} \
|
||||
--mountpoint ${MOUNTPOINT[-1]} \
|
||||
--scratch ${SCRATCH[-1]} \
|
||||
--scratchmnt ${SCRATCHMNT[-1]} \
|
||||
--proto $1 \
|
||||
--version $2 \
|
||||
--opts $OPTIONS \
|
||||
--user $USER $testargs" | python $COLOR $1 $2
|
||||
scp -q ${CLIENT[-1]}:$REMOTE_RESULTS/$1/$2/result.xml $RESULTS/$NOW-$1-$2.xml
|
||||
}
|
||||
|
||||
#
|
||||
# Run tests
|
||||
#
|
||||
mkdir -p $RESULTS
|
||||
for proto in $PROTO; do
|
||||
for vers in $VERSION; do
|
||||
case $vers in
|
||||
"-v" | "--version") continue ;;
|
||||
*) opts="$proto,vers=$vers" ;;
|
||||
esac
|
||||
|
||||
ssh ${CLIENT[-1]} "$RUN_XFSTESTS --server ${SERVER[-1]} \
|
||||
--export ${EXPORT[-1]} \
|
||||
--mountpoint ${MOUNTPOINT[-1]} \
|
||||
--scratch ${SCRATCH[-1]} \
|
||||
--scratchmnt ${SCRATCHMNT[-1]} \
|
||||
--opts $opts \
|
||||
--user $USER $testargs" | python -u $COLOR $proto $vers
|
||||
run_xfs_tests $proto $vers &
|
||||
done
|
||||
done
|
||||
|
||||
wait
|
||||
|
|
Loading…
Reference in New Issue