Skip to content

Commit

Permalink
simtest: Keep adding more non regression tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
  • Loading branch information
sysstat committed Apr 28, 2019
1 parent 5a0868e commit babae28
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ tests/01130
tests/01230
tests/rt00010
tests/rt00020
tests/sa01
tests/sa19700101
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
language: c
script: ./configure CFLAGS="-D DEBUG -D TEST" sa_lib_dir=. conf_dir=. && make && make simtest
script: ./configure CFLAGS="-D DEBUG -D TEST" sa_lib_dir=. conf_dir=. sa_dir=tests && make && make simtest
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ simtest: all
clean:
rm -f sadc sar sadf iostat tapestat mpstat pidstat cifsiostat *.o *.a core TAGS tests/*.tmp
rm -f nfsiostat* man/nfsiostat*
rm -f tests/sa01 tests/19700101
find nls -name "*.gmo" -exec rm -f {} \;

almost-distclean: clean nls/sysstat.pot
Expand Down
4 changes: 2 additions & 2 deletions do_test
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
if [ "$1" = "all" ] || [ "$1" = "simtest" ]
then
make distclean
./configure sa_lib_dir=. conf_dir=. && make CFLAGS="-D DEBUG -D TEST" && make simtest
./configure sa_lib_dir=. conf_dir=. sa_dir=tests && make CFLAGS="-D DEBUG -D TEST" && make simtest
fi
if [ "$1" = "all" ] || [ "$1" = "test" ]
then
make distclean
./configure sa_lib_dir=. && make CFLAGS="-D DEBUG" && make test
./configure sa_lib_dir=. conf_dir=. sa_dir=tests && make CFLAGS="-D DEBUG" && make test
fi
2 changes: 1 addition & 1 deletion systest.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "systest.h"

time_t __unix_time;
time_t __unix_time = 0;

/*
***************************************************************************
Expand Down
5 changes: 5 additions & 0 deletions tests/01300
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rm -f tests/sa01
echo foo >tests/sa01

./sadc 1 1 - 2>/dev/null || exit 0
exit 1
1 change: 1 addition & 0 deletions tests/01305
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./sadc -F 1 1 -
1 change: 1 addition & 0 deletions tests/01310
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LC_ALL=C TZ=GMT ./sar -f tests/sa01 > tests/out3.sar-u.tmp
1 change: 1 addition & 0 deletions tests/01312
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out3.sar-u.tmp tests/expected3.sar-u
1 change: 1 addition & 0 deletions tests/01314
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LC_ALL=C TZ=GMT ./sar > tests/out31.sar-u.tmp
1 change: 1 addition & 0 deletions tests/01316
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out31.sar-u.tmp tests/expected3.sar-u
2 changes: 2 additions & 0 deletions tests/01320
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rm -f tests/sa19700101
./sadc -D -
1 change: 1 addition & 0 deletions tests/01330
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LC_ALL=C TZ=GMT ./sar -f tests/sa19700101 > tests/out32.sar-u.tmp
1 change: 1 addition & 0 deletions tests/01332
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out32.sar-u.tmp tests/expected32.sar-u
1 change: 1 addition & 0 deletions tests/01335
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LC_ALL=C TZ=GMT ./sar > tests/out33.sar-u.tmp
1 change: 1 addition & 0 deletions tests/01337
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out33.sar-u.tmp tests/expected32.sar-u
1 change: 1 addition & 0 deletions tests/01340
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./sadf > tests/out3.sadf.tmp
1 change: 1 addition & 0 deletions tests/01342
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out3.sadf.tmp tests/expected3.sadf
15 changes: 15 additions & 0 deletions tests/TLIST
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,18 @@
01242 diff -u tests/out01.sadf-g.tmp tests/expected01.sadf-g
01250 ./sadf -H tests/data0.tmp > tests/out01.sadf-H.tmp
01252 diff -u tests/out01.sadf-H.tmp tests/expected01.sadf-H

===== Playing with standard activity datafiles
01300 echo foo >test/sa01 ; ./sadc 1 1 - 2>/dev/null || exit 0
01305 ./sadc -F 1 1 -
01310 LC_ALL=C TZ=GMT ./sar -f tests/sa01 > tests/out3.sar-u.tmp
01312 diff -u tests/out3.sar-u.tmp tests/expected3.sar-u
01314 LC_ALL=C TZ=GMT ./sar > tests/out31.sar-u.tmp
01316 diff -u tests/out31.sar-u.tmp tests/expected3.sar-u
01320 ./sadc -D -
01330 LC_ALL=C TZ=GMT ./sar -f tests/sa19700101 > tests/out32.sar-u.tmp
01332 diff -u tests/out32.sar-u.tmp tests/expected32.sar-u
01335 LC_ALL=C TZ=GMT ./sar > tests/out33.sar-u.tmp
01337 diff -u tests/out33.sar-u.tmp tests/expected32.sar-u
01340 ./sadf > tests/out3.sadf.tmp
01342 diff -u tests/out3.sadf.tmp tests/expected3.sadf
1 change: 1 addition & 0 deletions tests/expected3.sadf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SYSSTAT.TEST -1 1970-01-01 00:00:00 UTC LINUX-RESTART (8 CPU)
1 change: 1 addition & 0 deletions tests/expected3.sar-u
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Linux 1.2.3-TEST (SYSSTAT.TEST) 01/01/70 _x86_64_ (8 CPU)
3 changes: 3 additions & 0 deletions tests/expected32.sar-u
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Linux 1.2.3-TEST (SYSSTAT.TEST) 01/01/70 _x86_64_ (8 CPU)

00:00:00 LINUX RESTART (8 CPU)

0 comments on commit babae28

Please sign in to comment.