From f74bde56ef237f3f98ae5770ec4fd57cb324ed47 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sat, 28 Nov 2020 08:11:51 +0100 Subject: [PATCH] simtest: Create data-cd file whenever tests are run Signed-off-by: Sebastien GODARD --- tests/00910 | 1 - tests/01750 | 25 +++++++++++++++++++++++++ tests/01755 | 1 + tests/TLIST | 13 +++++++------ tests/create.data-cd | 21 --------------------- tests/data-cd | Bin 4296 -> 0 bytes tests/expected.sar-cd | 6 +++--- 7 files changed, 36 insertions(+), 31 deletions(-) delete mode 100644 tests/00910 create mode 100644 tests/01750 create mode 100644 tests/01755 delete mode 100644 tests/create.data-cd delete mode 100644 tests/data-cd 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 fc782d0e74df259c5708ba3adb8477e696885373..0000000000000000000000000000000000000000 GIT binary patch liter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