]> granicus.if.org Git - sysstat/commitdiff
PSI: Add new non regression tests
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Apr 2020 07:04:08 +0000 (09:04 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Apr 2020 07:04:08 +0000 (09:04 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
22 files changed:
tests/00515 [new file with mode: 0644]
tests/00516 [new file with mode: 0644]
tests/00950 [new file with mode: 0644]
tests/00952 [new file with mode: 0644]
tests/00954 [new file with mode: 0644]
tests/00956 [new file with mode: 0644]
tests/00958 [new file with mode: 0644]
tests/00959 [new file with mode: 0644]
tests/00960 [new file with mode: 0644]
tests/00962 [new file with mode: 0644]
tests/00964 [new file with mode: 0644]
tests/00966 [new file with mode: 0644]
tests/00968 [new file with mode: 0644]
tests/00969 [new file with mode: 0644]
tests/01460 [new file with mode: 0644]
tests/TLIST
tests/expected.sadf-d-qu [new file with mode: 0644]
tests/expected.sar-qALL [new file with mode: 0644]
tests/expected.sar-qIO [new file with mode: 0644]
tests/expected.sar-qMEMIO [new file with mode: 0644]
tests/expected.sar-qPSI [new file with mode: 0644]
tests/expected.sar-qu [new file with mode: 0644]

diff --git a/tests/00515 b/tests/00515
new file mode 100644 (file)
index 0000000..540a64d
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C ./sadf -d tests/data.tmp -- -qu > tests/out.sadf-d-qu.tmp
diff --git a/tests/00516 b/tests/00516
new file mode 100644 (file)
index 0000000..bab7053
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sadf-d-qu.tmp tests/expected.sadf-d-qu
diff --git a/tests/00950 b/tests/00950
new file mode 100644 (file)
index 0000000..027bd4a
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -qu 0 > tests/out.sar-qu.tmp
diff --git a/tests/00952 b/tests/00952
new file mode 100644 (file)
index 0000000..7db7c83
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sar-qu.tmp tests/expected.sar-qu
diff --git a/tests/00954 b/tests/00954
new file mode 100644 (file)
index 0000000..36d3c43
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -q -u 0 > tests/out1.sar-qu.tmp
diff --git a/tests/00956 b/tests/00956
new file mode 100644 (file)
index 0000000..caa88b7
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out1.sar-qu.tmp tests/expected.sar-qu
diff --git a/tests/00958 b/tests/00958
new file mode 100644 (file)
index 0000000..fdc4365
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -q IO 0 > tests/out.sar-qIO.tmp
diff --git a/tests/00959 b/tests/00959
new file mode 100644 (file)
index 0000000..0db3343
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sar-qIO.tmp tests/expected.sar-qIO
diff --git a/tests/00960 b/tests/00960
new file mode 100644 (file)
index 0000000..d16e011
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -q MEM,IO 0 > tests/out.sar-qMEMIO.tmp
diff --git a/tests/00962 b/tests/00962
new file mode 100644 (file)
index 0000000..73504e2
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sar-qMEMIO.tmp tests/expected.sar-qMEMIO
diff --git a/tests/00964 b/tests/00964
new file mode 100644 (file)
index 0000000..21c2a4a
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -q PSI 0 > tests/out.sar-qPSI.tmp
diff --git a/tests/00966 b/tests/00966
new file mode 100644 (file)
index 0000000..a409dd1
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sar-qPSI.tmp tests/expected.sar-qPSI
diff --git a/tests/00968 b/tests/00968
new file mode 100644 (file)
index 0000000..4b6f385
--- /dev/null
@@ -0,0 +1,3 @@
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar -q ALL 0 > tests/out.sar-qALL.tmp
diff --git a/tests/00969 b/tests/00969
new file mode 100644 (file)
index 0000000..f4f04db
--- /dev/null
@@ -0,0 +1 @@
+diff -u tests/out.sar-qALL.tmp tests/expected.sar-qALL
diff --git a/tests/01460 b/tests/01460
new file mode 100644 (file)
index 0000000..4eabcb0
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C ./sar -q FOO 2>&1 | grep "Usage:" >/dev/null
index 147aa1e50b1b7b6df2caf0da23ace87c9e97a906..ad64b0b8adf54dce67a778b4195e538ba9bddd9e 100644 (file)
@@ -83,6 +83,8 @@ NOTES:
 00501  diff -u tests/out.sadf-p.tmp tests/expected.sadf-p
 00510  LC_ALL=C ./sadf -d tests/data.tmp -C -- -A > tests/out.sadf-d.tmp
 00511  diff -u tests/out.sadf-d.tmp tests/expected.sadf-d
+00515  LC_ALL=C ./sadf -d tests/data.tmp -- -qu > tests/out.sadf-d-qu.tmp
+00516  diff -u tests/out.sadf-d-qu.tmp tests/expected.sadf-d-qu
 00520  LC_ALL=C ./sadf -x tests/data.tmp -C -- -A > tests/out.sadf-x.tmp
 00521  diff -u tests/out.sadf-x.tmp tests/expected.sadf-x
 00530  LC_ALL=C ./sadf -j tests/data.tmp -C -- -A > tests/out.sadf-j.tmp
@@ -186,6 +188,18 @@ NOTES:
 00932  diff -u tests/out.sar-0.tmp tests/expected.sar-0
 00940  LC_ALL=C TZ=GMT ./sar 1 2 > tests/out.sar.tmp
 00942  diff -u tests/out.sar.tmp tests/expected.sar1
+00950  LC_ALL=C TZ=GMT ./sar -qu 0 > tests/out.sar-qu.tmp
+00952  diff -u tests/out.sar-qu.tmp tests/expected.sar-qu
+00954  LC_ALL=C TZ=GMT ./sar -q -u 0 > tests/out1.sar-qu.tmp
+00956  diff -u tests/out1.sar-qu.tmp tests/expected.sar-qu
+00958  LC_ALL=C TZ=GMT ./sar -q IO 0 > tests/out.sar-qIO.tmp
+00959  diff -u tests/out.sar-qIO.tmp tests/expected.sar-qIO
+00960  LC_ALL=C TZ=GMT ./sar -q MEM,IO 0 > tests/out.sar-qMEMIO.tmp
+00962  diff -u tests/out.sar-qMEMIO.tmp tests/expected.sar-qMEMIO
+00964  LC_ALL=C TZ=GMT ./sar -q PSI 0 > tests/out.sar-qPSI.tmp
+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
 01000  TZ=GMT ./sadc --unix_time=1555593609 -S A_NULL,A_PCSW tests/data0.tmp >/dev/null
@@ -259,6 +273,7 @@ NOTES:
 01430  LC_ALL=C ./sar -o foo 2>&1 | grep "Usage:" >/dev/null
 01440  LC_ALL=C TZ=GMT ./sar --unix_time=123456789 2>&1 | grep "Please check" >/dev/null
 01450  LC_ALL=C TZ=GMT ./sar -f tests/data-9.1.6 2>&1 | grep "cannot read the format of this file" >/dev/null
+01460  LC_ALL=C ./sar -q FOO 2>&1 | grep "Usage:" >/dev/null
 
 =====  Specific tests for sensors statistics (basic sensor output already tested using data-11.6.5 conversion)
 01500  LC_ALL=C TZ=GMT ./sadf -d tests/data-11.6.5.tmp -- -m FAN,IN,TEMP > tests/out.data-11.6.5-sadf-d.tmp
diff --git a/tests/expected.sadf-d-qu b/tests/expected.sadf-d-qu
new file mode 100644 (file)
index 0000000..8825517
--- /dev/null
@@ -0,0 +1,16 @@
+# hostname;interval;timestamp;CPU;%user;%nice;%system;%iowait;%steal;%idle
+SYSSTAT.TEST;31;2019-04-18 13:20:19 UTC;-1;2.15;12.50;2.36;0.12;0.00;82.88
+SYSSTAT.TEST;31;2019-04-18 13:20:29 UTC;-1;2.28;0.00;1.93;0.50;0.00;95.29
+SYSSTAT.TEST;39;2019-04-18 13:20:39 UTC;-1;2.66;23.20;2.27;0.16;0.00;71.71
+SYSSTAT.TEST;22;2019-04-18 13:20:49 UTC;-1;6.53;9.63;4.42;0.54;0.00;78.89
+# hostname;interval;timestamp;runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15;blocked
+SYSSTAT.TEST;31;2019-04-18 13:20:19 UTC;3;956;3.16;3.24;3.43;0
+SYSSTAT.TEST;31;2019-04-18 13:20:29 UTC;3;956;3.16;3.24;3.43;0
+SYSSTAT.TEST;39;2019-04-18 13:20:39 UTC;3;956;3.16;3.24;3.43;0
+SYSSTAT.TEST;22;2019-04-18 13:20:49 UTC;3;956;3.16;3.24;3.43;0
+SYSSTAT.TEST;-1;2019-04-18 13:37:29 UTC;LINUX-RESTART  (8 CPU)
+SYSSTAT.TEST;-1;2019-04-18 13:54:09 UTC;LINUX-RESTART  (10 CPU)
+# hostname;interval;timestamp;CPU;%user;%nice;%system;%iowait;%steal;%idle
+SYSSTAT.TEST;31;2019-04-18 13:54:35 UTC;-1;2.47;17.21;3.39;0.77;0.00;76.16
+# hostname;interval;timestamp;runq-sz;plist-sz;ldavg-1;ldavg-5;ldavg-15;blocked
+SYSSTAT.TEST;31;2019-04-18 13:54:35 UTC;3;956;3.16;3.24;3.43;0
diff --git a/tests/expected.sar-qALL b/tests/expected.sar-qALL
new file mode 100644 (file)
index 0000000..3e02763
--- /dev/null
@@ -0,0 +1,13 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked
+00:00:00            3       956      3.16      3.24      3.43         0
+
+00:00:00     %scpu-10  %scpu-60 %scpu-300     %scpu
+00:00:00         0.00      0.00      0.00      0.02
+
+00:00:00      %sio-10   %sio-60  %sio-300      %sio   %fio-10   %fio-60  %fio-300      %fio
+00:00:00         0.45      0.34      0.20      1.34      0.45      0.33      0.20      1.29
+
+00:00:00     %smem-10  %smem-60 %smem-300     %smem  %fmem-10  %fmem-60 %fmem-300     %fmem
+00:00:00         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
diff --git a/tests/expected.sar-qIO b/tests/expected.sar-qIO
new file mode 100644 (file)
index 0000000..d2057fc
--- /dev/null
@@ -0,0 +1,4 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00      %sio-10   %sio-60  %sio-300      %sio   %fio-10   %fio-60  %fio-300      %fio
+00:00:00         0.45      0.34      0.20      1.34      0.45      0.33      0.20      1.29
diff --git a/tests/expected.sar-qMEMIO b/tests/expected.sar-qMEMIO
new file mode 100644 (file)
index 0000000..b578cd8
--- /dev/null
@@ -0,0 +1,7 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00      %sio-10   %sio-60  %sio-300      %sio   %fio-10   %fio-60  %fio-300      %fio
+00:00:00         0.45      0.34      0.20      1.34      0.45      0.33      0.20      1.29
+
+00:00:00     %smem-10  %smem-60 %smem-300     %smem  %fmem-10  %fmem-60 %fmem-300     %fmem
+00:00:00         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
diff --git a/tests/expected.sar-qPSI b/tests/expected.sar-qPSI
new file mode 100644 (file)
index 0000000..5d9adc2
--- /dev/null
@@ -0,0 +1,10 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00     %scpu-10  %scpu-60 %scpu-300     %scpu
+00:00:00         0.00      0.00      0.00      0.02
+
+00:00:00      %sio-10   %sio-60  %sio-300      %sio   %fio-10   %fio-60  %fio-300      %fio
+00:00:00         0.45      0.34      0.20      1.34      0.45      0.33      0.20      1.29
+
+00:00:00     %smem-10  %smem-60 %smem-300     %smem  %fmem-10  %fmem-60 %fmem-300     %fmem
+00:00:00         0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
diff --git a/tests/expected.sar-qu b/tests/expected.sar-qu
new file mode 100644 (file)
index 0000000..c00bc58
--- /dev/null
@@ -0,0 +1,7 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        01/01/70        _x86_64_        (8 CPU)
+
+00:00:00        CPU     %user     %nice   %system   %iowait    %steal     %idle
+00:00:00        all      1.65     44.90      1.84      1.01      0.00     50.60
+
+00:00:00      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked
+00:00:00            3       956      3.16      3.24      3.43         0