Compare commits

...

9 Commits

Author SHA1 Message Date
Anna Schumaker b02e2ee03d kernel-tag.zsh: Add script to determine if a commit is tagged
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 14:00:46 -05:00
Anna Schumaker 9b07caada6 setup-testdirs.zsh: Empty directories before running tests
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 14:00:00 -05:00
Anna Schumaker 1e0ce00c8e report-xfstests.py: Normalize device and mount paths
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 13:59:15 -05:00
Anna Schumaker 39f8c14668 report-xfstests.py: Do a case-insensitive sort on not-run reasons
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 13:58:40 -05:00
Anna Schumaker f61184fccb run-xfstest.zsh: Remove xml file of previous run before starting
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 13:57:59 -05:00
Anna Schumaker ee6e9c3cf8 report-xfstests.py: Read compressed results
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 13:57:35 -05:00
Anna Schumaker 9bb097aae4 xfstests.zsh: Compress results to save disk space
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-16 13:56:23 -05:00
Anna Schumaker c0883fd99e xfstests.zsh: Add an --nconnect= option
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-10 09:45:59 -05:00
Anna Schumaker 088f2eead1 report-xfstests: Select a row in the [notrun] page to search
This is useful for figuring out exactly which tests weren't run for a
given reason.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2022-02-09 12:22:18 -05:00
9 changed files with 113 additions and 49 deletions

View File

