From 066fd8da31e79db1b6caa9bf67e9affaf76999a2 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 21 Sep 2019 11:53:26 +0200 Subject: [PATCH] simtest: Add non regression test on datafiles extra structures data-extra-12.1.7 is a binary datafile with a next generation format (it contains various extra structures that could be added in a future sysstat version). This test makes sure that current sysstat version will be able to read such a format. Signed-off-by: Sebastien GODARD --- tests/00770 | 1 + tests/00772 | 1 + tests/TLIST | 4 ++++ tests/data-extra-12.1.7 | Bin 0 -> 1448 bytes tests/expected.data-extra-12.1.7 | 15 +++++++++++++++ 5 files changed, 21 insertions(+) create mode 100644 tests/00770 create mode 100644 tests/00772 create mode 100644 tests/data-extra-12.1.7 create mode 100644 tests/expected.data-extra-12.1.7 diff --git a/tests/00770 b/tests/00770 new file mode 100644 index 0000000..138a123 --- /dev/null +++ b/tests/00770 @@ -0,0 +1 @@ +LC_ALL=C TZ=GMT ./sar -A -f tests/data-extra-12.1.7 > tests/out.data-extra-12.1.7.tmp diff --git a/tests/00772 b/tests/00772 new file mode 100644 index 0000000..bc84724 --- /dev/null +++ b/tests/00772 @@ -0,0 +1 @@ +diff -u tests/out.data-extra-12.1.7.tmp tests/expected.data-extra-12.1.7 diff --git a/tests/TLIST b/tests/TLIST index b0e58ba..69628d1 100644 --- a/tests/TLIST +++ b/tests/TLIST @@ -100,6 +100,10 @@ NOTES: [There may be some small differences in ext disks stats between initial and current version outputs, because initial version doesn't take into account discard fields] +===== Reading datafile with extra structures +00770 LC_ALL=C TZ=GMT ./sar -A -f tests/data-extra-12.1.7 > tests/out.data-extra-12.1.7.tmp +00772 diff -u tests/out.data-extra-12.1.7.tmp tests/expected.data-extra-12.1.7 + ===== Testing sar's options 00800 LC_ALL=C TZ=GMT ./sar --iface=lo,enp6s0,eth0 -n DEV,EDEV -f tests/data.tmp > tests/out.sar-iface.tmp 00802 diff -u tests/out.sar-iface.tmp tests/expected.sar-iface diff --git a/tests/data-extra-12.1.7 b/tests/data-extra-12.1.7 new file mode 100644 index 0000000000000000000000000000000000000000..7e89912b1802beb827c5bdc9a8467b0a86c3abdd GIT binary patch literal 1448 zcmbPswN#OZk)6SVkpT=q6bSP`xFnG)U)9EfG^9XvF#~BPAb!ja6#!D4P%)4Q$Q~6S zmVmPPIXQeX^GYj#T(Ut~3T018)-8kjstTmX#^Qlo$-22ww(BFsbx zNdLUgz~EX@Qj{29TvAk;TvA$;8gB>`7y58-56G@nSE2F>aCx981Smjhka-{gqGwov znG6Z6b>MUW5@X_KwF3DA1Qfs|gaEk>B>xAh=LnJ>4sJHEoB~u0kOHS8kowgXVIVHU zyR)mobRi!DgHwK9R(@#_m=7Wp;4Fl`1Z#+(1{=a{jNELDATvSgK{N=10Eqtm_C44J zP#E|m7MDPS04xtvqX1;U^uYW>uKPe?^a2)8APa!t3(Rl`mt+#%JdzC{pn+2NU1EV) zAP)*WAUFbzqaJ7+fy97u!~_Z!AE;W87zn`ZhLtrCQQ}E-^N80;oJvaFw~GT}Pct-Z E0CX{0#sB~S literal 0 HcmV?d00001 diff --git a/tests/expected.data-extra-12.1.7 b/tests/expected.data-extra-12.1.7 new file mode 100644 index 0000000..2b2cc10 --- /dev/null +++ b/tests/expected.data-extra-12.1.7 @@ -0,0 +1,15 @@ +Linux 5.0.16-100.fc28.x86_64 (localhost.localdomain) 09/15/19 _x86_64_ (2 CPU) + +09:33:20 LINUX RESTART (2 CPU) + +09:36:40 CPU %usr %nice %sys %iowait %steal %irq %soft %guest %gnice %idle +09:38:20 all 50.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 50.00 +09:38:20 0 100.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +09:38:20 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 +Average: all 50.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 50.00 +Average: 0 100.00 0.00 0.00 0.00 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 0.00 0.00 0.00 100.00 + +09:36:40 proc/s cswch/s +09:38:20 100.00 1000.00 +Average: 100.00 1000.00 -- 2.40.0