Fix: bt2: autodisc: remove thread error while inserting status in map
[babeltrace.git] / tests / bindings / python / bt2 / test_trace_collection_message_iterator.py
index c9a6ebd73eda11c15715555e7871328bd755fa2a..954b149c33645fc47c625b60a7681f1c130f08b1 100644 (file)
@@ -26,6 +26,10 @@ _AUTO_SOURCE_DISCOVERY_PARAMS_LOG_LEVEL_PATH = os.path.join(
     _BT_TESTS_DATADIR, "auto-source-discovery", "params-log-level"
 )
 
+_METADATA_SYNTAX_ERROR_TRACE_PATH = os.path.join(
+    _BT_CTF_TRACES_PATH, "fail", "metadata-syntax-error"
+)
+
 
 class _SomeSource(
     bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator
@@ -709,5 +713,15 @@ class TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel(
         self.assertEqual(msgs[1].stream.name, "TestSourceB: deore")
 
 
+class TestAutoDiscoverFailures(unittest.TestCase):
+    def test_metadata_syntax_error(self):
+        with self.assertRaisesRegex(
+            bt2._Error,
+            'At line 3 in metadata stream: syntax error, unexpected CTF_RSBRAC: token="]"',
+        ):
+            specs = [bt2.AutoSourceComponentSpec(_METADATA_SYNTAX_ERROR_TRACE_PATH)]
+            bt2.TraceCollectionMessageIterator(specs)
+
+
 if __name__ == "__main__":
     unittest.main()
This page took 0.035225 seconds and 4 git commands to generate.