tests: move auto source discovery test artifacts
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 9 Aug 2019 21:57:56 +0000 (17:57 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 02:19:51 +0000 (22:19 -0400)
These test artifacts will soon be used to test the auto source discovery
feature in the Python bindings, so move them out of the `cli` directory.

Change-Id: Ia6763a42657c988442436e088fbf0e96de5baf49
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1865
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
37 files changed:
tests/cli/convert/test_auto_source_discovery_grouping
tests/cli/convert/test_auto_source_discovery_log_level
tests/cli/convert/test_auto_source_discovery_params
tests/data/auto-source-discovery/grouping/bt_plugin_test.py [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/aaa1 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/aaa2 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/aaa3 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/bbb1 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/bbb2 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/ccc1 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/ccc2 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/ccc3 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/ccc4 [new file with mode: 0644]
tests/data/auto-source-discovery/grouping/traces/some-dir/aaa10 [new file with mode: 0644]
tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py [new file with mode: 0644]
tests/data/auto-source-discovery/params-log-level/dir-a/aaa [new file with mode: 0644]
tests/data/auto-source-discovery/params-log-level/dir-ab/aaa [new file with mode: 0644]
tests/data/auto-source-discovery/params-log-level/dir-ab/bbb [new file with mode: 0644]
tests/data/auto-source-discovery/params-log-level/dir-b/bbb [new file with mode: 0644]
tests/data/cli/convert/auto-source-discovery-grouping.expect [new file with mode: 0644]
tests/data/cli/convert/auto-source-discovery-grouping/bt_plugin_test.py [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/stdout.expect [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa1 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa2 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa3 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb1 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb2 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc1 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc2 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc3 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc4 [deleted file]
tests/data/cli/convert/auto-source-discovery-grouping/traces/some-dir/aaa10 [deleted file]
tests/data/cli/convert/auto-source-discovery-params-log-level/bt_plugin_test.py [deleted file]
tests/data/cli/convert/auto-source-discovery-params-log-level/dir-a/aaa [deleted file]
tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/aaa [deleted file]
tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/bbb [deleted file]
tests/data/cli/convert/auto-source-discovery-params-log-level/dir-b/bbb [deleted file]

index 85f324d843a0b274930c01396598351ca67ae801..85e9f8fd967261e96cb34bb0a2134abd065af9c9 100755 (executable)
@@ -30,7 +30,7 @@ NUM_TESTS=3
 
 plan_tests $NUM_TESTS
 
-data_dir="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-grouping"
+data_dir="${BT_TESTS_DATADIR}/auto-source-discovery/grouping"
 plugin_dir="${data_dir}"
 trace_dir="${data_dir}/traces"
 
@@ -44,7 +44,7 @@ else
        dir_sep='/'
 fi
 
-stdout_expected_file="${data_dir}/stdout.expect"
+stdout_expected_file="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-grouping.expect"
 stdout_actual_file=$(mktemp -t stdout-actual.XXXXXX)
 stderr_actual_file=$(mktemp -t actual-stderr.XXXXXX)
 
index 5e79b01345fcaf5177165d6d5e497102275f2da8..2ffb4f8f373fa1305a4a2db8538b6f9d14fc3c71 100755 (executable)
@@ -31,7 +31,7 @@ NUM_TESTS=4
 
 plan_tests $NUM_TESTS
 
-data_dir="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-params-log-level"
+data_dir="${BT_TESTS_DATADIR}/auto-source-discovery/params-log-level"
 plugin_dir="${data_dir}"
 dir_a="${data_dir}/dir-a"
 dir_b="${data_dir}/dir-b"
index 53a9ecbdada59c2ede7377c6e40ddbd704ad1293..0112365899d43314065a5ff52bb07dbbd8c3fc72 100755 (executable)
@@ -31,7 +31,7 @@ NUM_TESTS=4
 
 plan_tests $NUM_TESTS
 
-data_dir="${BT_TESTS_DATADIR}/cli/convert/auto-source-discovery-params-log-level"
+data_dir="${BT_TESTS_DATADIR}/auto-source-discovery/params-log-level"
 plugin_dir="${data_dir}"
 dir_a="${data_dir}/dir-a"
 dir_b="${data_dir}/dir-b"
diff --git a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py
new file mode 100644 (file)
index 0000000..2495b50
--- /dev/null
@@ -0,0 +1,131 @@
+import bt2
+import os
+
+# Source component classes in this file recognize and group inputs in
+# various ways.  One stream is created by each component, with a name
+# derived from the component class and the inputs.  This is then checked
+# using the `sink.text.details` sink.
+
+
+class TestIter(bt2._UserMessageIterator):
+    def __init__(self, output_port):
+        inputs = output_port.user_data['inputs']
+        sc = output_port.user_data['sc']
+        tc = sc.trace_class
+        t = tc()
+        s = t.create_stream(sc, name=self._make_stream_name(inputs))
+
+        self._msgs = [
+            self._create_stream_beginning_message(s),
+            self._create_stream_end_message(s),
+        ]
+
+    def _make_stream_name(self, inputs):
+        comp_cls_name = self._component.__class__.__name__
+        return (
+            comp_cls_name
+            + ': '
+            + ', '.join(sorted([os.path.basename(str(x)) for x in inputs]))
+        )
+
+    def __next__(self):
+        if len(self._msgs) == 0:
+            raise StopIteration
+
+        return self._msgs.pop(0)
+
+
+class Base:
+    def __init__(self, params):
+        tc = self._create_trace_class()
+        sc = tc.create_stream_class()
+
+        self._add_output_port('out', {'inputs': params['inputs'], 'sc': sc})
+
+
+@bt2.plugin_component_class
+class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
+    """
+    Recognize files whose name start with 'aaa', 'bbb' or 'ccc'.
+
+    'aaa' files are grouped together, 'bbb' files are grouped together, 'ccc'
+    files are not grouped.
+    """
+
+    def __init__(self, params, obj):
+        super().__init__(params)
+
+    @staticmethod
+    def _user_query(priv_query_exec, obj, params, method_obj):
+        if obj == 'babeltrace.support-info':
+            if params['type'] == 'file':
+                name = os.path.basename(str(params['input']))
+
+                if name.startswith('aaa'):
+                    return {'weight': 1, 'group': 'aaa'}
+                elif name.startswith('bbb'):
+                    return {'weight': 0.5, 'group': 'bbb'}
+                elif name.startswith('ccc'):
+                    # Try two different ways of returning "no group", and two
+                    # different ways of returning 1 (an int and a float).
+                    if name[3] == '1':
+                        return {'weight': 1, 'group': None}
+                    elif name[3] == '2':
+                        return {'weight': 1.0, 'group': None}
+                    elif name[3] == '3':
+                        return 1
+                    else:
+                        return 1.0
+            else:
+                return 0
+        else:
+            raise bt2.UnknownObject
+
+
+@bt2.plugin_component_class
+class TestSourceSomeDir(
+    Base, bt2._UserSourceComponent, message_iterator_class=TestIter
+):
+    """Recognizes directories named "some-dir".  The file "aaa10" in the
+    directory "some-dir" won't be found by TestSourceExt, because we won't
+    recurse in "some-dir"."""
+
+    def __init__(self, params, obj):
+        super().__init__(params)
+
+    @staticmethod
+    def _user_query(priv_query_exec, obj, params, method_obj):
+        if obj == 'babeltrace.support-info':
+            if params['type'] == 'directory':
+                name = os.path.basename(str(params['input']))
+                return 1 if name == 'some-dir' else 0
+            else:
+                return 0
+        else:
+            raise bt2.UnknownObject
+
+
+@bt2.plugin_component_class
+class TestSourceABCDE(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
+    """A source that recognizes the arbitrary string input "ABCDE"."""
+
+    def __init__(self, params, obj):
+        super().__init__(params)
+
+    @staticmethod
+    def _user_query(priv_query_exec, obj, params, method_obj):
+        if obj == 'babeltrace.support-info':
+            return (
+                1.0
+                if params['type'] == 'string' and params['input'] == 'ABCDE'
+                else 0.0
+            )
+        else:
+            raise bt2.UnknownObject
+
+
+class TestSourceNoQuery(bt2._UserSourceComponent, message_iterator_class=TestIter):
+    """A source that does not implement _query at all."""
+
+
+bt2.register_plugin(module_name=__name__, name="test")
diff --git a/tests/data/auto-source-discovery/grouping/traces/aaa1 b/tests/data/auto-source-discovery/grouping/traces/aaa1
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/aaa2 b/tests/data/auto-source-discovery/grouping/traces/aaa2
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/aaa3 b/tests/data/auto-source-discovery/grouping/traces/aaa3
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/bbb1 b/tests/data/auto-source-discovery/grouping/traces/bbb1
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/bbb2 b/tests/data/auto-source-discovery/grouping/traces/bbb2
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/ccc1 b/tests/data/auto-source-discovery/grouping/traces/ccc1
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/ccc2 b/tests/data/auto-source-discovery/grouping/traces/ccc2
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/ccc3 b/tests/data/auto-source-discovery/grouping/traces/ccc3
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/ccc4 b/tests/data/auto-source-discovery/grouping/traces/ccc4
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/grouping/traces/some-dir/aaa10 b/tests/data/auto-source-discovery/grouping/traces/some-dir/aaa10
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py
new file mode 100644 (file)
index 0000000..a1ac699
--- /dev/null
@@ -0,0 +1,100 @@
+import bt2
+import os
+
+# This file defines source component classes to help verify the parameters an
+# log levels passed to components.  Each component creates one stream, with a
+# name derived from either:
+#
+#   - the received params that start with `test-`
+#   - the received log level
+#
+# The `what` parameter determines what is used.
+
+
+class TestIter(bt2._UserMessageIterator):
+    def __init__(self, output_port):
+        params = output_port.user_data['params']
+
+        comp_cls_name = self._component.__class__.__name__
+
+        if params['what'] == 'test-params':
+            items = sorted([str(x) for x in params.items() if x[0].startswith('test-')])
+            stream_name = '{}: {}'.format(comp_cls_name, ', '.join(items))
+        elif params['what'] == 'log-level':
+            log_level = self._component.logging_level
+            stream_name = '{}: {}'.format(comp_cls_name, log_level)
+        else:
+            assert False
+
+        sc = output_port.user_data['sc']
+        tc = sc.trace_class
+        t = tc()
+        s = t.create_stream(sc, name=stream_name)
+
+        self._msgs = [
+            self._create_stream_beginning_message(s),
+            self._create_stream_end_message(s),
+        ]
+
+    def __next__(self):
+        if len(self._msgs) == 0:
+            raise StopIteration
+
+        return self._msgs.pop(0)
+
+
+class Base:
+    def __init__(self, params):
+        tc = self._create_trace_class()
+        sc = tc.create_stream_class()
+
+        self._add_output_port('out', {'params': params, 'sc': sc})
+
+
+@bt2.plugin_component_class
+class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
+    def __init__(self, params, obj):
+        super().__init__(params)
+
+    @staticmethod
+    def _user_query(priv_query_exec, obj, params, method_obj):
+        # Match files starting with 'aaa'.
+
+        if obj == 'babeltrace.support-info':
+            if params['type'] != 'file':
+                return 0
+
+            name = os.path.basename(str(params['input']))
+
+            if name.startswith('aaa'):
+                return {'weight': 1, 'group': 'aaa'}
+            else:
+                return 0
+        else:
+            raise bt2.UnknownObject
+
+
+@bt2.plugin_component_class
+class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
+    def __init__(self, params, obj):
+        super().__init__(params)
+
+    @staticmethod
+    def _user_query(priv_query_exec, obj, params, method_obj):
+        # Match files starting with 'bbb'.
+
+        if obj == 'babeltrace.support-info':
+            if params['type'] != 'file':
+                return 0
+
+            name = os.path.basename(str(params['input']))
+
+            if name.startswith('bbb'):
+                return {'weight': 1, 'group': 'bbb'}
+            else:
+                return 0
+        else:
+            raise bt2.UnknownObject
+
+
+bt2.register_plugin(module_name=__name__, name="test")
diff --git a/tests/data/auto-source-discovery/params-log-level/dir-a/aaa b/tests/data/auto-source-discovery/params-log-level/dir-a/aaa
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/params-log-level/dir-ab/aaa b/tests/data/auto-source-discovery/params-log-level/dir-ab/aaa
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/params-log-level/dir-ab/bbb b/tests/data/auto-source-discovery/params-log-level/dir-ab/bbb
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/auto-source-discovery/params-log-level/dir-b/bbb b/tests/data/auto-source-discovery/params-log-level/dir-b/bbb
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping.expect b/tests/data/cli/convert/auto-source-discovery-grouping.expect
new file mode 100644 (file)
index 0000000..3cfa198
--- /dev/null
@@ -0,0 +1,71 @@
+{Trace 0, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceABCDE: ABCDE
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 1, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: aaa1, aaa2, aaa3
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 2, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: bbb1, bbb2
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 3, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: ccc1
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 4, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: ccc2
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 5, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: ccc3
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 6, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceExt: ccc4
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 7, Stream class ID 0, Stream ID 0}
+Stream beginning:
+  Name: TestSourceSomeDir: some-dir
+  Trace:
+    Stream (ID 0, Class ID 0)
+
+{Trace 0, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 1, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 2, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 3, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 4, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 5, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 6, Stream class ID 0, Stream ID 0}
+Stream end
+
+{Trace 7, Stream class ID 0, Stream ID 0}
+Stream end
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/bt_plugin_test.py b/tests/data/cli/convert/auto-source-discovery-grouping/bt_plugin_test.py
deleted file mode 100644 (file)
index 2495b50..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-import bt2
-import os
-
-# Source component classes in this file recognize and group inputs in
-# various ways.  One stream is created by each component, with a name
-# derived from the component class and the inputs.  This is then checked
-# using the `sink.text.details` sink.
-
-
-class TestIter(bt2._UserMessageIterator):
-    def __init__(self, output_port):
-        inputs = output_port.user_data['inputs']
-        sc = output_port.user_data['sc']
-        tc = sc.trace_class
-        t = tc()
-        s = t.create_stream(sc, name=self._make_stream_name(inputs))
-
-        self._msgs = [
-            self._create_stream_beginning_message(s),
-            self._create_stream_end_message(s),
-        ]
-
-    def _make_stream_name(self, inputs):
-        comp_cls_name = self._component.__class__.__name__
-        return (
-            comp_cls_name
-            + ': '
-            + ', '.join(sorted([os.path.basename(str(x)) for x in inputs]))
-        )
-
-    def __next__(self):
-        if len(self._msgs) == 0:
-            raise StopIteration
-
-        return self._msgs.pop(0)
-
-
-class Base:
-    def __init__(self, params):
-        tc = self._create_trace_class()
-        sc = tc.create_stream_class()
-
-        self._add_output_port('out', {'inputs': params['inputs'], 'sc': sc})
-
-
-@bt2.plugin_component_class
-class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    """
-    Recognize files whose name start with 'aaa', 'bbb' or 'ccc'.
-
-    'aaa' files are grouped together, 'bbb' files are grouped together, 'ccc'
-    files are not grouped.
-    """
-
-    def __init__(self, params, obj):
-        super().__init__(params)
-
-    @staticmethod
-    def _user_query(priv_query_exec, obj, params, method_obj):
-        if obj == 'babeltrace.support-info':
-            if params['type'] == 'file':
-                name = os.path.basename(str(params['input']))
-
-                if name.startswith('aaa'):
-                    return {'weight': 1, 'group': 'aaa'}
-                elif name.startswith('bbb'):
-                    return {'weight': 0.5, 'group': 'bbb'}
-                elif name.startswith('ccc'):
-                    # Try two different ways of returning "no group", and two
-                    # different ways of returning 1 (an int and a float).
-                    if name[3] == '1':
-                        return {'weight': 1, 'group': None}
-                    elif name[3] == '2':
-                        return {'weight': 1.0, 'group': None}
-                    elif name[3] == '3':
-                        return 1
-                    else:
-                        return 1.0
-            else:
-                return 0
-        else:
-            raise bt2.UnknownObject
-
-
-@bt2.plugin_component_class
-class TestSourceSomeDir(
-    Base, bt2._UserSourceComponent, message_iterator_class=TestIter
-):
-    """Recognizes directories named "some-dir".  The file "aaa10" in the
-    directory "some-dir" won't be found by TestSourceExt, because we won't
-    recurse in "some-dir"."""
-
-    def __init__(self, params, obj):
-        super().__init__(params)
-
-    @staticmethod
-    def _user_query(priv_query_exec, obj, params, method_obj):
-        if obj == 'babeltrace.support-info':
-            if params['type'] == 'directory':
-                name = os.path.basename(str(params['input']))
-                return 1 if name == 'some-dir' else 0
-            else:
-                return 0
-        else:
-            raise bt2.UnknownObject
-
-
-@bt2.plugin_component_class
-class TestSourceABCDE(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    """A source that recognizes the arbitrary string input "ABCDE"."""
-
-    def __init__(self, params, obj):
-        super().__init__(params)
-
-    @staticmethod
-    def _user_query(priv_query_exec, obj, params, method_obj):
-        if obj == 'babeltrace.support-info':
-            return (
-                1.0
-                if params['type'] == 'string' and params['input'] == 'ABCDE'
-                else 0.0
-            )
-        else:
-            raise bt2.UnknownObject
-
-
-class TestSourceNoQuery(bt2._UserSourceComponent, message_iterator_class=TestIter):
-    """A source that does not implement _query at all."""
-
-
-bt2.register_plugin(module_name=__name__, name="test")
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/stdout.expect b/tests/data/cli/convert/auto-source-discovery-grouping/stdout.expect
deleted file mode 100644 (file)
index 3cfa198..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-{Trace 0, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceABCDE: ABCDE
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 1, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: aaa1, aaa2, aaa3
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 2, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: bbb1, bbb2
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 3, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: ccc1
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 4, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: ccc2
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 5, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: ccc3
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 6, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceExt: ccc4
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 7, Stream class ID 0, Stream ID 0}
-Stream beginning:
-  Name: TestSourceSomeDir: some-dir
-  Trace:
-    Stream (ID 0, Class ID 0)
-
-{Trace 0, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 1, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 2, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 3, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 4, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 5, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 6, Stream class ID 0, Stream ID 0}
-Stream end
-
-{Trace 7, Stream class ID 0, Stream ID 0}
-Stream end
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa1 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa1
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa2 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa2
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa3 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/aaa3
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb1 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb1
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb2 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/bbb2
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc1 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc1
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc2 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc2
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc3 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc3
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc4 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/ccc4
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-grouping/traces/some-dir/aaa10 b/tests/data/cli/convert/auto-source-discovery-grouping/traces/some-dir/aaa10
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-params-log-level/bt_plugin_test.py b/tests/data/cli/convert/auto-source-discovery-params-log-level/bt_plugin_test.py
deleted file mode 100644 (file)
index a1ac699..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-import bt2
-import os
-
-# This file defines source component classes to help verify the parameters an
-# log levels passed to components.  Each component creates one stream, with a
-# name derived from either:
-#
-#   - the received params that start with `test-`
-#   - the received log level
-#
-# The `what` parameter determines what is used.
-
-
-class TestIter(bt2._UserMessageIterator):
-    def __init__(self, output_port):
-        params = output_port.user_data['params']
-
-        comp_cls_name = self._component.__class__.__name__
-
-        if params['what'] == 'test-params':
-            items = sorted([str(x) for x in params.items() if x[0].startswith('test-')])
-            stream_name = '{}: {}'.format(comp_cls_name, ', '.join(items))
-        elif params['what'] == 'log-level':
-            log_level = self._component.logging_level
-            stream_name = '{}: {}'.format(comp_cls_name, log_level)
-        else:
-            assert False
-
-        sc = output_port.user_data['sc']
-        tc = sc.trace_class
-        t = tc()
-        s = t.create_stream(sc, name=stream_name)
-
-        self._msgs = [
-            self._create_stream_beginning_message(s),
-            self._create_stream_end_message(s),
-        ]
-
-    def __next__(self):
-        if len(self._msgs) == 0:
-            raise StopIteration
-
-        return self._msgs.pop(0)
-
-
-class Base:
-    def __init__(self, params):
-        tc = self._create_trace_class()
-        sc = tc.create_stream_class()
-
-        self._add_output_port('out', {'params': params, 'sc': sc})
-
-
-@bt2.plugin_component_class
-class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    def __init__(self, params, obj):
-        super().__init__(params)
-
-    @staticmethod
-    def _user_query(priv_query_exec, obj, params, method_obj):
-        # Match files starting with 'aaa'.
-
-        if obj == 'babeltrace.support-info':
-            if params['type'] != 'file':
-                return 0
-
-            name = os.path.basename(str(params['input']))
-
-            if name.startswith('aaa'):
-                return {'weight': 1, 'group': 'aaa'}
-            else:
-                return 0
-        else:
-            raise bt2.UnknownObject
-
-
-@bt2.plugin_component_class
-class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter):
-    def __init__(self, params, obj):
-        super().__init__(params)
-
-    @staticmethod
-    def _user_query(priv_query_exec, obj, params, method_obj):
-        # Match files starting with 'bbb'.
-
-        if obj == 'babeltrace.support-info':
-            if params['type'] != 'file':
-                return 0
-
-            name = os.path.basename(str(params['input']))
-
-            if name.startswith('bbb'):
-                return {'weight': 1, 'group': 'bbb'}
-            else:
-                return 0
-        else:
-            raise bt2.UnknownObject
-
-
-bt2.register_plugin(module_name=__name__, name="test")
diff --git a/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-a/aaa b/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-a/aaa
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/aaa b/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/aaa
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/bbb b/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-ab/bbb
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-b/bbb b/tests/data/cli/convert/auto-source-discovery-params-log-level/dir-b/bbb
deleted file mode 100644 (file)
index e69de29..0000000
This page took 0.037647 seconds and 4 git commands to generate.