@ -7,6 +7,7 @@ function _xfstests.zsh() {
"domains\:domains\:($(virsh list --all --name))"' \
{-k,--scratch}'[the exported scratch directory on the server]: : _files -/' \
{-p,--mountpoint}'[the directory to mount the server]: : _files -/' \
--nconnect'[number of connections]: :($(seq 1 32))' \
{-r,--rdma}'[test using rdma]: :(rxe siw)' \
{-q,--scratchmnt}'[the directory to mount the scratch export]: : _files -/' \
{-s,--server}'[the server to test against]: : _alternative

23
kernel-tag.zsh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/zsh
# Note: Set CONFIG_LOCALVERSION with
# REV=$(git rev-parse --short HEAD)$(git diff --quiet || echo "-dirty")
# scripts/config --set-str CONFIG_LOCALVERSION "-g$REV"
SOURCE=/home/anna/Programs/linux-nfs.git/
if [ "$#" -ne 1 ]; then
echo "Usage: $0 {remote host}"
fi
vm.zsh boot $1
uname=$(ssh $1 uname -r)
config=$(ssh $1 zcat /proc/config.gz | grep -E "# Linux(.*?)Kernel Configuration$" | awk '{print $3}')
last=$(echo $uname | awk -F- '{print $NF}')
# Check for a distro kernel
if [ "$uname" = "$config-1" ]; then
echo "v$config"
elif [ "${last[0,1]}" = "g" ]; then
cd $SOURCE && git describe --exact-match "${last:1}" 2>/dev/null || exit 0
fi

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
import re
from . import common
from . import testchooser
from . import testproperties
@ -30,18 +31,25 @@ class TestViewer(Gtk.Box):
def __init__(self):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.stack = testproperties.Stack()
self.viewer = testviewer.Viewer()
self.switcher = Gtk.StackSwitcher(stack=self.stack, halign=Gtk.Align.CENTER)
self.viewer = testviewer.Viewer()
self.search = testviewer.SearchEntry(self.viewer.get_filter())
self.append(self.switcher)
self.append(self.stack)
self.append(self.viewer)
self.append(testviewer.SearchEntry(self.viewer.get_filter()))
self.append(self.search)
SizeGroup.add_widget(self.switcher)
self.stack.connect("notrun-selected", self.notrun_selected)
def set_test_result(self, file):
current = self.stack.clear()
self.viewer.clear()
if file and file.get_is_test_result():
if file and file.is_file():
results = testresults.TestResults(file.path)
self.stack.show_properties(results, current)
self.viewer.show_results(results)
def notrun_selected(self, stack, item):
self.search.set_text(re.escape(item.message))

View File

@ -10,13 +10,14 @@ class Path(GObject.GObject):
def __init__(self, path):
GObject.GObject.__init__(self)
self.path = path
self.is_file = self.path.is_file
def __lt__(self, rhs): return self.path < rhs.path
def get_is_test_result(self):
return False not in [ f.is_file() for f in self.path.iterdir() ]
def get_name(self): return self.path.name
def get_name(self):
name = self.path.name
return name.split(".")[0] if self.is_file() else name
def get_model(self):
if not self.get_is_test_result():
if self.path.is_dir():
return DirectoryModel(self.path)
@ -73,7 +74,7 @@ class DirectoryWindow(Gtk.ScrolledWindow):
expander = listitem.get_child()
expander.set_list_row(treerow)
expander.get_child().set_text(filepath.get_name())
listitem.set_selectable(filepath.get_is_test_result())
listitem.set_selectable(filepath.is_file())
def on_unbind(self, factory, listitem):
expander = listitem.get_child()

View File

@ -20,7 +20,7 @@ class NotRun(GObject.GObject):
self.message = message
def __lt__(self, rhs):
return self.message < rhs.message
return self.message.upper() < rhs.message.upper()
class Results(Property):
@ -115,7 +115,7 @@ class View(Gtk.ColumnView):
class NotRunView(Gtk.ListView):
def __init__(self, notrun):
self.selection = Gtk.NoSelection.new(NotRunModel(notrun))
self.selection = Gtk.SingleSelection(autoselect=False, model=NotRunModel(notrun))
Gtk.ListView.__init__(self, model=self.selection, factory=NotRunFactory())
self.add_css_class("data-table")
@ -145,3 +145,10 @@ class Stack(Gtk.Stack):
self.add_titled(window, name, name)
if current == name:
self.set_visible_child(window)
child.selection.connect("selection-changed", self.selection_changed)
def selection_changed(self, selection, position, n_items):
self.emit("notrun-selected", selection.get_selected_item())
@GObject.Signal(arg_types=(NotRun,))
def notrun_selected(self, notrun): pass

View File

@ -2,6 +2,8 @@
from gi.repository import GObject
from gi.repository import Gtk
import html
import pathlib
import tarfile
import xml.etree.ElementTree
class PassingTest:
@ -16,9 +18,13 @@ class PassingTest:
class SkippedTest:
def __init__(self, elm):
def __init__(self, elm, test_dev, test_dir, scratch_dev, scratch_mnt):
self.time = elm.attrib["time"]
self.message = elm[0].attrib["message"]
self.message = self.message.replace(test_dev, "$TEST_DEV")
self.message = self.message.replace(test_dir, "$TEST_DIR")
self.message = self.message.replace(scratch_dev, "$SCRATCH_DEV")
self.message = self.message.replace(scratch_mnt, "$SCRATCH_MNT")
class FailedTest:
@ -44,39 +50,47 @@ class TestCase(GObject.GObject):
class TestResults:
def __init__(self, testdir):
def __init__(self, testtar):
self.versions = [ ]
self.tests = dict()
self.properties = dict()
self.skipped = set()
for file in sorted(testdir.iterdir()):
self.versions.append(file.stem)
passed = 0
with tarfile.open(testtar, "r:*") as tf:
for member in [ m for m in tf.getmembers() if m.isfile() ]:
self.read_file(member.name, tf.extractfile(member))
self.versions.sort()
root = xml.etree.ElementTree.parse(file).getroot()
for prop in root.attrib.keys():
self.set_property(prop, file.stem, root.attrib[prop])
def read_file(self, name, file):
root = xml.etree.ElementTree.parse(file).getroot()
self.versions.append(pathlib.Path(name).stem)
passed = 0
for elm in root:
if elm.tag == "properties":
for prop in elm:
self.set_property(prop.attrib["name"], file.stem,
prop.attrib["value"])
elif elm.tag == "testcase":
if len(elm) == 0:
result = PassingTest(elm)
passed += 1
elif elm[0].tag == "skipped":
result = SkippedTest(elm)
self.skipped.add(result.message)
elif elm[0].tag == "failure":
result = FailedTest(elm)
self.add_testcase(elm.attrib["name"], file.stem, result)
self.set_property("passed", file.stem, str(passed))
for prop in root.attrib.keys():
self.set_property(prop, root.attrib[prop])
def set_property(self, name, vers, value):
self.properties.setdefault(vers, dict())[name.upper()] = value
for elm in root:
if elm.tag == "properties":
for prop in elm:
self.set_property(prop.attrib["name"], prop.attrib["value"])
elif elm.tag == "testcase":
if len(elm) == 0:
result = PassingTest(elm)
passed += 1
elif elm[0].tag == "skipped":
result = SkippedTest(elm,
self.properties[self.versions[-1]]["TEST_DEV"],
self.properties[self.versions[-1]]["TEST_DIR"],
self.properties[self.versions[-1]]["SCRATCH_DEV"],
self.properties[self.versions[-1]]["SCRATCH_MNT"])
self.skipped.add(result.message)
elif elm[0].tag == "failure":
result = FailedTest(elm)
self.add_testcase(elm.attrib["name"], result)
self.set_property("passed", str(passed))
def add_testcase(self, name, vers, result):
self.tests.setdefault(name, TestCase(name))[vers] = result
def set_property(self, name, value):
self.properties.setdefault(self.versions[-1], dict())[name.upper()] = value
def add_testcase(self, name, result):
self.tests.setdefault(name, TestCase(name))[self.versions[-1]] = result

View File

@ -18,6 +18,7 @@ export RESULT_BASE=/home/${USER[-1]}/xfstests-dev/results/${PROTO[-1]}/${VERSION
mkdir -p $TEST_DIR
mkdir -p $SCRATCH_MNT
[ -e local.config ] && rm -f local.config
[ -e $RESULT_BASE/result.xml ] && rm -f $RESULT_BASE/result.xml
echo "TIME -- $(date)"
echo "TEST_DEV -- $TEST_DEV"

View File

@ -10,15 +10,17 @@ if [ "$#" -lt 4 ]; then
fi
mkdir -p $MOUNTPOINT
TRAPEXIT() {
umount $MOUNTPOINT
}
mount -o sec=sys $SERVER:$EXPORT $MOUNTPOINT
for proto in tcp rdma; do
for vers in 3 4 41 42; do
mkdir -p -m 777 $MOUNTPOINT/$USER/nfsv$vers$proto
dir=$MOUNTPOINT/$USER/nfsv$vers$proto
if [ ! -d $dir ]; then
mkdir -p -m 777 $dir
elif [ "$(ls -A $dir)" ]; then
rm -rf $dir/* || true
fi
done
done
umount -f $MOUNTPOINT

View File

@ -11,6 +11,7 @@ PROTO=(tcp)
zparseopts -D -K \
c:=CLIENT -client:=CLIENT \
k:=SCRATCH -scratch:=SCRATCH \
-nconnect:=NCONNECT \
p:=MOUNTPOINT -mountpoint:=MOUNTPOINT \
q:=SCRATCHMNT -scratchmnt:=SCRATCHMNT \
r:=RDMA -rdma:=RDMA \
@ -28,7 +29,8 @@ DATE=$(date +%Y-%m-%d-%H:%M:%S%z)
TODAY=$(date +%Y/%m/%d)
NOW=$(date +%H:%M:%S%z)
REMOTE_RESULTS=xfstests-dev/results/
RESULTS=$RESULT_BASE/date/$TODAY/${SERVER[-1]}/$NOW
RESULTS=$RESULT_BASE/date/$TODAY/${SERVER[-1]}/
TMP_RESULTS=/tmp/xfstests/${SERVER[-1]}/$NOW
TAG=$(kernel-tag.zsh ${CLIENT[-1]})
if [ ! -z $TAG ]; then
TAGRES=$RESULT_BASE/tags/$TAG/${SERVER[-1]}
@ -43,6 +45,9 @@ if [ ${#RDMA} -gt 0 ]; then
PROTO+=(rdma)
$BIN/rping.zsh ${RDMA[-1]} ${CLIENT[-1]} ${SERVER[-1]}
fi
if [ ${#NCONNECT} -gt 0 ]; then
OPTIONS="$OPTIONS,nconnect=${NCONNECT[-1]}"
fi
ssh ${CLIENT[-1]} "sudo setup-xfstests.zsh ${SERVER[-1]} ${EXPORT[-1]} ${MOUNTPOINT[-1]} \
${SCRATCH[-1]} ${SCRATCHMNT[-1]} $USER"
@ -63,13 +68,13 @@ run_xfs_tests() {
--version $2 \
--opts $OPTIONS \
--user $USER $testargs" | python $COLOR $1 $2
mkdir -p $RESULTS
scp -q ${CLIENT[-1]}:$REMOTE_RESULTS/$1/$2/result.xml $RESULTS/$1-$2.xml
scp -q ${CLIENT[-1]}:$REMOTE_RESULTS/$1/$2/result.xml $TMP_RESULTS/$1-$2.xml
}
#
# Run tests
#
mkdir -p $TMP_RESULTS
for proto in $PROTO; do
for vers in $VERSION; do
case $vers in
@ -82,8 +87,10 @@ done
wait
mkdir -p $RESULTS
tar -cJf $RESULTS/$NOW.tar.xz -C $(dirname $TMP_RESULTS) $NOW/
if [ ! -z "$TAG" ]; then
mkdir -p $TAGRES
ln -s $RESULTS $TAGRES/$DATE
ln $RESULTS/$NOW.tar.xz $TAGRES/$DATE.tar.xz
fi
optirun report-xfstests.py $RESULTS
optirun report-xfstests.py $RESULTS/$NOW.tar.xz & disown