Test sa1 shell script.
Also look for FIXME tags in code.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
language: c
-script: ./configure CFLAGS="-D DEBUG -D TEST" sa_lib_dir=. conf_dir=. sa_dir=tests && make && make simtest
+script: ./configure CFLAGS="-D DEBUG -D TEST" sa_lib_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make && make simtest
if [ "$1" = "conf" ]
then
make distclean
- ./configure sa_lib_dir=. conf_dir=. sa_dir=tests && make CFLAGS="-D DEBUG -D TEST"
+ ./configure sa_lib_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=. sa_dir=tests && make CFLAGS="-D DEBUG -D TEST" && make simtest
+ ./configure sa_lib_dir=. conf_dir=. conf_file=sysstat.sysconfig sa_dir=tests && make CFLAGS="-D DEBUG -D TEST" && make simtest
fi
--- /dev/null
+grep -i FIXME *.c *.h *.in && exit 1 || exit 0
--- /dev/null
+rm -f tests/sa18
+
+rm -f tests/root
+ln -s root1 tests/root
+./sa1 --boot --unix_time=1555593609
+
+rm -f tests/root
+ln -s root2 tests/root
+./sa1 --unix_time=1555593629 1 1
+
+rm -f tests/root
+ln -s root3 tests/root
+./sa1 --unix_time=1555593649 1 1
--- /dev/null
+LC_ALL=C TZ=GMT ./sar -f tests/sa18 > tests/out.sa1.tmp
--- /dev/null
+diff -u tests/out.sa1.tmp tests/expected.sa1
+rm -f tests/root
+ln -s root1 tests/root
. tests/variables
if [ ! -z "$VER_JSON" ]; then
./mpstat -A -o JSON | $VER_JSON >/dev/null;
00015 ./pidstat -V >/dev/null
00016 ./tapestat -V >/dev/null
00017 ./cifsiostat -V >/dev/null
+00050 grep -i FIXME *.c *.h *.in && exit 1 || exit 0
===== Creating data.tmp
00100 5 x ./sadc --unix_time=XXXXXXXXX -S XALL,-A_PWR_FAN,-A_PWR_IN,-A_PWR_TEMP,-A_PWR_FREQ tests/data.tmp 1 1 >/dev/null
00164 diff -u tests/out2.sar-u.tmp tests/expected2.sar-u
00166 diff -u tests/out2.sar-all.tmp tests/expected2.sar-all
+===== 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
+00208 diff -u tests/out.sa1.tmp tests/expected.sa1
+
===== 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
00310 ./mpstat -A -o JSON | $VER_JSON >/dev/null
--- /dev/null
+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 %user %nice %system %iowait %steal %idle
+13:20:49 all 2.28 0.00 1.93 0.50 0.00 95.29
+Average: all 2.28 0.00 1.93 0.50 0.00 95.29