From: Sebastien GODARD Date: Sun, 19 Apr 2020 06:16:21 +0000 (+0200) Subject: PSI: Add new non regression tests X-Git-Tag: v12.3.3~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6fc72f1827bb5964664c3b07632582b226bdb5c;p=sysstat PSI: Add new non regression tests Signed-off-by: Sebastien GODARD --- diff --git a/tests/00970 b/tests/00970 new file mode 100644 index 0000000..50231fc --- /dev/null +++ b/tests/00970 @@ -0,0 +1,3 @@ +rm -f tests/root +ln -s root6 tests/root +LC_ALL=C TZ=GMT ./sar -q ALL 1 1 > tests/out1.sar-qALL.tmp diff --git a/tests/00972 b/tests/00972 new file mode 100644 index 0000000..d9d15b2 --- /dev/null +++ b/tests/00972 @@ -0,0 +1 @@ +diff -u tests/out1.sar-qALL.tmp tests/expected1.sar-qALL diff --git a/tests/00974 b/tests/00974 new file mode 100644 index 0000000..7885d32 --- /dev/null +++ b/tests/00974 @@ -0,0 +1,3 @@ +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 diff --git a/tests/00976 b/tests/00976 new file mode 100644 index 0000000..2a6bdef --- /dev/null +++ b/tests/00976 @@ -0,0 +1,3 @@ +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 diff --git a/tests/00980 b/tests/00980 new file mode 100644 index 0000000..002e0ac --- /dev/null +++ b/tests/00980 @@ -0,0 +1,21 @@ +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 + diff --git a/tests/00982 b/tests/00982 new file mode 100644 index 0000000..4bfec79 --- /dev/null +++ b/tests/00982 @@ -0,0 +1 @@ +LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-q.tmp diff --git a/tests/00984 b/tests/00984 new file mode 100644 index 0000000..e2a099f --- /dev/null +++ b/tests/00984 @@ -0,0 +1 @@ +diff -u tests/out2.sar-q.tmp tests/expected2.sar-q diff --git a/tests/01010 b/tests/01010 new file mode 100644 index 0000000..f7faff8 --- /dev/null +++ b/tests/01010 @@ -0,0 +1,21 @@ +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 + diff --git a/tests/01012 b/tests/01012 new file mode 100644 index 0000000..5d46c90 --- /dev/null +++ b/tests/01012 @@ -0,0 +1 @@ +LC_ALL=C TZ=GMT ./sar -f tests/data1.tmp -q ALL > tests/out2.sar-qALL.tmp diff --git a/tests/01014 b/tests/01014 new file mode 100644 index 0000000..b3d9ddf --- /dev/null +++ b/tests/01014 @@ -0,0 +1 @@ +diff -u tests/out2.sar-qALL.tmp tests/expected2.sar-qALL diff --git a/tests/01020 b/tests/01020 new file mode 100644 index 0000000..1ba9352 --- /dev/null +++ b/tests/01020 @@ -0,0 +1,6 @@ +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" + diff --git a/tests/TLIST b/tests/TLIST index ad64b0b..d9bf38c 100644 --- a/tests/TLIST +++ b/tests/TLIST @@ -200,9 +200,20 @@ NOTES: 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 diff --git a/tests/expected1.sar-qALL b/tests/expected1.sar-qALL new file mode 100644 index 0000000..ea9cdfa --- /dev/null +++ b/tests/expected1.sar-qALL @@ -0,0 +1,5 @@ +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 diff --git a/tests/expected2.sar-q b/tests/expected2.sar-q new file mode 100644 index 0000000..46c3268 --- /dev/null +++ b/tests/expected2.sar-q @@ -0,0 +1,35 @@ +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 diff --git a/tests/expected2.sar-qALL b/tests/expected2.sar-qALL new file mode 100644 index 0000000..a7f13ff --- /dev/null +++ b/tests/expected2.sar-qALL @@ -0,0 +1,11 @@ +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