From: Sebastien GODARD Date: Sat, 28 Nov 2020 07:11:51 +0000 (+0100) Subject: simtest: Create data-cd file whenever tests are run X-Git-Tag: v12.5.2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f74bde56ef237f3f98ae5770ec4fd57cb324ed47;p=sysstat simtest: Create data-cd file whenever tests are run Signed-off-by: Sebastien GODARD --- diff --git a/tests/00910 b/tests/00910 deleted file mode 100644 index 27aab70..0000000 --- a/tests/00910 +++ /dev/null @@ -1 +0,0 @@ -LC_ALL=C TZ=GMT ./sar -uw -f tests/data-cd -s 23:59:58 -e 00:00:00 > tests/out.sar-cd.tmp && diff -u tests/expected.sar-cd tests/out.sar-cd.tmp diff --git a/tests/01750 b/tests/01750 new file mode 100644 index 0000000..731e9fe --- /dev/null +++ b/tests/01750 @@ -0,0 +1,25 @@ +rm -f tests/data-cd.tmp +rm -f tests/root +ln -s root1 tests/root +STEP=`TZ=GMT date --date="2019-05-01 23:59:57" +%s` +TZ=GMT ./sadc --unix_time=${STEP} -S A_NULL,A_CPU,A_PCSW tests/data-cd.tmp 1 1 >/dev/null + +rm -f tests/root +ln -s root2 tests/root +STEP=`TZ=GMT date --date="2019-05-01 23:59:58" +%s` +TZ=GMT ./sadc --unix_time=${STEP} -S A_NULL,A_CPU,A_PCSW tests/data-cd.tmp 1 1 >/dev/null + +rm -f tests/root +ln -s root3 tests/root +STEP=`TZ=GMT date --date="2019-05-01 23:59:59" +%s` +TZ=GMT ./sadc --unix_time=${STEP} -S A_NULL,A_CPU,A_PCSW tests/data-cd.tmp 1 1 >/dev/null + +rm -f tests/root +ln -s root4 tests/root +STEP=`TZ=GMT date --date="2019-05-02 00:00:00" +%s` +TZ=GMT ./sadc --unix_time=${STEP} -S A_NULL,A_CPU,A_PCSW tests/data-cd.tmp 1 1 >/dev/null + +rm -f tests/root +ln -s root5 tests/root +STEP=`TZ=GMT date --date="2019-05-02 00:00:01" +%s` +TZ=GMT ./sadc --unix_time=${STEP} -S A_NULL,A_CPU,A_PCSW tests/data-cd.tmp 1 1 >/dev/null diff --git a/tests/01755 b/tests/01755 new file mode 100644 index 0000000..5e34c39 --- /dev/null +++ b/tests/01755 @@ -0,0 +1 @@ +LC_ALL=C TZ=GMT ./sar -uw -f tests/data-cd.tmp -s 23:59:58 -e 00:00:00 > tests/out.sar-cd.tmp && diff -u tests/expected.sar-cd tests/out.sar-cd.tmp diff --git a/tests/TLIST b/tests/TLIST index 8af3de8..92dc343 100644 --- a/tests/TLIST +++ b/tests/TLIST @@ -141,10 +141,6 @@ NOTES: [Done on root4. IDs are determined at run-time using ./dev/disk/by-id contents] 00906 LC_ALL=C TZ=GMT ./sar -dh -j SID -f tests/data.tmp > tests/out.sar-jSID.tmp 00908 LC_ALL=C TZ=GMT ./sar -F -j UUID -f tests/data.tmp > tests/out.sar-F-jUUID.tmp -00910 LC_ALL=C TZ=GMT ./sar -uw -f tests/data-cd -s 23:59:58 -e 00:00:00 > tests/out.sar-cd.tmp - [Testing options -s/-e on a file contents spanning two consecutive days] - [Work only with very simple file contents (no LINUX RESTART or COMMENT records)] - [Note: "11:00:00 PM" is "23:00:00" - "12:00:00 AM" is "00:00:00"] 00920 LC_ALL=C TZ=GMT ./sar -f tests/data.tmp -e 13:30 -z -n DEV -dp > tests/out.sar-z.tmp 00930 LC_ALL=C TZ=GMT ./sar -ur 0 > tests/out.sar-0.tmp 00940 LC_ALL=C TZ=GMT ./sar 1 2 > tests/out.sar.tmp @@ -250,9 +246,14 @@ NOTES: [CPU#8 - Last in list - online then offline] 01720 LC_ALL=C TZ=GMT ./sar -P ALL -u -n SOFT 2 3 > tests/out.sar-cpu8off.tmp [CPU#8 - Last in list - already offline] - -===== Creating datax.tmp [RC....R..CR.RR..CC.] +01750 5 x TZ=GMT ./sadc --unix-time=xxxxxxxx -S A_NULL,A_CPU,A_PCSW tests/data-cd 1 1 + [Create data-cd.tmp [.....] spanning two consecutive days] +01755 LC_ALL=C TZ=GMT ./sar -uw -f tests/data-cd -s 23:59:58 -e 00:00:00 > tests/out.sar-cd.tmp + [Testing options -s/-e on a file contents spanning two consecutive days] + [Work only with very simple file contents (no LINUX RESTART or COMMENT records)] + [Note: "11:00:00 PM" is "23:00:00" - "12:00:00 AM" is "00:00:00"] 01800 n x TZ=GMT ./sadc --unix_time=xxxxxxxxxx tests/datax.tmp (...) + [Creating datax.tmp [RC....R..CR.RR..CC.] ] 01810 LC_ALL=C TZ=GMT ./sar -C -P ALL -uw -n DEV -F -I 2,3 -f tests/datax.tmp > tests/out.sar-ext-hl.tmp ===== iostat tests (basic output) diff --git a/tests/create.data-cd b/tests/create.data-cd deleted file mode 100644 index 7fa7a6b..0000000 --- a/tests/create.data-cd +++ /dev/null @@ -1,21 +0,0 @@ -rm -f tests/data-cd.new - -rm -f tests/root -ln -s root1 tests/root -./sadc --unix_time=1556755197 -S A_NULL,A_CPU,A_PCSW tests/data-cd.new 1 1 >/dev/null - -rm -f tests/root -ln -s root2 tests/root -./sadc --unix_time=1556755198 -S A_NULL,A_CPU,A_PCSW tests/data-cd.new 1 1 >/dev/null - -rm -f tests/root -ln -s root3 tests/root -./sadc --unix_time=1556755199 -S A_NULL,A_CPU,A_PCSW tests/data-cd.new 1 1 >/dev/null - -rm -f tests/root -ln -s root4 tests/root -./sadc --unix_time=1556755200 -S A_NULL,A_CPU,A_PCSW tests/data-cd.new 1 1 >/dev/null - -rm -f tests/root -ln -s root5 tests/root -./sadc --unix_time=1556755201 -S A_NULL,A_CPU,A_PCSW tests/data-cd.new 1 1 >/dev/null diff --git a/tests/data-cd b/tests/data-cd deleted file mode 100644 index fc782d0..0000000 Binary files a/tests/data-cd and /dev/null differ diff --git a/tests/expected.sar-cd b/tests/expected.sar-cd index a64a714..20861f3 100644 --- a/tests/expected.sar-cd +++ b/tests/expected.sar-cd @@ -1,8 +1,8 @@ -Linux 1.2.3-TEST (SYSSTAT.TEST) 05/01/19 _x86_64_ (8 CPU) +Linux 1.2.3-TEST (SYSSTAT.TEST) 05/01/19 _x86_64_ (9 CPU) 23:59:58 CPU %user %nice %system %iowait %steal %idle -23:59:59 all 2.28 0.00 1.93 0.50 0.00 95.29 -00:00:00 all 2.66 23.20 2.27 0.16 0.00 71.71 +23:59:59 all 2.28 0.00 1.93 0.48 0.00 95.31 +00:00:00 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 23:59:58 proc/s cswch/s