1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0+
3#
4# Check the status of the specified run.
5#
6# Usage: kvm-end-run-stats.sh /path/to/run starttime
7#
8# Copyright (C) 2021 Facebook, Inc.
9#
10# Authors: Paul E. McKenney <paulmck@kernel.org>
11
12# scriptname=$0
13# args="$*"
14rundir="$1"
15if ! test -d "$rundir"
16then
17	echo kvm-end-run-stats.sh: Specified run directory does not exist: $rundir
18	exit 1
19fi
20
21T=${TMPDIR-/tmp}/kvm-end-run-stats.sh.$$
22trap 'rm -rf $T' 0
23mkdir $T
24
25KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
26PATH=${KVM}/bin:$PATH; export PATH
27. functions.sh
28default_starttime="`get_starttime`"
29starttime="${2-default_starttime}"
30
31echo | tee -a "$rundir/log"
32echo | tee -a "$rundir/log"
33echo " --- `date` Test summary:" | tee -a "$rundir/log"
34echo Results directory: $rundir | tee -a "$rundir/log"
35kcsan-collapse.sh "$rundir" | tee -a "$rundir/log"
36kvm-recheck.sh "$rundir" > $T/kvm-recheck.sh.out 2>&1
37ret=$?
38cat $T/kvm-recheck.sh.out | tee -a "$rundir/log"
39echo " --- Done at `date` (`get_starttime_duration $starttime`) exitcode $ret" | tee -a "$rundir/log"
40exit $ret
41