]> granicus.if.org Git - sysstat/commitdiff
Add new non regression tests
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Jan 2023 10:48:07 +0000 (11:48 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Jan 2023 10:48:07 +0000 (11:48 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
20 files changed:
tests/01390 [new file with mode: 0644]
tests/01392 [new file with mode: 0644]
tests/01394 [new file with mode: 0644]
tests/01396 [new file with mode: 0644]
tests/01950
tests/01952 [new file with mode: 0644]
tests/01953 [new file with mode: 0644]
tests/01957
tests/01970
tests/01972
tests/01973
tests/01975 [new file with mode: 0644]
tests/01976 [new file with mode: 0644]
tests/01977 [new file with mode: 0644]
tests/TLIST
tests/expected.sar-oe [new file with mode: 0644]
tests/expected.sar-oe2 [new file with mode: 0644]
tests/expected2.sadf-se [new file with mode: 0644]
tests/expected2.sar-se [new file with mode: 0644]
tests/expected3.sar-se [new file with mode: 0644]

diff --git a/tests/01390 b/tests/01390
new file mode 100644 (file)
index 0000000..3e486e7
--- /dev/null
@@ -0,0 +1,4 @@
+rm -f tests/sa-oe.tmp
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-oe.tmp -e 00:00:06 1 10 > /dev/null
diff --git a/tests/01392 b/tests/01392
new file mode 100644 (file)
index 0000000..20d07da
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sar -f tests/sa-oe.tmp > tests/out.sar-oe.tmp && diff -u tests/expected.sar-oe tests/out.sar-oe.tmp
diff --git a/tests/01394 b/tests/01394
new file mode 100644 (file)
index 0000000..ddf3b7b
--- /dev/null
@@ -0,0 +1,4 @@
+rm -f tests/sa-oe2.tmp
+rm -f tests/root
+ln -s root1 tests/root
+LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-oe2.tmp -e 1556755206 2 > /dev/null
diff --git a/tests/01396 b/tests/01396
new file mode 100644 (file)
index 0000000..7784055
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sar -f tests/sa-oe2.tmp > tests/out.sar-oe2.tmp && diff -u tests/expected.sar-oe2 tests/out.sar-oe2.tmp
index f27655bb4a082efead38855382423552d86b3700..d391a941433f44afb928e6c044b869d590d7235e 100644 (file)
@@ -1 +1 @@
-LC_ALL=C TZ="America/New_York" ./sar -f tests/data.tmp -e 1590933000 > tests/out.sar-e-epoch.tmp && diff -u tests/expected.sar-e-epoch tests/out.sar-e-epoch.tmp
+LC_ALL=C TZ="America/New_York" ./sar -f tests/data.tmp -e 1555595349 > tests/out.sar-e-epoch.tmp && diff -u tests/expected.sar-e-epoch tests/out.sar-e-epoch.tmp
diff --git a/tests/01952 b/tests/01952
new file mode 100644 (file)
index 0000000..649074e
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C ./sar -f tests/data.tmp -s 1555594649 -e 1555593629 2>&1 | grep "Usage:" >/dev/null
diff --git a/tests/01953 b/tests/01953
new file mode 100644 (file)
index 0000000..c57995a
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C ./sadf tests/data.tmp -s 1555594649 -e 1555593629 2>&1 | grep "Usage:" >/dev/null
index c30e167ed9bfd83101070c09db826ede1ba0e615..fd5e2ab75c2c3a6fcfa513bc9aba96d7ee914aca 100644 (file)
@@ -1 +1 @@
-LC_ALL=C TZ="Europe/Paris" ./sadf -d tests/data.tmp -T -s 1590933000 > tests/out.sadf-T-s-epoch.tmp && diff -u tests/expected.sadf-T-s-epoch tests/out.sadf-T-s-epoch.tmp
+LC_ALL=C TZ="Europe/Paris" ./sadf -d tests/data.tmp -T -s 1555595349 > tests/out.sadf-T-s-epoch.tmp && diff -u tests/expected.sadf-T-s-epoch tests/out.sadf-T-s-epoch.tmp
index a80a10ed391d648bf196a46affa25ab2921124da..19cca12ff6b4d9c7c66a5cb891cd62b65bcfb315 100644 (file)
@@ -1 +1 @@
-LC_ALL=C ./sadf -d -e foXobXar 2>&1 |grep "No such file" >/dev/null
+LC_ALL=C ./sadf -d -e foXobXar 2>&1 | grep "No such file" >/dev/null
index 982135d970212392ae0849a9c81e88da93f052c3..17564c4635936d63d4254447967a2e4f814ac40e 100644 (file)
@@ -1 +1 @@
-LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob 2>&1 |grep "Usage:" >/dev/null
+LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob 2>&1 | grep "Usage:" >/dev/null
index 47af8710d2116446e2fa2daa9030d825ea22a246..00c5b6609a4fd68c1df944e6840d1974676afb6a 100644 (file)
@@ -1 +1 @@
-LC_ALL=C ./sadf -d -e fooba 2>&1 |grep "No such file" >/dev/null
+LC_ALL=C ./sadf -d -e fooba 2>&1 | grep "No such file" >/dev/null
diff --git a/tests/01975 b/tests/01975
new file mode 100644 (file)
index 0000000..5a11bae
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sar -f tests/data.tmp -s 13:20:19 -e 13:54:09 > tests/out2.sar-se.tmp && diff -u tests/expected2.sar-se tests/out2.sar-se.tmp
diff --git a/tests/01976 b/tests/01976
new file mode 100644 (file)
index 0000000..fc158e6
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sar -f tests/data.tmp -s 13:20:19 -e 13:20:39 > tests/out3.sar-se.tmp && diff -u tests/expected3.sar-se tests/out3.sar-se.tmp
diff --git a/tests/01977 b/tests/01977
new file mode 100644 (file)
index 0000000..cddb185
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C TZ=GMT ./sadf -d tests/data.tmp -s 13:20:19 -e 1555595649 > tests/out2.sadf-se.tmp && diff -u tests/expected2.sadf-se tests/out2.sadf-se.tmp
index 9dde679ed7f89c2ca32c22c2b4572f39ae5f1919..74c8be48292aa6ac6b1ad50ed0a1091e7aa28786 100644 (file)
@@ -273,6 +273,12 @@ NOTES:
 01380  LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-sigint.tmp 1 10 > /dev/null
        [Create binary datafile sa-sigint.tmp. Stop with a simulated Ctrl/C]
 01382  LC_ALL=C TZ=GMT ./sar -f tests/sa-sigint.tmp -m CPU > tests/out.sar-sigint.tmp
+01390  LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-oe.tmp -e 00:00:06 1 10 > /dev/null
+       [Create binary datafile sa-oe.tmp. Ending time takes precedence over count parameter]
+01392  LC_ALL=C TZ=GMT ./sar -f tests/sa-oe.tmp > tests/out.sar-oe.tmp
+01394  LC_ALL=C TZ=GMT ./sar --unix_time=1556755203 -o tests/sa-oe2.tmp -e 1556755206 2 > /dev/null
+       [Create binary datafile sa-oe2.tmp. Ending time tells sar when to stop collecting]
+01396  LC_ALL=C TZ=GMT ./sar -f tests/sa-oe2.tmp > tests/out.sar-oe2.tmp
 
 =====  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
@@ -342,14 +348,19 @@ NOTES:
 01920  LC_ALL=C TZ="America/New_York" ./sadf -r tests/data-tz.tmp -- -uw > tests/out.sadf-r-tz.tmp
 01925  LC_ALL=C TZ="America/New_York" ./sadf -r tests/data-tz.tmp -T -- -uw > tests/out.sadf-r-T-tz.tmp
 01928  LC_ALL=C TZ="America/New_York" ./sadf -r tests/data-tz.tmp -t -- -uw > tests/out.sadf-r-t-tz.tmp
-01950  LC_ALL=C TZ="America/New_York" ./sar -f tests/data.tmp -e 1590933000 > tests/out.sar-e-epoch.tmp
+01950  LC_ALL=C TZ="America/New_York" ./sar -f tests/data.tmp -e 1555595349 > tests/out.sar-e-epoch.tmp
+01952  LC_ALL=C ./sar -f tests/data.tmp -s 1555594649 -e 1555593629 2>&1 | grep "Usage:" >/dev/null
+01953  LC_ALL=C ./sadf tests/data.tmp -s 1555594649 -e 1555593629 2>&1 | grep "Usage:" >/dev/null
 01955  LC_ALL=C ./sadf -d tests/data.tmp -s 1590939000 > tests/out.sadf-s-epoch.tmp
-01957  LC_ALL=C TZ="Europe/Paris" ./sadf -d tests/data.tmp -T -s 1590933000 > tests/out.sadf-T-s-epoch.tmp
+01957  LC_ALL=C TZ="Europe/Paris" ./sadf -d tests/data.tmp -T -s 1555595349 > tests/out.sadf-T-s-epoch.tmp
 01960  LC_ALL=C ./sadf -d tests/data.tmp -U -s 1555593629 -e 1555594649 > tests/out.sadf-U-se-epoch.tmp
-01965  LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob:ar 2>&1 |grep "Usage:" >/dev/null
-01970  LC_ALL=C ./sadf -d -e foXobXar 2>&1 |grep "No such file" >/dev/null
-01972  LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob 2>&1 |grep "Usage:" >/dev/null
-01973  LC_ALL=C ./sadf -d -e fooba 2>&1 |grep "No such file" >/dev/null
+01965  LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob:ar 2>&1 | grep "Usage:" >/dev/null
+01970  LC_ALL=C ./sadf -d -e foXobXar 2>&1 | grep "No such file" >/dev/null
+01972  LC_ALL=C ./sadf -d tests/data.tmp -s fo:ob 2>&1 | grep "Usage:" >/dev/null
+01973  LC_ALL=C ./sadf -d -e fooba 2>&1 | grep "No such file" >/dev/null
+01975  LC_ALL=C TZ=GMT ./sar -f tests/data.tmp -s 13:20:19 -e 13:54:09 > tests/out2.sar-se.tmp
+01976  LC_ALL=C TZ=GMT ./sar -f tests/data.tmp -s 13:20:19 -e 13:20:39 > tests/out3.sar-se.tmp
+01977  LC_ALL=C TZ=GMT ./sadf -d tests/data.tmp -s 13:20:19 -e 1555595649 > tests/out2.sadf-se.tmp
 
 =====  iostat tests (basic output)
 02010  LC_ALL=C TZ=GMT ./iostat 2 3 > tests/out.iostat.tmp
diff --git a/tests/expected.sar-oe b/tests/expected.sar-oe
new file mode 100644 (file)
index 0000000..fefe7eb
--- /dev/null
@@ -0,0 +1,7 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        05/02/19        _x86_64_        (9 CPU)
+
+00:00:03        CPU     %user     %nice   %system   %iowait    %steal     %idle
+00:00:04        all      2.15     12.50      2.36      0.12      0.00     82.88
+00:00:05        all      2.28      0.00      1.93      0.48      0.00     95.31
+00:00:06        all      2.67     23.08      2.40      0.17      0.00     71.68
+Average:        all      2.40     13.65      2.26      0.23      0.00     81.46
diff --git a/tests/expected.sar-oe2 b/tests/expected.sar-oe2
new file mode 100644 (file)
index 0000000..c443fae
--- /dev/null
@@ -0,0 +1,6 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        05/02/19        _x86_64_        (9 CPU)
+
+00:00:03        CPU     %user     %nice   %system   %iowait    %steal     %idle
+00:00:05        all      2.15     12.50      2.36      0.12      0.00     82.88
+00:00:07        all      2.28      0.00      1.93      0.48      0.00     95.31
+Average:        all      2.20      7.13      2.17      0.27      0.00     88.22
diff --git a/tests/expected2.sadf-se b/tests/expected2.sadf-se
new file mode 100644 (file)
index 0000000..c2713c5
--- /dev/null
@@ -0,0 +1,6 @@
+# hostname;interval;timestamp;CPU;%user;%nice;%system;%iowait;%steal;%idle
+SYSSTAT.TEST;31;2019-04-18 13:20:29 UTC;-1;2.28;0.00;1.93;0.48;0.00;95.31
+SYSSTAT.TEST;39;2019-04-18 13:20:39 UTC;-1;2.66;23.20;2.27;0.17;0.00;71.70
+SYSSTAT.TEST;22;2019-04-18 13:20:49 UTC;-1;6.80;8.80;7.53;0.49;0.39;75.90
+SYSSTAT.TEST;-1;2019-04-18 13:37:29 UTC;LINUX-RESTART  (9 CPU)
+SYSSTAT.TEST;-1;2019-04-18 13:54:09 UTC;LINUX-RESTART  (10 CPU)
diff --git a/tests/expected2.sar-se b/tests/expected2.sar-se
new file mode 100644 (file)
index 0000000..e8da822
--- /dev/null
@@ -0,0 +1,11 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        04/18/19        _x86_64_        (9 CPU)
+
+13:20:19        CPU     %user     %nice   %system   %iowait    %steal     %idle
+13:20:29        all      2.28      0.00      1.93      0.48      0.00     95.31
+13:20:39        all      2.66     23.20      2.27      0.17      0.00     71.70
+13:20:49        all      6.80      8.80      7.53      0.49      0.39     75.90
+Average:        all      4.01     13.45      3.02      0.39      0.00     79.13
+
+13:37:29     LINUX RESTART     (9 CPU)
+
+13:54:09     LINUX RESTART     (10 CPU)
diff --git a/tests/expected3.sar-se b/tests/expected3.sar-se
new file mode 100644 (file)
index 0000000..23f0a62
--- /dev/null
@@ -0,0 +1,6 @@
+Linux 1.2.3-TEST (SYSSTAT.TEST)        04/18/19        _x86_64_        (9 CPU)
+
+13:20:19        CPU     %user     %nice   %system   %iowait    %steal     %idle
+13:20:29        all      2.28      0.00      1.93      0.48      0.00     95.31
+13:20:39        all      2.66     23.20      2.27      0.17      0.00     71.70
+Average:        all      2.52     14.28      2.14      0.29      0.00     80.78