forked from gson1703/anita
/
testsuite
95 lines (76 loc) · 3.05 KB
/
testsuite
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
#
# Anita test suite. This mainly tests that installation of historic
# NetBSD versions still works.
#
mkdir -p log
logfile=log/testsuite.log.`date +%Y%m%d-%H%M%S`
echo "logging to $logfile"
exec >$logfile 2>&1
python=python2.7
set -x -e
runtest() {
mode=$1
shift
workdir=`$python ./anita print-workdir "$@"`
rm -f $workdir/wd0.img
$python ./anita --structured-log $mode "$@"
rm -f $workdir/wd0.img
}
# Test a local hpcmips build, if available
# This does only an install because the boot stage doesn't work yet.
hpcmips_build=$(pwd)/test-data/local-builds/2017.07.01.06.14.51/hpcmips/
if test -d $hpcmips_build
then
runtest install $hpcmips_build
fi
# Test a local ARM build, if available
arm_build=$(pwd)/test-data/local-builds/2017.06.20.13.51.54/evbarm-earmv7hf/
if test -d $arm_build
then
runtest boot $arm_build
fi
# Test an installation with debug symbols and partial source
# With 32M of memory, we hit the "stalled" problem (PR 47030)
debug_build=$(pwd)/test-data/local-builds/2017.06.20.13.51.54/i386/
if test -d $debug_build
then
runtest "--memory-size=128M --disk-size=2G --sets=kern-GENERIC,etc,base,tests,games,misc,syssrc boot" $debug_build
fi
# Test a FTP URL, too
runtest install ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-2.1/i386/
runtest install http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-3.0.1/i386/
runtest boot http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-4.0/i386/
runtest boot http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-5.0.2/i386/
runtest boot http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-5.1.5/i386/
# These fail with "piixide0:0:0: lost interrupt" (tested with qemu 2.2.0)
# runtest boot http://ftp.fi.netbsd.org/pub/NetBSD/NetBSD-5.2/i386/
# runtest boot http://ftp.fi.netbsd.org/pub/NetBSD/NetBSD-5.2.3/i386/
runtest boot http://ftp.fi.netbsd.org/pub/NetBSD/NetBSD-6.0/amd64/
# Test CD boot, newest version
runtest "--boot-from cdrom boot" http://ftp.fi.netbsd.org/pub/NetBSD/NetBSD-7.1/amd64/
# Test anita 1.2 compatibility.
$python <<END
import anita
ver = anita.Release("7.0.1")
ver.install()
END
url=http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/iso/5.0.2/sparccd-5.0.2.iso
workdir=`$python ./anita print-workdir $url`
rm -f $workdir/wd0.img
$python ./anita --sets=kern-GENERIC,base,etc,games --run "/usr/games/factor 1234567" boot $url | tee stdout
grep "127 9721" stdout
rm -f stdout
url=http://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-5.1/i386/
workdir=`$python ./anita print-workdir $url`
rm -f $workdir/wd0.img
$python ./anita --sets=kern-GENERIC,etc,base,tests,games,misc test $url | tee stdout || true
# This is not to check that tests pass, but only that they at least run to completion
grep 'passed test cases' stdout
rm -f stdout
rm -f $workdir/wd0.img
# This panics with qemu 2.0.0, and fails due to the message
# "esp0: !TC on DATA XFER [intr 18, stat 82, step 4] prevphase 2, resid 0"
# being printed during set extraction with qemu 2.9.0.
#runtest boot http://ftp.fi.netbsd.org/pub/NetBSD/NetBSD-6.1.3/images/NetBSD-6.1.3-sparc.iso
echo "pass"