projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: allow the use of regular expressions to match events
[lttng-tools.git]
/
tests
/
utils
/
utils.sh
diff --git
a/tests/utils/utils.sh
b/tests/utils/utils.sh
index c88387dc76d12808dcd7403039a8f36c58ea89e6..7704e5246e75d5ff52ed65885118ec18dfd12cbf 100644
(file)
--- a/
tests/utils/utils.sh
+++ b/
tests/utils/utils.sh
@@
-125,6
+125,16
@@
function conf_proc_count()
echo
}
echo
}
+# Check if base lttng-modules are present.
+# Bail out on failure
+function validate_lttng_modules_present ()
+{
+ modprobe -n lttng-tracer 2>/dev/null
+ if [ $? -ne 0 ]; then
+ BAIL_OUT "LTTng modules not detected."
+ fi
+}
+
function enable_kernel_lttng_event
{
local withtap="$1"
function enable_kernel_lttng_event
{
local withtap="$1"
@@
-713,6
+723,15
@@
function create_lttng_session_no_output ()
ok $? "Create session $sess_name in no-output mode"
}
ok $? "Create session $sess_name in no-output mode"
}
+function create_lttng_session_uri () {
+ local sess_name=$1
+ local uri=$2
+ local opts="${@:3}"
+
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -U $uri $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ ok $? "Create session $sess_name with uri:$uri and opts: $opts"
+}
+
function create_lttng_session ()
{
local withtap=$1
function create_lttng_session ()
{
local withtap=$1
@@
-1318,6
+1337,13
@@
function lttng_untrack_kernel_all_ok()
ok $? "Lttng untrack all pid on the kernel domain"
}
ok $? "Lttng untrack all pid on the kernel domain"
}
+function lttng_add_context_list()
+{
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN add-context --list 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ ret=$?
+ ok $ret "Context listing"
+}
+
function add_context_lttng()
{
local expected_to_fail="$1"
function add_context_lttng()
{
local expected_to_fail="$1"
@@
-1470,7
+1496,7
@@
function validate_trace_exp()
which $BABELTRACE_BIN >/dev/null
skip $? -ne 0 "Babeltrace binary not found. Skipping trace validation"
which $BABELTRACE_BIN >/dev/null
skip $? -ne 0 "Babeltrace binary not found. Skipping trace validation"
- traced=$($BABELTRACE_BIN $trace_path 2>/dev/null | grep ${event_exp} | wc -l)
+ traced=$($BABELTRACE_BIN $trace_path 2>/dev/null | grep
--extended-regexp
${event_exp} | wc -l)
if [ "$traced" -ne 0 ]; then
pass "Validate trace for expression '${event_exp}', $traced events"
else
if [ "$traced" -ne 0 ]; then
pass "Validate trace for expression '${event_exp}', $traced events"
else
@@
-1489,11
+1515,11
@@
function validate_trace_only_exp()
which $BABELTRACE_BIN >/dev/null
skip $? -ne 0 "Babeltrace binary not found. Skipping trace matches"
which $BABELTRACE_BIN >/dev/null
skip $? -ne 0 "Babeltrace binary not found. Skipping trace matches"
- local count=$($BABELTRACE_BIN $trace_path | grep ${event_exp} | wc -l)
+ local count=$($BABELTRACE_BIN $trace_path | grep
--extended-regexp
${event_exp} | wc -l)
local total=$($BABELTRACE_BIN $trace_path | wc -l)
if [ "$count" -ne 0 ] && [ "$total" -eq "$count" ]; then
local total=$($BABELTRACE_BIN $trace_path | wc -l)
if [ "$count" -ne 0 ] && [ "$total" -eq "$count" ]; then
- pass "Trace match with $total for expression '${event_exp}"
+ pass "Trace match with $total for expression '${event_exp}
'
"
else
fail "Trace match"
diag "$total syscall event(s) found, only syscalls matching expression '${event_exp}' ($count occurrences) are expected"
else
fail "Trace match"
diag "$total syscall event(s) found, only syscalls matching expression '${event_exp}' ($count occurrences) are expected"
This page took
0.02545 seconds
and
5
git commands to generate.