]> granicus.if.org Git - sysstat/commitdiff
simtest: Create data-cd file whenever tests are run
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 28 Nov 2020 07:11:51 +0000 (08:11 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 28 Nov 2020 07:11:51 +0000 (08:11 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
tests/00910 [deleted file]
tests/01750 [new file with mode: 0644]
tests/01755 [new file with mode: 0644]
tests/TLIST
tests/create.data-cd [deleted file]
tests/data-cd [deleted file]
tests/expected.sar-cd

diff --git a/tests/00910 b/tests/00910
deleted file mode 100644 (file)
index 27aab70..0000000
+++ /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 (file)
index 0000000..731e9fe
--- /dev/null
@@ -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 (file)
index 0000000..5e34c39
--- /dev/null
@@ -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
index 8af3de89ff3ce86a66ffee97cb25f232e39f46fb..92dc3433358d3b8de0afb2be553b7e17a0fc7c94 100644 (file)
@@ -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 (file)
index 7fa7a6b..0000000
+++ /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 (file)
index fc782d0..0000000
Binary files a/tests/data-cd and /dev/null differ
index a64a7146d9330ac910cd6e2efbdb940513ef39c4..20861f3ce65612bdd9ad6ca6c2c2701e9281db6f 100644 (file)
@@ -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