Commit d14afb2a authored by Julio Merino's avatar Julio Merino
Browse files

Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.

This change was originally going to only migrate the usr.sbin tests but, as
it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/
so it's better to just also migrate the latter at the same time.  The other
usr.bin tests will be moved separately.

To make these tests work within the test suite, some of them have required
changes to prevent modifying the source directory and instead just rely on
the current directory for file manipulation.
parent e93e4134
......@@ -95,6 +95,16 @@
atf-sh
..
..
lastcomm
..
..
usr.sbin
etcupdate
..
newsyslog
..
sa
..
..
..
..
......@@ -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>
# $FreeBSD$
all: regress
regress: regress.t
./regress.t
# $FreeBSD$
SUBDIR= newsyslog sa
.include <bsd.subdir.mk>
#!/bin/sh
# $FreeBSD$
cd `dirname $0`
sh regress.sh
# $FreeBSD$
all: regress
regress: regress.t
./regress.t
# 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>
# $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>
......@@ -14,7 +14,7 @@ check()
shift
# Remove tty field, which varies between systems.
awk '{$4 = ""; print}' |
if diff -q - $DIR/$1
if diff -q - $1
then
echo "ok $NUM"
else
......@@ -23,19 +23,16 @@ check()
}
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
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 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
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment