Skip to content

Commit

Permalink
simtest: Add non regression test for sa2 shell script
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 Sep 29, 2019
1 parent 4a443bb commit d39edaa
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 4 deletions.
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=. conf_file=sysstat.sysconfig sa_dir=tests && make && make simtest
script: ./configure CFLAGS="-D DEBUG -D TEST" sa_lib_dir=. sar_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make && make simtest
4 changes: 2 additions & 2 deletions do_test
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
if [ "$1" = "conf" ]
then
make distclean
./configure sa_lib_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make CFLAGS="-D DEBUG -D TEST"
./configure sa_lib_dir=. sar_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make CFLAGS="-D DEBUG -D TEST"
elif [ "$1" = "comp" ]
then
make CFLAGS="-D DEBUG -D TEST"
else
make distclean
./configure sa_lib_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make CFLAGS="-D DEBUG -D TEST" && make simtest
./configure sa_lib_dir=. sar_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make CFLAGS="-D DEBUG -D TEST" && make simtest
fi
9 changes: 9 additions & 0 deletions tests/00220
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TZ=GMT
DATE=`date --date=yesterday +%d`
if [ ${DATE} -ne 18 ]
then
rm -f tests/sa${DATE}
mv tests/sa18 tests/sa${DATE}
fi
echo sa2: File is sa${DATE}
LC_ALL=C TZ=GMT ./sa2 -A && mv tests/sar${DATE} tests/out.sa2.tmp
1 change: 1 addition & 0 deletions tests/00225
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
diff -u tests/out.sa2.tmp tests/expected.sa2
4 changes: 3 additions & 1 deletion tests/TLIST
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ NOTES:

===== sar: Playing with sa1 and sa2 shell scripts
00200 ./sa1 --boot; ./sa1 --unix_time=1555593629 1 1; ./sa1 --unix_time=1555593649 1 1
00205 LC_ALL=C TZ=GMT ./sar -f tests/sa01 > tests/out.sa1.tmp
00205 LC_ALL=C TZ=GMT ./sar -f tests/sa18 > tests/out.sa1.tmp
00208 diff -u tests/out.sa1.tmp tests/expected.sa1
00220 LC_ALL=C TZ=GMT ./sa2 -A && mv tests/sar${DATE} tests/out.sa2.tmp
00225 diff -u tests/out.sa2.tmp tests/expected.sa2

===== Checking JSON output validity
00300 ./sadf -j tests/data.tmp -C -- -A | $VER_JSON >/dev/null && ./sadf -j tests/data.tmp | $VER_JSON >/dev/null && ./sadf -t -j tests/data.tmp | $VER_JSON >/dev/null
Expand Down
119 changes: 119 additions & 0 deletions tests/expected.sa2
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Linux 1.2.3-TEST (SYSSTAT.TEST) 04/18/19 _x86_64_ (8 CPU)

13:20:09 LINUX RESTART (8 CPU)

13:20:29 CPU %usr %nice %sys %iowait %steal %irq %soft %guest %gnice %idle
13:20:49 all 2.28 0.00 1.55 0.50 0.00 0.19 0.19 0.00 0.00 95.29
13:20:49 0 1.25 0.00 1.51 0.35 0.00 0.19 0.58 0.00 0.00 96.12
13:20:49 1 2.15 0.00 0.96 0.77 0.00 0.10 0.16 0.00 0.00 95.87
13:20:49 2 3.27 0.00 1.73 0.77 0.00 0.22 0.10 0.00 0.00 93.90
13:20:49 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
13:20:49 4 3.44 0.00 2.16 0.84 0.00 0.32 0.16 0.00 0.00 93.08
13:20:49 5 2.76 0.00 2.08 0.16 0.00 0.19 0.10 0.00 0.00 94.71
13:20:49 7 0.83 0.00 0.83 0.10 0.00 0.10 0.06 0.00 0.00 98.08
Average: all 2.28 0.00 1.55 0.50 0.00 0.19 0.19 0.00 0.00 95.29
Average: 0 1.25 0.00 1.51 0.35 0.00 0.19 0.58 0.00 0.00 96.12
Average: 1 2.15 0.00 0.96 0.77 0.00 0.10 0.16 0.00 0.00 95.87
Average: 2 3.27 0.00 1.73 0.77 0.00 0.22 0.10 0.00 0.00 93.90
Average: 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
Average: 4 3.44 0.00 2.16 0.84 0.00 0.32 0.16 0.00 0.00 93.08
Average: 5 2.76 0.00 2.08 0.16 0.00 0.19 0.10 0.00 0.00 94.71
Average: 6 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
Average: 7 0.83 0.00 0.83 0.10 0.00 0.10 0.06 0.00 0.00 98.08

