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 <sysstat@users.noreply.github.com>
--- /dev/null
+LC_ALL=C TZ=GMT ./sar -A -f tests/data-extra-12.1.7 > tests/out.data-extra-12.1.7.tmp
--- /dev/null
+diff -u tests/out.data-extra-12.1.7.tmp tests/expected.data-extra-12.1.7
[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
--- /dev/null
+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