BABELTRACE_BIN="babeltrace"
OUTPUT_DEST=/dev/null
ERROR_OUTPUT_DEST=/dev/null
-MI_XSD_PATH=$TESTDIR/../src/common/mi-lttng-4.0.xsd
-XML_PRETTY_BIN="$TESTDIR/utils/xml-utils/pretty_xml"
-XML_VALIDATE_BIN="$TESTDIR/utils/xml-utils/validate_xml"
+MI_XSD_MAJOR_VERSION=4
+MI_XSD_MINOR_VERSION=1
+MI_XSD_PATH="$TESTDIR/../src/common/mi-lttng-${MI_XSD_MAJOR_VERSION}.${MI_XSD_MINOR_VERSION}.xsd"
+MI_VALIDATE="$TESTDIR/utils/xml-utils/validate_xml ${MI_XSD_PATH}"
+
+XML_PRETTY="$TESTDIR/utils/xml-utils/pretty_xml"
+XML_EXTRACT="$TESTDIR/utils/xml-utils/extract_xml"
+XML_NODE_CHECK="${XML_EXTRACT} -e"
# To match 20201127-175802
date_time_pattern="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9]"
function list_lttng_with_opts ()
{
+ local ret
+ local withtap=$1
+ shift
local opts=$1
$TESTDIR/../src/bin/lttng/$LTTNG_BIN list $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
- ok $? "Lttng-tool list command with option $opts"
+ ret=$?
+ if [ $withtap -eq "1" ]; then
+ ok $ret "Lttng-tool list command with option $opts"
+ fi
+}
+
+function list_lttng_ok ()
+{
+ list_lttng_with_opts 1 "$@"
+}
+
+function list_lttng_notap ()
+{
+ list_lttng_with_opts 0 "$@"
}
function create_lttng_session_no_output ()
pass "Validate trace for event $i, $traced events"
else
fail "Validate trace for event $i"
- diag "Found $traced occurences of $i"
+ diag "Found $traced occurrences of $i"
fi
done
ret=$?
pass "Validate trace for event $i, $traced events"
else
fail "Validate trace for event $i"
- diag "Found $traced occurences of $i"
+ diag "Found $traced occurrences of $i"
fi
cnt=$(($cnt + $traced))
done
pass "Validate trace for event $i, $traced events"
else
fail "Validate trace for event $i"
- diag "Found $traced occurences of $i"
+ diag "Found $traced occurrences of $i"
fi
cnt=$(($cnt + $traced))
done
pass "Validate trace for expression '${event_exp}', $traced events"
else
fail "Validate trace for expression '${event_exp}'"
- diag "Found $traced occurences of '${event_exp}'"
+ diag "Found $traced occurrences of '${event_exp}'"
fi
ret=$?
return $ret
ok $? "${test_name}: exit code is 0"
# Pretty-fy xml before further test.
- $XML_PRETTY_BIN < "${tmp_stdout_raw}" > "${tmp_stdout}"
+ $XML_PRETTY < "${tmp_stdout_raw}" > "${tmp_stdout}"
- $XML_VALIDATE_BIN "${MI_XSD_PATH}" "${tmp_stdout}"
+ $MI_VALIDATE "${tmp_stdout}"
ok $? "list-trigger mi is valid"
diff -u "${expected_stdout_file}" "${tmp_stdout}"