xref: /linux/tools/testing/selftests/rcutorture/bin/kvm-end-run-stats.sh (revision 702648721db590b3425c31ade294000e18808345)
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="`mktemp -d ${TMPDIR-/tmp}/kvm-end-run-stats.sh.XXXXXX`"
22trap 'rm -rf $T' 0
23
24RCUTORTURE="`pwd`/tools/testing/selftests/rcutorture"; export RCUTORTURE
25PATH=${RCUTORTURE}/bin:$PATH; export PATH
26. functions.sh
27default_starttime="`get_starttime`"
28starttime="${2-default_starttime}"
29
30echo | tee -a "$rundir/log"
31echo | tee -a "$rundir/log"
32echo " --- `date` Test summary:" | tee -a "$rundir/log"
33echo Results directory: $rundir | tee -a "$rundir/log"
34kcsan-collapse.sh "$rundir" | tee -a "$rundir/log"
35kvm-recheck.sh "$rundir" > $T/kvm-recheck.sh.out 2>&1
36ret=$?
37cat $T/kvm-recheck.sh.out | tee -a "$rundir/log"
38echo " --- Done at `date` (`get_starttime_duration $starttime`) exitcode $ret" | tee -a "$rundir/log"
39exit $ret
40