From 216b7cc7012d58632a085d2813f1573f09532ac5 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 9 Aug 2019 16:08:37 -0400 Subject: [PATCH] tests: make auto-source-discovery-grouping test use sink.text.details This patch changes the way that test component classes for the auto source discovery grouping CLI test reports the inputs passed to each instantiated component. Currently, they print to stdout the input names in the components' __init__. That is then check by the test script (test_auto_source_discovery_grouping). The TraceCollectionMessageIterator class in the Python bindings will soon have the capability to automatically discover source components. However, it's not practical to use the same test method in Python. To facilitate this, make the test component classes report the inputs they receive by sending a stream beginning message, where the stream name contains the input names. The eventual Python test will be able to inspect the stream name to validate that the right inputs were passed to each component. Since the information is now passed in messages, the test_auto_source_discovery_grouping test now uses the details sink. Change-Id: Ie5c12e390f5b68fb50a6d18c53463860fb7a1c99 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1863 Reviewed-by: Philippe Proulx Tested-by: jenkins --- .../test_auto_source_discovery_grouping | 20 ++---- .../bt_plugin_test.py | 46 +++++++++--- .../stdout.expect | 71 +++++++++++++++++++ 3 files changed, 113 insertions(+), 24 deletions(-) create mode 100644 tests/data/cli/convert/auto-source-discovery-grouping/stdout.expect diff --git a/tests/cli/convert/test_auto_source_discovery_grouping b/tests/cli/convert/test_auto_source_discovery_grouping index d98f689f..d4e9e4c4 100755 --- a/tests/cli/convert/test_auto_source_discovery_grouping +++ b/tests/cli/convert/test_auto_source_discovery_grouping @@ -44,21 +44,9 @@ else dir_sep='/' fi -expected_file=$(mktemp -t expected.XXXXXX) -stderr_expected=/dev/null +stdout_expected_file="${data_dir}/stdout.expect" -cat > "$expected_file" <