[Midnightbsd-cvs] src [11509] trunk/usr.bin/lastcomm/tests: add tests
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jul 7 15:15:33 EDT 2018
Revision: 11509
http://svnweb.midnightbsd.org/src/?rev=11509
Author: laffer1
Date: 2018-07-07 15:15:32 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
add tests
Added Paths:
-----------
trunk/usr.bin/lastcomm/tests/v1-i386-acct.in
trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in
trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in
trunk/usr.bin/lastcomm/tests/v2-i386-acct.in
trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in
trunk/usr.bin/lastcomm/tests/values.sh
Property Changed:
----------------
trunk/usr.bin/lastcomm/tests/v1-amd64-acct.in
Index: trunk/usr.bin/lastcomm/tests/v1-amd64-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v1-amd64-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v1-amd64-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v1-amd64-acct.in
___________________________________________________________________
Modified: mnbsd:nokeywords
## -1 +1 ##
-Makefile
\ No newline at end of property
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/v1-i386-acct.in
===================================================================
(Binary files differ)
Index: trunk/usr.bin/lastcomm/tests/v1-i386-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v1-i386-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v1-i386-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v1-i386-acct.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in
===================================================================
(Binary files differ)
Index: trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v1-sparc64-acct.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in
===================================================================
(Binary files differ)
Index: trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v2-amd64-acct.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/v2-i386-acct.in
===================================================================
(Binary files differ)
Index: trunk/usr.bin/lastcomm/tests/v2-i386-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v2-i386-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v2-i386-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v2-i386-acct.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in
===================================================================
(Binary files differ)
Index: trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in
===================================================================
--- trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in 2018-07-07 18:34:05 UTC (rev 11508)
+++ trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in 2018-07-07 19:15:32 UTC (rev 11509)
Property changes on: trunk/usr.bin/lastcomm/tests/v2-sparc64-acct.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/usr.bin/lastcomm/tests/values.sh
===================================================================
--- trunk/usr.bin/lastcomm/tests/values.sh (rev 0)
+++ trunk/usr.bin/lastcomm/tests/values.sh 2018-07-07 19:15:32 UTC (rev 11509)
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# $FreeBSD: stable/10/usr.bin/lastcomm/tests/values.sh 263226 2014-03-16 04:09:22Z jmmv $
+# $MidnightBSD$
+
+ACCT=acct
+RESULTS=acct.`uname -m`.tar.gz
+TMPDIR=$$.tmp
+TZ=UTC; export TZ
+
+run()
+{
+ /usr/bin/time -l -o $1.time "$@"
+}
+
+if [ `whoami` != "root" ]; then
+ echo "You need to be root to run this test."
+ exit 1
+fi
+
+echo Redirecting accounting.
+
+mkdir $TMPDIR
+cd $TMPDIR
+
+:>$ACCT
+accton $ACCT
+
+echo Running commands. This should not take more than 30s.
+
+# User time
+run awk 'BEGIN {for (i = 0; i < 1000000; i++) cos(.3)}' /dev/null
+run egrep '(.)(.)(.)(.)(.)(.)(.)(.)(.)\9\8\7\6\5\4\3\2\1' /usr/share/dict/words
+
+# System time
+run find /usr/src -name xyzzy
+
+# Elapsed time
+run sleep 3
+
+# IO
+run dd if=/dev/zero bs=512 count=4096 of=zero 2>/dev/null
+
+# Memory
+run diff /usr/share/dict/words /dev/null >/dev/null
+
+# AC_COMM_LEN - 1
+ln /usr/bin/true 123456789012345
+run ./123456789012345
+
+# AC_COMM_LEN
+ln /usr/bin/true 1234567890123456
+run ./1234567890123456
+
+# AC_COMM_LEN + 1
+ln /usr/bin/true 12345678901234567
+run ./12345678901234567
+
+# Flags: core, fork, signal
+echo 'main(){volatile int s; fork(); s = *(int *)0;}' >core.c
+cc -o core core.c
+echo Generating segmentation fault.
+./core
+
+echo Turning off redirected accounting.
+
+accton
+
+echo Packing the results.
+
+sa -u $ACCT >sa.u
+lastcomm -cesuS -f $ACCT >lastcomm.cesuS
+tar -cf - acct sa.u lastcomm.cesuS *.time |
+gzip -c |
+uuencode $RESULTS >../$RESULTS.uue
+
+echo Cleaning up.
+cd ..
+rm -rf $TMPDIR
+
+echo "Done! Please send your reply, enclosing the file $RESULTS.uue"
+echo If your system runs with accounting enabled you probably need to run:
+echo accton /var/account/acct
Property changes on: trunk/usr.bin/lastcomm/tests/values.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list