xref: /openbmc/linux/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh (revision 4f727ecefefbd180de10e25b3e74c03dce3f1e75)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0+
3#
4# Given the results directories for previous KVM-based torture runs,
5# check the build and console output for errors.  Given a directory
6# containing results directories, this recursively checks them all.
7#
8# Usage: kvm-recheck.sh resdir ...
9#
10# Copyright (C) IBM Corporation, 2011
11#
12# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
13
14PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
15. functions.sh
16for rd in "$@"
17do
18	firsttime=1
19	dirs=`find $rd -name Make.defconfig.out -print | sort | sed -e 's,/[^/]*$,,' | sort -u`
20	for i in $dirs
21	do
22		if test -n "$firsttime"
23		then
24			firsttime=""
25			resdir=`echo $i | sed -e 's,/$,,' -e 's,/[^/]*$,,'`
26			head -1 $resdir/log
27		fi
28		TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
29		rm -f $i/console.log.*.diags
30		kvm-recheck-${TORTURE_SUITE}.sh $i
31		if test -f "$i/console.log"
32		then
33			configcheck.sh $i/.config $i/ConfigFragment
34			if test -r $i/Make.oldconfig.err
35			then
36				cat $i/Make.oldconfig.err
37			fi
38			parse-build.sh $i/Make.out $configfile
39			parse-console.sh $i/console.log $configfile
40			if test -r $i/Warnings
41			then
42				cat $i/Warnings
43			fi
44		else
45			if test -f "$i/qemu-cmd"
46			then
47				print_bug qemu failed
48				echo "   $i"
49			elif test -f "$i/buildonly"
50			then
51				echo Build-only run, no boot/test
52				configcheck.sh $i/.config $i/ConfigFragment
53				parse-build.sh $i/Make.out $configfile
54			else
55				print_bug Build failed
56				echo "   $i"
57			fi
58		fi
59	done
60done
61