]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/usr.bin/lastcomm/values.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / usr.bin / lastcomm / values.sh
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 ACCT=acct
7 RESULTS=acct.`uname -m`.tar.gz
8 TMPDIR=$$.tmp
9
10 run()
11 {
12         /usr/bin/time -l -o $1.time "$@"
13 }
14
15 if [ `whoami` != "root" ]; then
16         echo "You need to be root to run this test."
17         exit 1
18 fi
19
20 echo Redirecting accounting.
21
22 mkdir $TMPDIR
23 cd $TMPDIR
24
25 :>$ACCT
26 accton $ACCT
27
28 echo Running commands. This should not take more than 30s.
29
30 # User time
31 run awk 'BEGIN {for (i = 0; i < 1000000; i++) cos(.3)}' /dev/null
32 run egrep '(.)(.)(.)(.)(.)(.)(.)(.)(.)\9\8\7\6\5\4\3\2\1' /usr/share/dict/words
33
34 # System time
35 run find /usr/src -name xyzzy
36
37 # Elapsed time
38 run sleep 3
39
40 # IO
41 run dd if=/dev/zero bs=512 count=4096 of=zero 2>/dev/null
42
43 # Memory
44 run diff /usr/share/dict/words /dev/null >/dev/null
45
46 # AC_COMM_LEN - 1
47 ln /usr/bin/true 123456789012345
48 run ./123456789012345
49
50 # AC_COMM_LEN
51 ln /usr/bin/true 1234567890123456
52 run ./1234567890123456
53
54 # AC_COMM_LEN + 1
55 ln /usr/bin/true 12345678901234567
56 run ./12345678901234567
57
58 # Flags: core, fork, signal
59 echo 'main(){volatile int s; fork(); s = *(int *)0;}' >core.c
60 cc -o core core.c
61 echo Generating segmentation fault.
62 ./core
63
64 echo Turning off redirected accounting.
65
66 accton
67
68 echo Packing the results.
69
70 sa -u $ACCT >sa.u
71 lastcomm -cesuS -f $ACCT >lastcomm.cesuS
72 tar -cf - acct sa.u lastcomm.cesuS *.time |
73 gzip -c |
74 uuencode $RESULTS >../$RESULTS.uue
75
76 echo Cleaning up.
77 cd ..
78 rm -rf $TMPDIR
79
80 echo "Done!  Please send your reply, enclosing the file $RESULTS.uue"
81 echo If your system runs with accounting enabled you probably need to run:
82 echo accton /var/account/acct