]> granicus.if.org Git - sysstat/commitdiff
simtest: Update non regression tests
authorSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 5 Jun 2019 07:09:09 +0000 (09:09 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Wed, 5 Jun 2019 07:09:09 +0000 (09:09 +0200)
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 <sysstat@users.noreply.github.com>
16 files changed:
Makefile.in
tests/00100
tests/00110
tests/00140
tests/00150
tests/00330
tests/00340
tests/00900
tests/01000
tests/01200
tests/01305
tests/01380
tests/01405 [new file with mode: 0644]
tests/01406 [new file with mode: 0644]
tests/TLIST
tests/expected.sadf-g-trunc [new file with mode: 0644]

index d51a6f84772b7c99554a0b45c7a3d3e8e3d8ab93..47cf9e50ec0893ea4299cba132e6e07a2b9fb439 100644 (file)
@@ -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
index 26445de5c8dcae26209e65be09213c6c1ac0ae84..ee8cdc7e72f81e6580b3f51b33ff922d746ee647 100644 (file)
@@ -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
index 4b9b4bd752067d4de0084078316b7f93397a0673..c356d4baf2209817c9a20262607a425a75161ba9 100644 (file)
@@ -1 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
 ./sadc --unix_time=1555594649 tests/data.tmp
index 98f882bd56d08c145a4f1ecd1cd3d7dd3791b957..c50db3889ee4a75d9e133bc5be8feb36a9eb8ee7 100644 (file)
@@ -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
index 2a11154983fbfe7dde2e1b5dec20983e9262b9a5..0dd5e3805da1adfe2426e19093cc3dfbb9f8a461 100644 (file)
@@ -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
index 8ebccf6c3c6c897bb273a52f7ef3dbbcc4f81e8c..e9b20207b673549218c556fe14072e26e97ca546 100644 (file)
@@ -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
index 77c75faf657326ca8271c8ac2731a9d4e3f2e71c..e0a0d30ebf575f0ff42947639f0d6d968417307d 100644 (file)
@@ -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
index db3ab3648c22170dfab85aa19d499622bf5226d9..4876b702d4f0c938423e4a9e2b88cca8e56b6042 100644 (file)
@@ -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
index d5b92a4acc82ce238709dc843909f5cc77d973c4..eba918ba00f911bf3469bfa8126607d9bf39915a 100644 (file)
@@ -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
index 8bbda3a3956930d7a8a1d31e394dcb4aedffa0e6..5034856eecb86e709f6cbdcfa573a73cb4816fc1 100644 (file)
@@ -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
index dcbe1c57c801a3984e7d36b1fd6d91845f8860d9..ca704e99cb6480f1bf05c326b276073d71564f7b 100644 (file)
@@ -1 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
 ./sadc -F 1 1 -
index d0f57b13b3972550a4658820c3199b76621c71ac..73e0cd2ab48b0a8e5975ea10fdde3c5180211fdf 100644 (file)
@@ -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 (file)
index 0000000..c99a569
--- /dev/null
@@ -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 (file)
index 0000000..e67a996
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sadf-g-trunc.tmp tests/expected.sadf-g-trunc
index f4acd66ebb04fc222b2ed9d54d42a73d7020df01..f7616eec64b3c6422c9927e7364dbe848e91817d 100644 (file)
 
 =====  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 (file)
index 0000000..ffb9ebd
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" width="1060" height="100" fill="black" stroke="#808080" stroke-width="1">
+<text x="0" y="30" text-anchor="start" stroke="#a52a2a">Linux 1.2.3-TEST (SYSSTAT.TEST)        05/02/2019      _x86_64_        (8 CPU)
+</text>
+<text x= "0" y="60" text-anchor="start" stroke="#ff0000">No data!</text>
+<!-- Actual canvas height: 60 -->
+</svg>