13:20:29 proc/s cswch/s
13:20:49 4.83 46287.74
Average: 4.83 46287.74

13:20:29 pswpin/s pswpout/s
13:20:49 0.00 0.00
Average: 0.00 0.00

13:20:29 pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s %vmeff
13:20:49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 tps rtps wtps dtps bread/s bwrtn/s bdscd/s
13:20:49 5.44 2.24 3.20 0.00 0.00 3.20 0.00
Average: 5.44 2.24 3.20 0.00 0.00 3.20 0.00

13:20:29 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty kbanonpg kbslab kbkstack kbpgtbl kbvmused
13:20:49 1437740 4389516 3179712 39.04 260172 2821596 12097852 48.54 4042384 1772396 396 2733164 445740 15328 73760 0
Average: 1437740 4389516 3179712 39.04 260172 2821596 12097852 48.54 4042384 1772396 396 2733164 445740 15328 73760 0

13:20:29 kbswpfree kbswpused %swpused kbswpcad %swpcad
13:20:49 16777212 0 0.00 0 0.00
Average: 16777212 0 0.00 0 0.00

13:20:29 kbhugfree kbhugused %hugused kbhugrsvd kbhugsurp
13:20:49 0 0 0.00 0 0
Average: 0 0 0.00 0 0

13:20:29 dentunusd file-nr inode-nr pty-nr
13:20:49 156063 16704 157735 4
Average: 156063 16704 157735 4

13:20:29 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
13:20:49 3 956 3.16 3.24 3.43 0
Average: 3 956 3.16 3.24 3.43 0

13:20:29 TTY rcvin/s txmtin/s framerr/s prtyerr/s brk/s ovrun/s
13:20:49 0 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 1 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0 0.00 0.00 0.00 0.00 0.00 0.00
Average: 1 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
13:20:49 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 virbr0-nic 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 enp6s0 53.55 17.45 64.37 3.38 0.00 0.00 9.25 0.05
13:20:49 virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 wlp5s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: virbr0-nic 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: enp6s0 53.55 17.45 64.37 3.38 0.00 0.00 9.25 0.05
Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: wlp5s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
13:20:49 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 virbr0-nic 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 enp6s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
13:20:49 wlp5s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: virbr0-nic 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: enp6s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: wlp5s0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 call/s retrans/s read/s write/s access/s getatt/s
13:20:49 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 scall/s badcall/s packet/s udp/s tcp/s hit/s miss/s sread/s swrite/s saccess/s sgetatt/s
13:20:49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

13:20:29 totsck tcpsck udpsck rawsck ip-frag tcp-tw
13:20:49 1316 10 6 0 0 1
Average: 1316 10 6 0 0 1

13:20:29 CPU total/s dropd/s squeezd/s rx_rps/s flw_lim/s
13:20:49 all 0.00 0.00 0.00 0.00 0.00
13:20:49 0 0.00 0.00 0.00 0.00 0.00
13:20:49 1 0.00 0.00 0.00 0.00 0.00
13:20:49 2 0.00 0.00 0.00 0.00 0.00
13:20:49 3 0.00 0.00 0.00 0.00 0.00
13:20:49 4 0.00 0.00 0.00 0.00 0.00
13:20:49 5 0.00 0.00 0.00 0.00 0.00
13:20:49 7 0.00 0.00 0.00 0.00 0.00
Average: all 0.00 0.00 0.00 0.00 0.00
Average: 0 0.00 0.00 0.00 0.00 0.00
Average: 1 0.00 0.00 0.00 0.00 0.00
Average: 2 0.00 0.00 0.00 0.00 0.00
Average: 3 0.00 0.00 0.00 0.00 0.00
Average: 4 0.00 0.00 0.00 0.00 0.00
Average: 5 0.00 0.00 0.00 0.00 0.00
Average: 6 0.00 0.00 0.00 0.00 0.00
Average: 7 0.00 0.00 0.00 0.00 0.00

0 comments on commit d39edaa

Please sign in to comment.