From: Sebastien GODARD Date: Wed, 5 Jun 2019 07:09:09 +0000 (+0200) Subject: simtest: Update non regression tests X-Git-Tag: v12.1.6~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e2c80a30e82dc34c0b9c0000b81c1b368f4ef54;p=sysstat simtest: Update non regression tests Make sure that the result of the test (success/failure) is based on the exit code of the sysstat command. Also add a new non regression test: Check that sadf -g terminates properly on a truncated input file. Signed-off-by: Sebastien GODARD --- diff --git a/Makefile.in b/Makefile.in index d51a6f8..47cf9e5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -609,6 +609,8 @@ test: all simtest: all @$(foreach x, $(TESTLIST), $(MAKE) X=$x unit || exit;) + rm -f tests/root + ln -s root1 tests/root clean: rm -f sadc sar sadf iostat tapestat mpstat pidstat cifsiostat *.o *.a core TAGS tests/*.tmp diff --git a/tests/00100 b/tests/00100 index 26445de..ee8cdc7 100644 --- a/tests/00100 +++ b/tests/00100 @@ -19,6 +19,3 @@ ln -s root4 tests/root rm -f tests/root ln -s root5 tests/root ./sadc --unix_time=1555593649 -S XALL tests/data.tmp 1 1 >/dev/null - -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/00110 b/tests/00110 index 4b9b4bd..c356d4b 100644 --- a/tests/00110 +++ b/tests/00110 @@ -1 +1,3 @@ +rm -f tests/root +ln -s root1 tests/root ./sadc --unix_time=1555594649 tests/data.tmp diff --git a/tests/00140 b/tests/00140 index 98f882b..c50db38 100644 --- a/tests/00140 +++ b/tests/00140 @@ -2,6 +2,3 @@ rm -f tests/root ln -s root6 tests/root ./sadc --unix_time=1555595649 tests/data.tmp - -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/00150 b/tests/00150 index 2a11154..0dd5e38 100644 --- a/tests/00150 +++ b/tests/00150 @@ -5,6 +5,3 @@ ln -s root6 tests/root rm -f tests/root ln -s root7 tests/root ./sadc --unix_time=1555595675 -S XALL tests/data.tmp 1 1 >/dev/null - -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/00330 b/tests/00330 index 8ebccf6..e9b2020 100644 --- a/tests/00330 +++ b/tests/00330 @@ -4,5 +4,3 @@ if [ ! -z "$VER_JSON" ]; then ln -s root1 tests/root ./mpstat -o JSON 1 10 | $VER_JSON >/dev/null; fi -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/00340 b/tests/00340 index 77c75fa..e0a0d30 100644 --- a/tests/00340 +++ b/tests/00340 @@ -4,5 +4,3 @@ if [ ! -z "$VER_JSON" ]; then ln -s root1 tests/root ./iostat -p ALL -o JSON 1 10 | $VER_JSON >/dev/null; fi -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/00900 b/tests/00900 index db3ab36..4876b70 100644 --- a/tests/00900 +++ b/tests/00900 @@ -1 +1,3 @@ +rm -f tests/root +ln -s root1 tests/root LC_ALL=C TZ=GMT ./sar -dh -j UUID -f tests/data.tmp > tests/out.sar-jUUID.tmp diff --git a/tests/01000 b/tests/01000 index d5b92a4..eba918b 100644 --- a/tests/01000 +++ b/tests/01000 @@ -3,6 +3,3 @@ rm -f tests/data0.tmp rm -f tests/root ln -s root1 tests/root ./sadc --unix_time=1555593609 -S A_NULL,A_PCSW tests/data0.tmp >/dev/null - -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/01200 b/tests/01200 index 8bbda3a..5034856 100644 --- a/tests/01200 +++ b/tests/01200 @@ -5,6 +5,3 @@ ln -s root6 tests/root rm -f tests/root ln -s root7 tests/root ./sadc --unix_time=1555593651 -S XALL tests/data0.tmp 1 1 >/dev/null - -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/01305 b/tests/01305 index dcbe1c5..ca704e9 100644 --- a/tests/01305 +++ b/tests/01305 @@ -1 +1,3 @@ +rm -f tests/root +ln -s root1 tests/root ./sadc -F 1 1 - diff --git a/tests/01380 b/tests/01380 index d0f57b1..73e0cd2 100644 --- a/tests/01380 +++ b/tests/01380 @@ -1,5 +1,3 @@ rm -f tests/root ln -s root1 tests/root LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-sigint.tmp 1 10 > /dev/null -rm -f tests/root -ln -s root1 tests/root diff --git a/tests/01405 b/tests/01405 new file mode 100644 index 0000000..c99a569 --- /dev/null +++ b/tests/01405 @@ -0,0 +1 @@ +./sadf -g tests/data-trunc -- -A > tests/out.sadf-g-trunc.tmp 2>/dev/null diff --git a/tests/01406 b/tests/01406 new file mode 100644 index 0000000..e67a996 --- /dev/null +++ b/tests/01406 @@ -0,0 +1 @@ +diff -u tests/out.sadf-g-trunc.tmp tests/expected.sadf-g-trunc diff --git a/tests/TLIST b/tests/TLIST index f4acd66..f7616ee 100644 --- a/tests/TLIST +++ b/tests/TLIST @@ -173,6 +173,9 @@ ===== Testing error cases 01400 LC_ALL=C TZ=GMT ./sar -f tests/data-trunc 2>&1 | grep "End of system activity file unexpected" >/dev/null +01405 ./sadf -g tests/data-trunc -- -A > tests/out.sadf-g-trunc.tmp 2>/dev/null + [Check that sadf -g terminates properly on truncated input file] +01406 diff -u tests/out.sadf-g-trunc.tmp tests/expected.sadf-g-trunc 01410 ./sar 0 0 2>&1 | grep "Usage:" >/dev/null 01415 ./sar 0 2 2>&1 | grep "Usage:" >/dev/null 01420 ./sar 2 0 2>&1 | grep "Usage:" >/dev/null diff --git a/tests/expected.sadf-g-trunc b/tests/expected.sadf-g-trunc new file mode 100644 index 0000000..ffb9ebd --- /dev/null +++ b/tests/expected.sadf-g-trunc @@ -0,0 +1,8 @@ + + + +Linux 1.2.3-TEST (SYSSTAT.TEST) 05/02/2019 _x86_64_ (8 CPU) + +No data! + +