summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/mtree/BSD.tests.dist10
-rw-r--r--tools/regression/usr.bin/Makefile3
-rw-r--r--tools/regression/usr.bin/lastcomm/Makefile6
-rwxr-xr-xtools/regression/usr.bin/lastcomm/regress.t41
-rw-r--r--tools/regression/usr.sbin/Makefile5
-rw-r--r--tools/regression/usr.sbin/newsyslog/Makefile4
-rwxr-xr-xtools/regression/usr.sbin/newsyslog/regress.t6
-rw-r--r--tools/regression/usr.sbin/sa/Makefile6
-rwxr-xr-xtools/regression/usr.sbin/sa/regress.t81
-rw-r--r--usr.bin/lastcomm/Makefile6
-rw-r--r--usr.bin/lastcomm/tests/Makefile21
-rw-r--r--usr.bin/lastcomm/tests/README (renamed from tools/regression/usr.bin/lastcomm/README)0
-rw-r--r--usr.bin/lastcomm/tests/legacy_test.sh38
-rw-r--r--usr.bin/lastcomm/tests/v1-amd64-acct.in (renamed from tools/regression/usr.bin/lastcomm/v1-amd64-acct.in)bin1568 -> 1568 bytes
-rw-r--r--usr.bin/lastcomm/tests/v1-amd64.out (renamed from tools/regression/usr.bin/lastcomm/v1-amd64.out)0
-rw-r--r--usr.bin/lastcomm/tests/v1-i386-acct.in (renamed from tools/regression/usr.bin/lastcomm/v1-i386-acct.in)bin1344 -> 1344 bytes
-rw-r--r--usr.bin/lastcomm/tests/v1-i386.out (renamed from tools/regression/usr.bin/lastcomm/v1-i386.out)0
-rw-r--r--usr.bin/lastcomm/tests/v1-sparc64-acct.in (renamed from tools/regression/usr.bin/lastcomm/v1-sparc64-acct.in)bin1568 -> 1568 bytes
-rw-r--r--usr.bin/lastcomm/tests/v1-sparc64.out (renamed from tools/regression/usr.bin/lastcomm/v1-sparc64.out)0
-rw-r--r--usr.bin/lastcomm/tests/v2-amd64-acct.in (renamed from tools/regression/usr.bin/lastcomm/v2-amd64-acct.in)bin2016 -> 2016 bytes
-rw-r--r--usr.bin/lastcomm/tests/v2-amd64.out (renamed from tools/regression/usr.bin/lastcomm/v2-amd64.out)0
-rw-r--r--usr.bin/lastcomm/tests/v2-i386-acct.in (renamed from tools/regression/usr.bin/lastcomm/v2-i386-acct.in)bin1792 -> 1792 bytes
-rw-r--r--usr.bin/lastcomm/tests/v2-i386.out (renamed from tools/regression/usr.bin/lastcomm/v2-i386.out)0
-rw-r--r--usr.bin/lastcomm/tests/v2-sparc64-acct.in (renamed from tools/regression/usr.bin/lastcomm/v2-sparc64-acct.in)bin2592 -> 2592 bytes
-rw-r--r--usr.bin/lastcomm/tests/v2-sparc64.out (renamed from tools/regression/usr.bin/lastcomm/v2-sparc64.out)0
-rwxr-xr-x[-rw-r--r--]usr.bin/lastcomm/tests/values.sh (renamed from tools/regression/usr.bin/lastcomm/values.sh)1
-rw-r--r--usr.sbin/Makefile4
-rw-r--r--usr.sbin/etcupdate/Makefile6
-rw-r--r--usr.sbin/etcupdate/tests/Makefile17
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/always_test.sh (renamed from tools/regression/usr.sbin/etcupdate/always.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/conflicts_test.sh (renamed from tools/regression/usr.sbin/etcupdate/conflicts.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/fbsdid_test.sh (renamed from tools/regression/usr.sbin/etcupdate/fbsdid.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/ignore_test.sh (renamed from tools/regression/usr.sbin/etcupdate/ignore.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/preworld_test.sh (renamed from tools/regression/usr.sbin/etcupdate/preworld.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/tests_test.sh (renamed from tools/regression/usr.sbin/etcupdate/tests.sh)0
-rw-r--r--[-rwxr-xr-x]usr.sbin/etcupdate/tests/tzsetup_test.sh (renamed from tools/regression/usr.sbin/etcupdate/tzsetup.sh)0
-rw-r--r--usr.sbin/newsyslog/Makefile6
-rw-r--r--usr.sbin/newsyslog/tests/Makefile7
-rw-r--r--[-rwxr-xr-x]usr.sbin/newsyslog/tests/legacy_test.sh (renamed from tools/regression/usr.sbin/newsyslog/regress.sh)2
-rw-r--r--usr.sbin/sa/Makefile6
-rw-r--r--usr.sbin/sa/tests/Makefile33
-rw-r--r--usr.sbin/sa/tests/legacy_test.sh78
-rwxr-xr-x[-rw-r--r--]usr.sbin/sa/tests/prime.sh (renamed from tools/regression/usr.sbin/sa/prime.sh)2
-rw-r--r--usr.sbin/sa/tests/v1-amd64-sav.in (renamed from tools/regression/usr.sbin/sa/v1-amd64-sav.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v1-amd64-sav.out (renamed from tools/regression/usr.sbin/sa/v1-amd64-sav.out)0
-rw-r--r--usr.sbin/sa/tests/v1-amd64-u.out (renamed from tools/regression/usr.sbin/sa/v1-amd64-u.out)0
-rw-r--r--usr.sbin/sa/tests/v1-amd64-usr.in (renamed from tools/regression/usr.sbin/sa/v1-amd64-usr.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v1-amd64-usr.out (renamed from tools/regression/usr.sbin/sa/v1-amd64-usr.out)0
-rw-r--r--usr.sbin/sa/tests/v1-i386-sav.in (renamed from tools/regression/usr.sbin/sa/v1-i386-sav.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v1-i386-sav.out (renamed from tools/regression/usr.sbin/sa/v1-i386-sav.out)0
-rw-r--r--usr.sbin/sa/tests/v1-i386-u.out (renamed from tools/regression/usr.sbin/sa/v1-i386-u.out)0
-rw-r--r--usr.sbin/sa/tests/v1-i386-usr.in (renamed from tools/regression/usr.sbin/sa/v1-i386-usr.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v1-i386-usr.out (renamed from tools/regression/usr.sbin/sa/v1-i386-usr.out)0
-rw-r--r--usr.sbin/sa/tests/v1-sparc64-sav.in (renamed from tools/regression/usr.sbin/sa/v1-sparc64-sav.in)bin16384 -> 16384 bytes
-rw-r--r--usr.sbin/sa/tests/v1-sparc64-sav.out (renamed from tools/regression/usr.sbin/sa/v1-sparc64-sav.out)0
-rw-r--r--usr.sbin/sa/tests/v1-sparc64-u.out (renamed from tools/regression/usr.sbin/sa/v1-sparc64-u.out)0
-rw-r--r--usr.sbin/sa/tests/v1-sparc64-usr.in (renamed from tools/regression/usr.sbin/sa/v1-sparc64-usr.in)bin16384 -> 16384 bytes
-rw-r--r--usr.sbin/sa/tests/v1-sparc64-usr.out (renamed from tools/regression/usr.sbin/sa/v1-sparc64-usr.out)0
-rw-r--r--usr.sbin/sa/tests/v2-amd64-sav.in (renamed from tools/regression/usr.sbin/sa/v2-amd64-sav.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v2-amd64-u.out (renamed from tools/regression/usr.sbin/sa/v2-amd64-u.out)0
-rw-r--r--usr.sbin/sa/tests/v2-amd64-usr.in (renamed from tools/regression/usr.sbin/sa/v2-amd64-usr.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v2-i386-sav.in (renamed from tools/regression/usr.sbin/sa/v2-i386-sav.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v2-i386-u.out (renamed from tools/regression/usr.sbin/sa/v2-i386-u.out)0
-rw-r--r--usr.sbin/sa/tests/v2-i386-usr.in (renamed from tools/regression/usr.sbin/sa/v2-i386-usr.in)bin8192 -> 8192 bytes
-rw-r--r--usr.sbin/sa/tests/v2-sparc64-sav.in (renamed from tools/regression/usr.sbin/sa/v2-sparc64-sav.in)bin16384 -> 16384 bytes
-rw-r--r--usr.sbin/sa/tests/v2-sparc64-u.out (renamed from tools/regression/usr.sbin/sa/v2-sparc64-u.out)0
-rw-r--r--usr.sbin/sa/tests/v2-sparc64-usr.in (renamed from tools/regression/usr.sbin/sa/v2-sparc64-usr.in)bin16384 -> 16384 bytes
-rw-r--r--usr.sbin/tests/Makefile10
68 files changed, 246 insertions, 153 deletions
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index da64e34..6bfbb9d 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -95,6 +95,16 @@
atf-sh
..
..
+ lastcomm
+ ..
+ ..
+ usr.sbin
+ etcupdate
+ ..
+ newsyslog
+ ..
+ sa
+ ..
..
..
..
diff --git a/tools/regression/usr.bin/Makefile b/tools/regression/usr.bin/Makefile
index 7538f23..2365e3a 100644
--- a/tools/regression/usr.bin/Makefile
+++ b/tools/regression/usr.bin/Makefile
@@ -2,8 +2,5 @@
SUBDIR= apply calendar comm file2c join jot m4 ncal printf sed tr \
uudecode uuencode xargs
-.if !defined(AUTOMATED)
-SUBDIR+= lastcomm
-.endif
.include <bsd.subdir.mk>
diff --git a/tools/regression/usr.bin/lastcomm/Makefile b/tools/regression/usr.bin/lastcomm/Makefile
deleted file mode 100644
index 930f3ff..0000000
--- a/tools/regression/usr.bin/lastcomm/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-all: regress
-
-regress: regress.t
- ./regress.t
diff --git a/tools/regression/usr.bin/lastcomm/regress.t b/tools/regression/usr.bin/lastcomm/regress.t
deleted file mode 100755
index d733dbc..0000000
--- a/tools/regression/usr.bin/lastcomm/regress.t
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-DIR=`dirname $0`
-ARCH=`uname -m`
-
-TZ=UTC; export TZ
-
-check()
-{
- NUM=$1
- shift
- # Remove tty field, which varies between systems.
- awk '{$4 = ""; print}' |
- if diff -q - $DIR/$1
- then
- echo "ok $NUM"
- else
- echo "not ok $NUM"
- fi
-}
-
-
-cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >$DIR/v1v2-$ARCH-acct.in
-cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >$DIR/v1v2-$ARCH.out
-
-echo 1..6
-
-lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 v1-$ARCH.out
-lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 v1-$ARCH.out
-lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 v2-$ARCH.out
-lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 v2-$ARCH.out
-lastcomm -cesuS -f $DIR/v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out
-lastcomm -cesuS -f - <$DIR/v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out
-
-rm $DIR/v1v2-$ARCH-acct.in
-rm $DIR/v1v2-$ARCH.out
-
-exit 0
diff --git a/tools/regression/usr.sbin/Makefile b/tools/regression/usr.sbin/Makefile
deleted file mode 100644
index 071100b..0000000
--- a/tools/regression/usr.sbin/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= newsyslog sa
-
-.include <bsd.subdir.mk>
diff --git a/tools/regression/usr.sbin/newsyslog/Makefile b/tools/regression/usr.sbin/newsyslog/Makefile
deleted file mode 100644
index 2c9ca59..0000000
--- a/tools/regression/usr.sbin/newsyslog/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-all:
- sh regress.sh
diff --git a/tools/regression/usr.sbin/newsyslog/regress.t b/tools/regression/usr.sbin/newsyslog/regress.t
deleted file mode 100755
index c36d834..0000000
--- a/tools/regression/usr.sbin/newsyslog/regress.t
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-cd `dirname $0`
-
-sh regress.sh
diff --git a/tools/regression/usr.sbin/sa/Makefile b/tools/regression/usr.sbin/sa/Makefile
deleted file mode 100644
index 930f3ff..0000000
--- a/tools/regression/usr.sbin/sa/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-all: regress
-
-regress: regress.t
- ./regress.t
diff --git a/tools/regression/usr.sbin/sa/regress.t b/tools/regression/usr.sbin/sa/regress.t
deleted file mode 100755
index d28536a..0000000
--- a/tools/regression/usr.sbin/sa/regress.t
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-DIR=`dirname $0`
-LCDIR=`dirname $0`/../../usr.bin/lastcomm
-ARCH=`uname -m`
-
-collapse_whitespace()
-{
- sed -E 's,[ ]+, ,g'
-}
-
-check()
-{
- NUM=$1
- shift
- collapse_whitespace | \
- if diff -q - $1
- then
- echo "ok $NUM"
- else
- echo "not ok $NUM"
- fi
-}
-
-cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in
-cp $LCDIR/v2-$ARCH-acct.in $DIR/v2-$ARCH-acct.in
-
-echo 1..13
-
-# Command listings of the two acct versions
-sa -u $DIR/v1-$ARCH-acct.in | check 1 $DIR/v1-$ARCH-u.out
-sa -u $DIR/v2-$ARCH-acct.in | check 2 $DIR/v2-$ARCH-u.out
-
-# Plain summaries of user/process
-sa -i $DIR/v1-$ARCH-acct.in | check 3 $DIR/v1-$ARCH-sav.out
-sa -im $DIR/v1-$ARCH-acct.in | check 4 $DIR/v1-$ARCH-usr.out
-
-# Backward compatibility of v1 summary files
-sa -P $DIR/v1-$ARCH-sav.in -U $DIR/v1-$ARCH-usr.in /dev/null |
- check 5 $DIR/v1-$ARCH-sav.out
-sa -m -P $DIR/v1-$ARCH-sav.in -U $DIR/v1-$ARCH-usr.in /dev/null |
- check 6 $DIR/v1-$ARCH-usr.out
-
-# Convert old summary format to new
-cp $DIR/v1-$ARCH-sav.in $DIR/v2c-$ARCH-sav.in
-cp $DIR/v1-$ARCH-usr.in $DIR/v2c-$ARCH-usr.in
-sa -s -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in /dev/null >/dev/null
-sa -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in /dev/null |
- check 7 $DIR/v1-$ARCH-sav.out
-sa -m -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in /dev/null |
- check 8 $DIR/v1-$ARCH-usr.out
-
-# Reading v2 summary files
-sa -P $DIR/v2-$ARCH-sav.in -U $DIR/v2-$ARCH-usr.in /dev/null |
- check 9 $DIR/v1-$ARCH-sav.out
-sa -m -P $DIR/v2-$ARCH-sav.in -U $DIR/v2-$ARCH-usr.in /dev/null |
- check 10 $DIR/v1-$ARCH-usr.out
-
-# Summarize
-sa -is -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in >/dev/null
-sa -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in /dev/null |
- check 11 $DIR/v1-$ARCH-sav.out
-sa -m -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in /dev/null |
- check 12 $DIR/v1-$ARCH-usr.out
-
-# Accumulate
-cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in
-sa -is -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in >/dev/null
-cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in
-sa -s -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in \
- | collapse_whitespace >$DIR/double
-cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in
-sa -i $DIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in | check 13 $DIR/double
-
-# Clean up
-rm $DIR/double $DIR/v2c-$ARCH-usr.in $DIR/v2c-$ARCH-sav.in $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in
-
-exit 0
diff --git a/usr.bin/lastcomm/Makefile b/usr.bin/lastcomm/Makefile
index 84708d9..8825375 100644
--- a/usr.bin/lastcomm/Makefile
+++ b/usr.bin/lastcomm/Makefile
@@ -1,7 +1,13 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= lastcomm
SRCS= lastcomm.c readrec.c
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/lastcomm/tests/Makefile b/usr.bin/lastcomm/tests/Makefile
new file mode 100644
index 0000000..b0fac0e
--- /dev/null
+++ b/usr.bin/lastcomm/tests/Makefile
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.bin/lastcomm
+
+TAP_TESTS_SH= legacy_test
+
+FILESDIR= ${TESTSDIR}
+FILES= v1-amd64-acct.in
+FILES+= v1-amd64.out
+FILES+= v1-i386-acct.in
+FILES+= v1-i386.out
+FILES+= v1-sparc64-acct.in
+FILES+= v1-sparc64.out
+FILES+= v2-amd64-acct.in
+FILES+= v2-amd64.out
+FILES+= v2-i386-acct.in
+FILES+= v2-i386.out
+FILES+= v2-sparc64-acct.in
+FILES+= v2-sparc64.out
+
+.include <bsd.test.mk>
diff --git a/tools/regression/usr.bin/lastcomm/README b/usr.bin/lastcomm/tests/README
index 62e0281..62e0281 100644
--- a/tools/regression/usr.bin/lastcomm/README
+++ b/usr.bin/lastcomm/tests/README
diff --git a/usr.bin/lastcomm/tests/legacy_test.sh b/usr.bin/lastcomm/tests/legacy_test.sh
new file mode 100644
index 0000000..35ef78b
--- /dev/null
+++ b/usr.bin/lastcomm/tests/legacy_test.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+DIR=`dirname $0`
+ARCH=`uname -m`
+
+TZ=UTC; export TZ
+
+check()
+{
+ NUM=$1
+ shift
+ # Remove tty field, which varies between systems.
+ awk '{$4 = ""; print}' |
+ if diff -q - $1
+ then
+ echo "ok $NUM"
+ else
+ echo "not ok $NUM"
+ fi
+}
+
+
+cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >v1v2-$ARCH-acct.in
+cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >v1v2-$ARCH.out
+
+echo 1..6
+
+lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 $DIR/v1-$ARCH.out
+lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 $DIR/v1-$ARCH.out
+lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 $DIR/v2-$ARCH.out
+lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 $DIR/v2-$ARCH.out
+lastcomm -cesuS -f v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out
+lastcomm -cesuS -f - <v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out
+
+exit 0
diff --git a/tools/regression/usr.bin/lastcomm/v1-amd64-acct.in b/usr.bin/lastcomm/tests/v1-amd64-acct.in
index 50546a3..50546a3 100644
--- a/tools/regression/usr.bin/lastcomm/v1-amd64-acct.in
+++ b/usr.bin/lastcomm/tests/v1-amd64-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v1-amd64.out b/usr.bin/lastcomm/tests/v1-amd64.out
index bacbd57..bacbd57 100644
--- a/tools/regression/usr.bin/lastcomm/v1-amd64.out
+++ b/usr.bin/lastcomm/tests/v1-amd64.out
diff --git a/tools/regression/usr.bin/lastcomm/v1-i386-acct.in b/usr.bin/lastcomm/tests/v1-i386-acct.in
index f427c0e..f427c0e 100644
--- a/tools/regression/usr.bin/lastcomm/v1-i386-acct.in
+++ b/usr.bin/lastcomm/tests/v1-i386-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v1-i386.out b/usr.bin/lastcomm/tests/v1-i386.out
index 86ec9e2..86ec9e2 100644
--- a/tools/regression/usr.bin/lastcomm/v1-i386.out
+++ b/usr.bin/lastcomm/tests/v1-i386.out
diff --git a/tools/regression/usr.bin/lastcomm/v1-sparc64-acct.in b/usr.bin/lastcomm/tests/v1-sparc64-acct.in
index 00f05b4..00f05b4 100644
--- a/tools/regression/usr.bin/lastcomm/v1-sparc64-acct.in
+++ b/usr.bin/lastcomm/tests/v1-sparc64-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v1-sparc64.out b/usr.bin/lastcomm/tests/v1-sparc64.out
index d33ae71..d33ae71 100644
--- a/tools/regression/usr.bin/lastcomm/v1-sparc64.out
+++ b/usr.bin/lastcomm/tests/v1-sparc64.out
diff --git a/tools/regression/usr.bin/lastcomm/v2-amd64-acct.in b/usr.bin/lastcomm/tests/v2-amd64-acct.in
index ca7bcaa..ca7bcaa 100644
--- a/tools/regression/usr.bin/lastcomm/v2-amd64-acct.in
+++ b/usr.bin/lastcomm/tests/v2-amd64-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v2-amd64.out b/usr.bin/lastcomm/tests/v2-amd64.out
index 3942b04..3942b04 100644
--- a/tools/regression/usr.bin/lastcomm/v2-amd64.out
+++ b/usr.bin/lastcomm/tests/v2-amd64.out
diff --git a/tools/regression/usr.bin/lastcomm/v2-i386-acct.in b/usr.bin/lastcomm/tests/v2-i386-acct.in
index 4cdd973..4cdd973 100644
--- a/tools/regression/usr.bin/lastcomm/v2-i386-acct.in
+++ b/usr.bin/lastcomm/tests/v2-i386-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v2-i386.out b/usr.bin/lastcomm/tests/v2-i386.out
index 61bc811..61bc811 100644
--- a/tools/regression/usr.bin/lastcomm/v2-i386.out
+++ b/usr.bin/lastcomm/tests/v2-i386.out
diff --git a/tools/regression/usr.bin/lastcomm/v2-sparc64-acct.in b/usr.bin/lastcomm/tests/v2-sparc64-acct.in
index 26df19e..26df19e 100644
--- a/tools/regression/usr.bin/lastcomm/v2-sparc64-acct.in
+++ b/usr.bin/lastcomm/tests/v2-sparc64-acct.in
Binary files differ
diff --git a/tools/regression/usr.bin/lastcomm/v2-sparc64.out b/usr.bin/lastcomm/tests/v2-sparc64.out
index f693e8e..f693e8e 100644
--- a/tools/regression/usr.bin/lastcomm/v2-sparc64.out
+++ b/usr.bin/lastcomm/tests/v2-sparc64.out
diff --git a/tools/regression/usr.bin/lastcomm/values.sh b/usr.bin/lastcomm/tests/values.sh
index 6c20954..ab27f62 100644..100755
--- a/tools/regression/usr.bin/lastcomm/values.sh
+++ b/usr.bin/lastcomm/tests/values.sh
@@ -6,6 +6,7 @@
ACCT=acct
RESULTS=acct.`uname -m`.tar.gz
TMPDIR=$$.tmp
+TZ=UTC; export TZ
run()
{
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 61d91b9..b709be5 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -284,6 +284,10 @@ SUBDIR+= praliases
SUBDIR+= sendmail
.endif
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.if ${MK_TOOLCHAIN} != "no"
SUBDIR+= config
SUBDIR+= crunch
diff --git a/usr.sbin/etcupdate/Makefile b/usr.sbin/etcupdate/Makefile
index 9f6d17e..765533a 100644
--- a/usr.sbin/etcupdate/Makefile
+++ b/usr.sbin/etcupdate/Makefile
@@ -1,6 +1,12 @@
# $FreeBSD$
+.include <bsd.own.mk>
+
SCRIPTS=etcupdate.sh
MAN= etcupdate.8
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/etcupdate/tests/Makefile b/usr.sbin/etcupdate/tests/Makefile
new file mode 100644
index 0000000..da83397
--- /dev/null
+++ b/usr.sbin/etcupdate/tests/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.sbin/etcupdate
+
+PLAIN_TESTS_SH=
+.for test in always_test \
+ conflicts_test \
+ fbsdid_test \
+ ignore_test \
+ preworld_test \
+ tests_test \
+ tzsetup_test
+PLAIN_TESTS_SH+= ${test}
+TEST_METADATA.${test}+= required_user="root"
+.endfor
+
+.include <bsd.test.mk>
diff --git a/tools/regression/usr.sbin/etcupdate/always.sh b/usr.sbin/etcupdate/tests/always_test.sh
index 514481e..514481e 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/always.sh
+++ b/usr.sbin/etcupdate/tests/always_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/conflicts.sh b/usr.sbin/etcupdate/tests/conflicts_test.sh
index 816c180..816c180 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/conflicts.sh
+++ b/usr.sbin/etcupdate/tests/conflicts_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/fbsdid.sh b/usr.sbin/etcupdate/tests/fbsdid_test.sh
index c062c06..c062c06 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/fbsdid.sh
+++ b/usr.sbin/etcupdate/tests/fbsdid_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/ignore.sh b/usr.sbin/etcupdate/tests/ignore_test.sh
index 2d3d2f5..2d3d2f5 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/ignore.sh
+++ b/usr.sbin/etcupdate/tests/ignore_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/preworld.sh b/usr.sbin/etcupdate/tests/preworld_test.sh
index c731293..c731293 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/preworld.sh
+++ b/usr.sbin/etcupdate/tests/preworld_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/tests.sh b/usr.sbin/etcupdate/tests/tests_test.sh
index b99bbef..b99bbef 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/tests.sh
+++ b/usr.sbin/etcupdate/tests/tests_test.sh
diff --git a/tools/regression/usr.sbin/etcupdate/tzsetup.sh b/usr.sbin/etcupdate/tests/tzsetup_test.sh
index b102938..b102938 100755..100644
--- a/tools/regression/usr.sbin/etcupdate/tzsetup.sh
+++ b/usr.sbin/etcupdate/tests/tzsetup_test.sh
diff --git a/usr.sbin/newsyslog/Makefile b/usr.sbin/newsyslog/Makefile
index ebc297b..4e3ae55 100644
--- a/usr.sbin/newsyslog/Makefile
+++ b/usr.sbin/newsyslog/Makefile
@@ -1,7 +1,13 @@
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= newsyslog
MAN= newsyslog.8 newsyslog.conf.5
SRCS= newsyslog.c ptimes.c
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/newsyslog/tests/Makefile b/usr.sbin/newsyslog/tests/Makefile
new file mode 100644
index 0000000..f8ad273
--- /dev/null
+++ b/usr.sbin/newsyslog/tests/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.sbin/newsyslog
+
+TAP_TESTS_SH= legacy_test
+
+.include <bsd.test.mk>
diff --git a/tools/regression/usr.sbin/newsyslog/regress.sh b/usr.sbin/newsyslog/tests/legacy_test.sh
index 70c4240..ba10f2c 100755..100644
--- a/tools/regression/usr.sbin/newsyslog/regress.sh
+++ b/usr.sbin/newsyslog/tests/legacy_test.sh
@@ -3,7 +3,7 @@
# $FreeBSD$
COUNT=0
-TMPDIR=`mktemp -d -t regress_newsyslog`
+TMPDIR=$(pwd)/work
if [ $? -ne 0 ]; then
echo "$0: Can't create temp dir, exiting..."
exit 1
diff --git a/usr.sbin/sa/Makefile b/usr.sbin/sa/Makefile
index 0adf1f8..23f9bf2 100644
--- a/usr.sbin/sa/Makefile
+++ b/usr.sbin/sa/Makefile
@@ -1,9 +1,15 @@
# $FreeBSD$
+.include <bsd.own.mk>
+
.PATH: ${.CURDIR}/../../usr.bin/lastcomm
PROG= sa
MAN= sa.8
SRCS= main.c db.c pdb.c usrdb.c readrec.c
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/sa/tests/Makefile b/usr.sbin/sa/tests/Makefile
new file mode 100644
index 0000000..204b510
--- /dev/null
+++ b/usr.sbin/sa/tests/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.sbin/sa
+
+TAP_TESTS_SH= legacy_test
+
+FILESDIR= ${TESTSDIR}
+FILES= v1-amd64-sav.in
+FILES+= v1-amd64-sav.out
+FILES+= v1-amd64-u.out
+FILES+= v1-amd64-usr.in
+FILES+= v1-amd64-usr.out
+FILES+= v1-i386-sav.in
+FILES+= v1-i386-sav.out
+FILES+= v1-i386-u.out
+FILES+= v1-i386-usr.in
+FILES+= v1-i386-usr.out
+FILES+= v1-sparc64-sav.in
+FILES+= v1-sparc64-sav.out
+FILES+= v1-sparc64-u.out
+FILES+= v1-sparc64-usr.in
+FILES+= v1-sparc64-usr.out
+FILES+= v2-amd64-sav.in
+FILES+= v2-amd64-u.out
+FILES+= v2-amd64-usr.in
+FILES+= v2-i386-sav.in
+FILES+= v2-i386-u.out
+FILES+= v2-i386-usr.in
+FILES+= v2-sparc64-sav.in
+FILES+= v2-sparc64-u.out
+FILES+= v2-sparc64-usr.in
+
+.include <bsd.test.mk>
diff --git a/usr.sbin/sa/tests/legacy_test.sh b/usr.sbin/sa/tests/legacy_test.sh
new file mode 100644
index 0000000..d0d8f42
--- /dev/null
+++ b/usr.sbin/sa/tests/legacy_test.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+DIR=`dirname $0`
+LCDIR=`dirname $0`/../../usr.bin/lastcomm
+ARCH=`uname -m`
+
+collapse_whitespace()
+{
+ sed -E 's,[ ]+, ,g'
+}
+
+check()
+{
+ NUM=$1
+ shift
+ collapse_whitespace | \
+ if diff -q - $1
+ then
+ echo "ok $NUM"
+ else
+ echo "not ok $NUM"
+ fi
+}
+
+install -c -m 644 $LCDIR/v1-$ARCH-acct.in v1-$ARCH-acct.in
+install -c -m 644 $LCDIR/v2-$ARCH-acct.in v2-$ARCH-acct.in
+
+echo 1..13
+
+# Command listings of the two acct versions
+sa -u v1-$ARCH-acct.in | check 1 $DIR/v1-$ARCH-u.out
+sa -u v2-$ARCH-acct.in | check 2 $DIR/v2-$ARCH-u.out
+
+# Plain summaries of user/process
+sa -i v1-$ARCH-acct.in | check 3 $DIR/v1-$ARCH-sav.out
+sa -im v1-$ARCH-acct.in | check 4 $DIR/v1-$ARCH-usr.out
+
+# Backward compatibility of v1 summary files
+sa -P $DIR/v1-$ARCH-sav.in -U $DIR/v1-$ARCH-usr.in /dev/null |
+ check 5 $DIR/v1-$ARCH-sav.out
+sa -m -P $DIR/v1-$ARCH-sav.in -U $DIR/v1-$ARCH-usr.in /dev/null |
+ check 6 $DIR/v1-$ARCH-usr.out
+
+# Convert old summary format to new
+install -c -m 644 $DIR/v1-$ARCH-sav.in v2c-$ARCH-sav.in
+install -c -m 644 $DIR/v1-$ARCH-usr.in v2c-$ARCH-usr.in
+sa -s -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in /dev/null >/dev/null
+sa -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in /dev/null |
+ check 7 $DIR/v1-$ARCH-sav.out
+sa -m -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in /dev/null |
+ check 8 $DIR/v1-$ARCH-usr.out
+
+# Reading v2 summary files
+sa -P $DIR/v2-$ARCH-sav.in -U $DIR/v2-$ARCH-usr.in /dev/null |
+ check 9 $DIR/v1-$ARCH-sav.out
+sa -m -P $DIR/v2-$ARCH-sav.in -U $DIR/v2-$ARCH-usr.in /dev/null |
+ check 10 $DIR/v1-$ARCH-usr.out
+
+# Summarize
+sa -is -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in v1-$ARCH-acct.in >/dev/null
+sa -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in /dev/null |
+ check 11 $DIR/v1-$ARCH-sav.out
+sa -m -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in /dev/null |
+ check 12 $DIR/v1-$ARCH-usr.out
+
+# Accumulate
+install -c -m 644 $LCDIR/v1-$ARCH-acct.in v1-$ARCH-acct.in
+sa -is -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in v1-$ARCH-acct.in >/dev/null
+install -c -m 644 $LCDIR/v1-$ARCH-acct.in v1-$ARCH-acct.in
+sa -s -P v2c-$ARCH-sav.in -U v2c-$ARCH-usr.in v1-$ARCH-acct.in \
+ | collapse_whitespace >double
+cp $LCDIR/v1-$ARCH-acct.in v1-$ARCH-acct.in
+sa -i v1-$ARCH-acct.in v1-$ARCH-acct.in | check 13 double
+
+exit 0
diff --git a/tools/regression/usr.sbin/sa/prime.sh b/usr.sbin/sa/tests/prime.sh
index c3fec32..6992f45 100644..100755
--- a/tools/regression/usr.sbin/sa/prime.sh
+++ b/usr.sbin/sa/tests/prime.sh
@@ -6,6 +6,8 @@
# $FreeBSD$
#
+TZ=UTC; export TZ
+
# Set this to the path of the current sa command
SANEW=/usr/sbin/sa
diff --git a/tools/regression/usr.sbin/sa/v1-amd64-sav.in b/usr.sbin/sa/tests/v1-amd64-sav.in
index adc38dd..adc38dd 100644
--- a/tools/regression/usr.sbin/sa/v1-amd64-sav.in
+++ b/usr.sbin/sa/tests/v1-amd64-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-amd64-sav.out b/usr.sbin/sa/tests/v1-amd64-sav.out
index a2289ee..a2289ee 100644
--- a/tools/regression/usr.sbin/sa/v1-amd64-sav.out
+++ b/usr.sbin/sa/tests/v1-amd64-sav.out
diff --git a/tools/regression/usr.sbin/sa/v1-amd64-u.out b/usr.sbin/sa/tests/v1-amd64-u.out
index 4c13b76..4c13b76 100644
--- a/tools/regression/usr.sbin/sa/v1-amd64-u.out
+++ b/usr.sbin/sa/tests/v1-amd64-u.out
diff --git a/tools/regression/usr.sbin/sa/v1-amd64-usr.in b/usr.sbin/sa/tests/v1-amd64-usr.in
index 6896d32..6896d32 100644
--- a/tools/regression/usr.sbin/sa/v1-amd64-usr.in
+++ b/usr.sbin/sa/tests/v1-amd64-usr.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-amd64-usr.out b/usr.sbin/sa/tests/v1-amd64-usr.out
index 2282808..2282808 100644
--- a/tools/regression/usr.sbin/sa/v1-amd64-usr.out
+++ b/usr.sbin/sa/tests/v1-amd64-usr.out
diff --git a/tools/regression/usr.sbin/sa/v1-i386-sav.in b/usr.sbin/sa/tests/v1-i386-sav.in
index 4ed7aef..4ed7aef 100644
--- a/tools/regression/usr.sbin/sa/v1-i386-sav.in
+++ b/usr.sbin/sa/tests/v1-i386-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-i386-sav.out b/usr.sbin/sa/tests/v1-i386-sav.out
index a8d68b1..a8d68b1 100644
--- a/tools/regression/usr.sbin/sa/v1-i386-sav.out
+++ b/usr.sbin/sa/tests/v1-i386-sav.out
diff --git a/tools/regression/usr.sbin/sa/v1-i386-u.out b/usr.sbin/sa/tests/v1-i386-u.out
index 17c28be..17c28be 100644
--- a/tools/regression/usr.sbin/sa/v1-i386-u.out
+++ b/usr.sbin/sa/tests/v1-i386-u.out
diff --git a/tools/regression/usr.sbin/sa/v1-i386-usr.in b/usr.sbin/sa/tests/v1-i386-usr.in
index 791b6ed..791b6ed 100644
--- a/tools/regression/usr.sbin/sa/v1-i386-usr.in
+++ b/usr.sbin/sa/tests/v1-i386-usr.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-i386-usr.out b/usr.sbin/sa/tests/v1-i386-usr.out
index cf9e7bd..cf9e7bd 100644
--- a/tools/regression/usr.sbin/sa/v1-i386-usr.out
+++ b/usr.sbin/sa/tests/v1-i386-usr.out
diff --git a/tools/regression/usr.sbin/sa/v1-sparc64-sav.in b/usr.sbin/sa/tests/v1-sparc64-sav.in
index d6911cf..d6911cf 100644
--- a/tools/regression/usr.sbin/sa/v1-sparc64-sav.in
+++ b/usr.sbin/sa/tests/v1-sparc64-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-sparc64-sav.out b/usr.sbin/sa/tests/v1-sparc64-sav.out
index 1905420..1905420 100644
--- a/tools/regression/usr.sbin/sa/v1-sparc64-sav.out
+++ b/usr.sbin/sa/tests/v1-sparc64-sav.out
diff --git a/tools/regression/usr.sbin/sa/v1-sparc64-u.out b/usr.sbin/sa/tests/v1-sparc64-u.out
index d0ecb51..d0ecb51 100644
--- a/tools/regression/usr.sbin/sa/v1-sparc64-u.out
+++ b/usr.sbin/sa/tests/v1-sparc64-u.out
diff --git a/tools/regression/usr.sbin/sa/v1-sparc64-usr.in b/usr.sbin/sa/tests/v1-sparc64-usr.in
index 08d795b..08d795b 100644
--- a/tools/regression/usr.sbin/sa/v1-sparc64-usr.in
+++ b/usr.sbin/sa/tests/v1-sparc64-usr.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v1-sparc64-usr.out b/usr.sbin/sa/tests/v1-sparc64-usr.out
index cab001f..cab001f 100644
--- a/tools/regression/usr.sbin/sa/v1-sparc64-usr.out
+++ b/usr.sbin/sa/tests/v1-sparc64-usr.out
diff --git a/tools/regression/usr.sbin/sa/v2-amd64-sav.in b/usr.sbin/sa/tests/v2-amd64-sav.in
index 24f863b..24f863b 100644
--- a/tools/regression/usr.sbin/sa/v2-amd64-sav.in
+++ b/usr.sbin/sa/tests/v2-amd64-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v2-amd64-u.out b/usr.sbin/sa/tests/v2-amd64-u.out
index 4196f4a..4196f4a 100644
--- a/tools/regression/usr.sbin/sa/v2-amd64-u.out
+++ b/usr.sbin/sa/tests/v2-amd64-u.out
diff --git a/tools/regression/usr.sbin/sa/v2-amd64-usr.in b/usr.sbin/sa/tests/v2-amd64-usr.in
index 4c3b136..4c3b136 100644
--- a/tools/regression/usr.sbin/sa/v2-amd64-usr.in
+++ b/usr.sbin/sa/tests/v2-amd64-usr.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v2-i386-sav.in b/usr.sbin/sa/tests/v2-i386-sav.in
index d3172db..d3172db 100644
--- a/tools/regression/usr.sbin/sa/v2-i386-sav.in
+++ b/usr.sbin/sa/tests/v2-i386-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v2-i386-u.out b/usr.sbin/sa/tests/v2-i386-u.out
index b553eb8..b553eb8 100644
--- a/tools/regression/usr.sbin/sa/v2-i386-u.out
+++ b/usr.sbin/sa/tests/v2-i386-u.out
diff --git a/tools/regression/usr.sbin/sa/v2-i386-usr.in b/usr.sbin/sa/tests/v2-i386-usr.in
index 465fdb4..465fdb4 100644
--- a/tools/regression/usr.sbin/sa/v2-i386-usr.in
+++ b/usr.sbin/sa/tests/v2-i386-usr.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v2-sparc64-sav.in b/usr.sbin/sa/tests/v2-sparc64-sav.in
index b6d836a..b6d836a 100644
--- a/tools/regression/usr.sbin/sa/v2-sparc64-sav.in
+++ b/usr.sbin/sa/tests/v2-sparc64-sav.in
Binary files differ
diff --git a/tools/regression/usr.sbin/sa/v2-sparc64-u.out b/usr.sbin/sa/tests/v2-sparc64-u.out
index 9339238..9339238 100644
--- a/tools/regression/usr.sbin/sa/v2-sparc64-u.out
+++ b/usr.sbin/sa/tests/v2-sparc64-u.out
diff --git a/tools/regression/usr.sbin/sa/v2-sparc64-usr.in b/usr.sbin/sa/tests/v2-sparc64-usr.in
index 01a1bdc..01a1bdc 100644
--- a/tools/regression/usr.sbin/sa/v2-sparc64-usr.in
+++ b/usr.sbin/sa/tests/v2-sparc64-usr.in
Binary files differ
diff --git a/usr.sbin/tests/Makefile b/usr.sbin/tests/Makefile
new file mode 100644
index 0000000..a7e9c71
--- /dev/null
+++ b/usr.sbin/tests/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/usr.sbin
+
+.PATH: ${.CURDIR:H:H}/tests
+KYUAFILE= yes
+
+.include <bsd.test.mk>
OpenPOWER on IntegriCloud