summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/monkey/qa/__MACROS
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:20:02 +0000
commit58daab21cd043e1dc37024a7f99b396788372918 (patch)
tree96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /fluent-bit/lib/monkey/qa/__MACROS
parentReleasing debian version 1.43.2-1. (diff)
downloadnetdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz
netdata-58daab21cd043e1dc37024a7f99b396788372918.zip
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/monkey/qa/__MACROS')
-rw-r--r--fluent-bit/lib/monkey/qa/__MACROS51
1 files changed, 51 insertions, 0 deletions
diff --git a/fluent-bit/lib/monkey/qa/__MACROS b/fluent-bit/lib/monkey/qa/__MACROS
new file mode 100644
index 000000000..5e0352fef
--- /dev/null
+++ b/fluent-bit/lib/monkey/qa/__MACROS
@@ -0,0 +1,51 @@
+# ----------------------------------------------------------------------------
+# INIT: Common client-initialization
+# ----------------------------------------------------------------------------
+BLOCK INIT
+_LOG_LEVEL $TEST_LOG_LEVEL
+END
+
+
+# ----------------------------------------------------------------------------
+# FMT_DATE: Format given time in seconds to RFC 1123 format
+# Param 1: time in seconds
+# Param 2: where to store result (variable-name)
+#
+# (note: httest' STRFTIME works with msec instead of sec)
+# ----------------------------------------------------------------------------
+BLOCK FMT_DATE
+_OP $1 MUL 1000 aux
+_STRFTIME $aux "%a, %d %b %Y %H:%M:%S GMT" $2
+END
+
+
+# ----------------------------------------------------------------------------
+# TESTDOC_GETSIZE: Get TEST_DOC's file size & store it in TEST_DOC_LEN variable
+# ----------------------------------------------------------------------------
+BLOCK TESTDOC_GETSIZE
+_MATCH EXEC "(.*)" TEST_DOC_LEN
+_SH #!/bin/bash
+_SH stat -c %s $DOC_ROOT/$TEST_DOC
+_SH END
+END
+
+
+# ----------------------------------------------------------------------------
+# TESTDOC_GETEPOCH: Get TEST_DOC's Epoch time & store it in TEST_DOC_EPOCH
+# variable
+# ----------------------------------------------------------------------------
+BLOCK TESTDOC_GETEPOCH
+_MATCH EXEC "(.*)" TEST_DOC_EPOCH
+_SH #!/bin/bash
+_SH stat -c %Y $DOC_ROOT/$TEST_DOC
+_SH END
+END
+
+
+# ----------------------------------------------------------------------------
+# TESTDOC_GETDATE: Get TEST_DOC's date & store it in TEST_DOC_HTTPDATE variable
+# ----------------------------------------------------------------------------
+BLOCK TESTDOC_GETDATE
+_CALL TESTDOC_GETEPOCH
+_CALL FMT_DATE $TEST_DOC_EPOCH TEST_DOC_HTTPDATE
+END