From fafdc3676874cca7c1fd09e1e6660e86c81c3e75 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sun, 5 Feb 2023 15:54:40 +0100 Subject: [PATCH] Add new non regression tests Signed-off-by: Sebastien GODARD --- tests/00105 | 9 +++++++++ tests/01480 | 1 + tests/TLIST | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 tests/00105 create mode 100644 tests/01480 diff --git a/tests/00105 b/tests/00105 new file mode 100644 index 0000000..e5ea638 --- /dev/null +++ b/tests/00105 @@ -0,0 +1,9 @@ +rm -f tests/data-small_ust.tmp + +rm -f tests/root +ln -s root1 tests/root +TZ=GMT ./sadc --unix_time=555593609 -S A_NULL,A_PCSW tests/data-small_ust.tmp 1 1 >/dev/null + +rm -f tests/root +ln -s root2 tests/root +TZ=GMT ./sadc --unix_time=555593619 -S A_NULL,A_PCSW tests/data-small_ust.tmp 1 1 >/dev/null diff --git a/tests/01480 b/tests/01480 new file mode 100644 index 0000000..499ca50 --- /dev/null +++ b/tests/01480 @@ -0,0 +1 @@ +LC_ALL=C ./sar -A -f tests/data-small_ust.tmp 2>&1 | grep "Invalid data" >/dev/null diff --git a/tests/TLIST b/tests/TLIST index 28d4cbf..71e3ad2 100644 --- a/tests/TLIST +++ b/tests/TLIST @@ -65,6 +65,10 @@ NOTES: ----- Creating file in Europe/Paris timezone data-tz.tmp [... / 123] 00100 3 x TZ="Europe/Paris" ./sadc --unix_time=xxxxxxxxx tests/data-tz.tmp 1 1 >/dev/null +----- Creating file data-small_ust.tmp [.. / 12] with a small timestamp value (number of seconds since the Epoch + lower than a 10-digit value) +00105 2 x TZ=GMT ./sadc --unix_time=555593609 -S A_NULL,A_PCSW tests/data-small_ust.tmp 1 1 >/dev/null + ===== sar: Reading data-new.tmp 00130 LC_ALL=C TZ=GMT ./sar -C -u -P ALL -f tests/data-new.tmp > tests/out.sar-u.tmp 00131 LC_ALL=C TZ=GMT ./sar -bBdFHqSvwWy -I ALL -m CPU -n ALL -r ALL -u ALL -P ALL -f tests/data-new.tmp > tests/out.sar-all.tmp @@ -295,6 +299,7 @@ NOTES: 01452 LC_ALL=C TZ=GMT ./sar -f tests/data-9.1.5 2>&1 | grep "cannot read the format of this file" >/dev/null 01460 LC_ALL=C ./sar -q FOO 2>&1 | grep "Usage:" >/dev/null 01470 LC_ALL=C ./sadf -x -j tests/data.tmp 2>&1 | grep "Usage:" >/dev/null +01480 LC_ALL=C ./sar -A -f tests/data-small_ust.tmp 2>&1 | grep "Invalid data" >/dev/null ===== Specific tests for sensors statistics (basic sensor output already tested using data-11.6.5 conversion) 01500 LC_ALL=C TZ=GMT ./sadf -d tests/data-11.6.5.tmp -- -m FAN,IN,TEMP > tests/out.data-11.6.5-sadf-d.tmp -- 2.50.1