--- /dev/null
+rm -f tests/root
+ln -s root6 tests/root
+LC_ALL=C TZ=GMT ./sar -q ALL 1 1 > tests/out1.sar-qALL.tmp
--- /dev/null
+diff -u tests/out1.sar-qALL.tmp tests/expected1.sar-qALL
--- /dev/null
+rm -f tests/root
+ln -s root6 tests/root
+LC_ALL=C TZ=GMT ./sar -q PSI 1 1 2>&1 | grep "Requested activities not available" >/dev/null
--- /dev/null
+rm -f tests/root
+ln -s root6 tests/root
+LC_ALL=C TZ=GMT ./sar -q PSI 1 1 2>&1 | grep "Inconsistent input data" >/dev/null
--- /dev/null
+rm -f tests/data1.tmp
+
+rm -f tests/root
+ln -s root1 tests/root
+TZ=GMT ./sadc --unix_time=1555593609 tests/data1.tmp 1 1 >/dev/null
+
+rm -f tests/root
+ln -s root2 tests/root
+TZ=GMT ./sadc --unix_time=1555593619 tests/data1.tmp 1 1 >/dev/null
+
+# LINUX RESTART
+TZ=GMT ./sadc --unix_time=1555593623 tests/data1.tmp >/dev/null
+
+rm -f tests/root
+ln -s root6 tests/root
+TZ=GMT ./sadc --unix_time=1555593629 tests/data1.tmp 1 1 >/dev/null
+
+rm -f tests/root
+ln -s root7 tests/root
+TZ=GMT ./sadc --unix_time=1555593639 tests/data1.tmp 1 1 >/dev/null
+
--- /dev/null
+LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-q.tmp
--- /dev/null
+diff -u tests/out2.sar-q.tmp tests/expected2.sar-q
--- /dev/null
+rm -f tests/data1.tmp
+
+rm -f tests/root
+ln -s root6 tests/root
+TZ=GMT ./sadc --unix_time=1555593609 tests/data1.tmp 1 1 >/dev/null
+
+rm -f tests/root
+ln -s root7 tests/root
+TZ=GMT ./sadc --unix_time=1555593619 tests/data1.tmp 1 1 >/dev/null
+
+# LINUX RESTART
+TZ=GMT ./sadc --unix_time=1555593623 tests/data1.tmp >/dev/null
+
+rm -f tests/root
+ln -s root1 tests/root
+TZ=GMT ./sadc --unix_time=1555593629 tests/data1.tmp 1 1 >/dev/null
+
+rm -f tests/root
+ln -s root2 tests/root
+TZ=GMT ./sadc --unix_time=1555593639 tests/data1.tmp 1 1 >/dev/null
+
--- /dev/null
+LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-qALL.tmp
--- /dev/null
+diff -u tests/out2.sar-qALL.tmp tests/expected2.sar-qALL
--- /dev/null
+rm -f tests/data1.tmp
+
+rm -f tests/root
+ln -s root6 tests/root
+TZ=GMT ./sadc --unix_time=1555593609 -S A_NULL,A_PSI_CPU tests/data1.tmp 1 1 2>&1 | grep "Requested activities not available"
+
00966 diff -u tests/out.sar-qPSI.tmp tests/expected.sar-qPSI
00968 LC_ALL=C TZ=GMT ./sar -q ALL 0 > tests/out.sar-qALL.tmp
00969 diff -u tests/out.sar-qALL.tmp tests/expected.sar-qALL
-
-===== Creating data0.tmp with no data inside
+00970 LC_ALL=C TZ=GMT ./sar -q ALL 1 1 > tests/out1.sar-qALL.tmp
+00972 diff -u tests/out1.sar-qALL.tmp tests/expected1.sar-qALL
+00974 LC_ALL=C TZ=GMT ./sar -q PSI 1 1 2>&1 | grep "Requested activities not available" >/dev/null
+00976 LC_ALL=C TZ=GMT ./sar -q PSI 1 1 2>&1 | grep "Inconsistent input data" >/dev/null
+00980 4 x TZ=GMT ./sadc --unix_time=xxxxxxx tests/data1.tmp 1 1 >/dev/null
+00982 LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-q.tmp
+00984 diff -u tests/out2.sar-q.tmp tests/expected2.sar-q
+
+===== Creating data0.tmp and data1.tmp with no data inside
01000 TZ=GMT ./sadc --unix_time=1555593609 -S A_NULL,A_PCSW tests/data0.tmp >/dev/null
+01010 4 x TZ=GMT ./sadc --unix_time=xxxxxxx tests/data1.tmp 1 1 >/dev/null
+01012 LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-qALL.tmp
+01014 diff -u tests/out2.sar-qALL.tmp tests/expected2.sar-qALL
+01020 TZ=GMT ./sadc --unix_time=1555593609 -S A_NULL,A_PSI_CPU tests/data1.tmp 1 1 2>&1 | grep "Requested activities not available"
===== sar/sadf: Reading data0.tmp
01100 LC_ALL=C TZ=GMT ./sar -A -f tests/data0.tmp > tests/out0.sar-A.tmp
--- /dev/null
+Linux 1.2.3-TEST (SYSSTAT.TEST) 01/01/70 _x86_64_ (10 CPU)
+
+00:00:00 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
+00:00:01 3 956 3.16 3.24 3.43 0
+Average: 3 956 3.16 3.24 3.43 0
--- /dev/null
+Linux 1.2.3-TEST (SYSSTAT.TEST) 04/18/19 _x86_64_ (8 CPU)
+
+13:20:09 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
+13:20:19 3 956 3.16 3.24 3.43 0
+Average: 3 956 3.16 3.24 3.43 0
+
+13:20:09 %scpu-10 %scpu-60 %scpu-300 %scpu
+13:20:19 0.00 0.00 0.00 0.03
+Average: 0.00 0.00 0.00 0.03
+
+13:20:09 %sio-10 %sio-60 %sio-300 %sio %fio-10 %fio-60 %fio-300 %fio
+13:20:19 3.19 1.14 0.43 2.33 3.19 1.14 0.42 2.25
+Average: 3.19 1.14 0.43 2.33 3.19 1.14 0.42 2.25
+
+13:20:09 %smem-10 %smem-60 %smem-300 %smem %fmem-10 %fmem-60 %fmem-300 %fmem
+13:20:19 3.12 1.40 0.03 0.05 0.00 0.00 0.00 0.02
+Average: 3.12 1.40 0.03 0.05 0.00 0.00 0.00 0.02
+
+13:20:23 LINUX RESTART (8 CPU)
+
+13:20:29 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
+13:20:39 3 956 3.16 3.24 3.43 0
+Average: 3 956 3.16 3.24 3.43 0
+
+13:20:29 %scpu-10 %scpu-60 %scpu-300 %scpu
+13:20:39 0.00 0.00 0.00 0.00
+Average: 0.00 0.00 0.00 0.00
+
+13:20:29 %sio-10 %sio-60 %sio-300 %sio %fio-10 %fio-60 %fio-300 %fio
+13:20:39 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+Average: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+
+13:20:29 %smem-10 %smem-60 %smem-300 %smem %fmem-10 %fmem-60 %fmem-300 %fmem
+13:20:39 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
+Average: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
--- /dev/null
+Linux 1.2.3-TEST (SYSSTAT.TEST) 04/18/19 _x86_64_ (10 CPU)
+
+13:20:09 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
+13:20:19 3 956 3.16 3.24 3.43 0
+Average: 3 956 3.16 3.24 3.43 0
+
+13:20:23 LINUX RESTART (10 CPU)
+
+13:20:29 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked
+13:20:39 3 956 3.16 3.24 3.43 0
+Average: 3 956 3.16 3.24 3.43 0