File: longrun

package info (click to toggle)
jigdo 0.7.3-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 3,140 kB
  • ctags: 3,262
  • sloc: cpp: 17,831; ansic: 3,959; sh: 1,251; makefile: 631; awk: 400
file content (40 lines) | stat: -rwxr-xr-x 997 bytes parent folder | download | duplicates (10)
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
#! /bin/bash -e

# Copyright 2001 Richard Atterer
# License: GPL version 2

# Run torture on a machine, possibly going through thousands of test
# cases. At regular intervals, send mail about progress and any failed
# cases.

first=0
last=1024
step=32
mailto="`whoami`"

tmp="/tmp/`whoami`"
trap "rm -rf $tmp" EXIT
mkdir -p "$tmp/ironmaiden"
if test -O "$tmp"; then true; else
    echo "Couldn't create $tmp"
    exit 1
fi
x=$first
cp "torture" "$tmp" \
|| cp "src/torture" "$tmp"\
|| cp "debug/src/torture" "$tmp"
cd "$tmp"

while test "$x" -lt "$last"; do
    y=$((x + step))
    nice ./torture $x $y
    if test "$(set `wc -l ironmaiden/report` && echo $1)" \
       -ne "$((step * 2 ))" \
       || egrep -q '^([^O]..|.[^K].|..[^ ])' "ironmaiden/report"; then
        mail -s "FAIL torture $x $y" "$mailto" <"ironmaiden/report"
        else
        mail -s "OK   torture $x $y" "$mailto" <"/dev/null"
    fi
    x=$y
done
mail -s "torture longrun $first $last finished" "$mailto" <"/dev/null"