diff options
| -rw-r--r-- | meta/recipes-kernel/lttng/babeltrace2/external-python-tests.patch | 126 | ||||
| -rwxr-xr-x | meta/recipes-kernel/lttng/babeltrace2/run-ptest | 3 | ||||
| -rw-r--r-- | meta/recipes-kernel/lttng/babeltrace2_2.1.1.bb | 7 |
3 files changed, 134 insertions, 2 deletions
diff --git a/meta/recipes-kernel/lttng/babeltrace2/external-python-tests.patch b/meta/recipes-kernel/lttng/babeltrace2/external-python-tests.patch new file mode 100644 index 0000000000..960b33d959 --- /dev/null +++ b/meta/recipes-kernel/lttng/babeltrace2/external-python-tests.patch | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | From d2f528aa09a9001e63710470f6b700d122494961 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
| 3 | Date: Thu, 14 Aug 2025 12:27:16 -0400 | ||
| 4 | Subject: [PATCH babeltrace] bindings/python: Allow tests to be run externally | ||
| 5 | |||
| 6 | Upstream doesn't officially support running their tests externally. The python | ||
| 7 | bindings need some tweaks to work in this configuration. | ||
| 8 | |||
| 9 | The patch was created by Michael Jeanson <mjeanson@efficios.com> and is under | ||
| 10 | discussion with upstream to see if there is a way to support OE's ue case. | ||
| 11 | |||
| 12 | Upstream-Status: Inappropriate [oe specific] | ||
| 13 | |||
| 14 | Change-Id: I89555a3fbd821baa7088acc154e81665102286b8 | ||
| 15 | --- | ||
| 16 | .../python/bt2/test_component_descriptor.py | 2 +- | ||
| 17 | tests/bindings/python/bt2/test_graph.py | 2 +- | ||
| 18 | tests/bindings/python/bt2/test_plugin.py | 10 +- | ||
| 19 | .../python/bt2/test_query_executor.py | 2 +- | ||
| 20 | tests/utils/utils.sh | 2 +- | ||
| 21 | 6 files changed, 117 insertions(+), 9 deletions(-) | ||
| 22 | create mode 100644 tests/0001-wip-tests-yocto.patch | ||
| 23 | |||
| 24 | diff --git a/tests/bindings/python/bt2/test_component_descriptor.py b/tests/bindings/python/bt2/test_component_descriptor.py | ||
| 25 | index dcad514eb..49a3c054d 100644 | ||
| 26 | --- a/tests/bindings/python/bt2/test_component_descriptor.py | ||
| 27 | +++ b/tests/bindings/python/bt2/test_component_descriptor.py | ||
| 28 | @@ -19,7 +19,7 @@ class ComponentDescriptorTestCase(unittest.TestCase): | ||
| 29 | self._comp_descr = bt2.ComponentDescriptor(_DummySink, {"zoom": -23}, self._obj) | ||
| 30 | |||
| 31 | def _get_comp_cls_from_plugin(self): | ||
| 32 | - plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=False) | ||
| 33 | + plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=True) | ||
| 34 | assert plugin is not None | ||
| 35 | cc = plugin.source_component_classes["dmesg"] | ||
| 36 | assert cc is not None | ||
| 37 | diff --git a/tests/bindings/python/bt2/test_graph.py b/tests/bindings/python/bt2/test_graph.py | ||
| 38 | index 9661667a9..7fe247bd9 100644 | ||
| 39 | --- a/tests/bindings/python/bt2/test_graph.py | ||
| 40 | +++ b/tests/bindings/python/bt2/test_graph.py | ||
| 41 | @@ -113,7 +113,7 @@ class GraphTestCase(unittest.TestCase): | ||
| 42 | del comp_obj | ||
| 43 | |||
| 44 | def test_add_component_obj_non_python_comp_cls(self): | ||
| 45 | - plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=False) | ||
| 46 | + plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=True) | ||
| 47 | assert plugin is not None | ||
| 48 | cc = plugin.source_component_classes["dmesg"] | ||
| 49 | assert cc is not None | ||
| 50 | diff --git a/tests/bindings/python/bt2/test_plugin.py b/tests/bindings/python/bt2/test_plugin.py | ||
| 51 | index 0d7a9e775..39451f93a 100644 | ||
| 52 | --- a/tests/bindings/python/bt2/test_plugin.py | ||
| 53 | +++ b/tests/bindings/python/bt2/test_plugin.py | ||
| 54 | @@ -41,7 +41,7 @@ class FindPluginsTestCase(unittest.TestCase): | ||
| 55 | ) | ||
| 56 | |||
| 57 | def test_find_none_existing_dir(self): | ||
| 58 | - plugins = bt2.find_plugins_in_path(_TEST_PLUGIN_PLUGINS_PATH, recurse=False) | ||
| 59 | + plugins = bt2.find_plugins_in_path(os.environ["BT_TESTS_BUILDDIR"], recurse=False) | ||
| 60 | self.assertIsNone(plugins) | ||
| 61 | |||
| 62 | def test_find_dir(self): | ||
| 63 | @@ -53,7 +53,7 @@ class FindPluginsTestCase(unittest.TestCase): | ||
| 64 | os.environ["BT_TESTS_OS_TYPE"], "so" | ||
| 65 | ) | ||
| 66 | plugin_name = "babeltrace-plugin-utils.{}".format(extension) | ||
| 67 | - path = os.path.join(_TEST_PLUGIN_PLUGINS_PATH, "utils", ".libs", plugin_name) | ||
| 68 | + path = os.path.join(_TEST_PLUGIN_PLUGINS_PATH, plugin_name) | ||
| 69 | pset = bt2.find_plugins_in_path(path) | ||
| 70 | self.assertTrue(len(pset) == 1) | ||
| 71 | |||
| 72 | @@ -66,14 +66,14 @@ class FindPluginTestCase(unittest.TestCase): | ||
| 73 | self.assertIsNone(plugin) | ||
| 74 | |||
| 75 | def test_find_existing(self): | ||
| 76 | - plugin = bt2.find_plugin("ctf", find_in_user_dir=False, find_in_sys_dir=False) | ||
| 77 | + plugin = bt2.find_plugin("ctf", find_in_user_dir=False, find_in_sys_dir=True) | ||
| 78 | self.assertIsNotNone(plugin) | ||
| 79 | |||
| 80 | |||
| 81 | class PluginTestCase(unittest.TestCase): | ||
| 82 | def setUp(self): | ||
| 83 | self._plugin = bt2.find_plugin( | ||
| 84 | - "ctf", find_in_user_dir=False, find_in_sys_dir=False | ||
| 85 | + "ctf", find_in_user_dir=False, find_in_sys_dir=True | ||
| 86 | ) | ||
| 87 | |||
| 88 | def tearDown(self): | ||
| 89 | @@ -125,7 +125,7 @@ class PluginTestCase(unittest.TestCase): | ||
| 90 | self.assertEqual(plugins["lttng-live"].name, "lttng-live") | ||
| 91 | |||
| 92 | def test_filter_comp_classes_len(self): | ||
| 93 | - plugin = bt2.find_plugin("utils", find_in_user_dir=False, find_in_sys_dir=False) | ||
| 94 | + plugin = bt2.find_plugin("utils", find_in_user_dir=False, find_in_sys_dir=True) | ||
| 95 | self.assertEqual(len(plugin.filter_component_classes), 2) | ||
| 96 | |||
| 97 | def test_sink_comp_classes_len(self): | ||
| 98 | diff --git a/tests/bindings/python/bt2/test_query_executor.py b/tests/bindings/python/bt2/test_query_executor.py | ||
| 99 | index 099457197..9bbfd417a 100644 | ||
| 100 | --- a/tests/bindings/python/bt2/test_query_executor.py | ||
| 101 | +++ b/tests/bindings/python/bt2/test_query_executor.py | ||
| 102 | @@ -129,7 +129,7 @@ class QueryExecutorTestCase(unittest.TestCase): | ||
| 103 | del query_method_obj | ||
| 104 | |||
| 105 | def test_query_with_method_obj_non_python_comp_cls(self): | ||
| 106 | - plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=False) | ||
| 107 | + plugin = bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=True) | ||
| 108 | assert plugin is not None | ||
| 109 | cc = plugin.source_component_classes["dmesg"] | ||
| 110 | assert cc is not None | ||
| 111 | diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh | ||
| 112 | index 28db595d1..05b87f64e 100644 | ||
| 113 | --- a/tests/utils/utils.sh | ||
| 114 | +++ b/tests/utils/utils.sh | ||
| 115 | @@ -143,7 +143,7 @@ export BT_TESTS_BT2_BIN | ||
| 116 | # bt_run_in_py_env() to use it. | ||
| 117 | # | ||
| 118 | # TODO: Remove when `tests/bindings/python/bt2/test_plugin.py` is fixed. | ||
| 119 | -_bt_tests_plugins_path=$BT_TESTS_BUILDDIR/../src/plugins | ||
| 120 | +_bt_tests_plugins_path=/usr/lib/babeltrace2/plugins | ||
| 121 | |||
| 122 | # Colon-separated list of project plugin paths, if not set | ||
| 123 | _bt_tests_set_var_def BT_TESTS_BABELTRACE_PLUGIN_PATH \ | ||
| 124 | -- | ||
| 125 | 2.47.2 | ||
| 126 | |||
diff --git a/meta/recipes-kernel/lttng/babeltrace2/run-ptest b/meta/recipes-kernel/lttng/babeltrace2/run-ptest index a0bf33b75d..55397c2dd6 100755 --- a/meta/recipes-kernel/lttng/babeltrace2/run-ptest +++ b/meta/recipes-kernel/lttng/babeltrace2/run-ptest | |||
| @@ -6,6 +6,9 @@ | |||
| 6 | # test plan to raise ERRORs; this is just noise. | 6 | # test plan to raise ERRORs; this is just noise. |
| 7 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit abs_top_srcdir=$PWD abs_top_builddir=$PWD" | 7 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit abs_top_srcdir=$PWD abs_top_builddir=$PWD" |
| 8 | 8 | ||
| 9 | declare -x BT_TESTS_BABELTRACE_PLUGIN_PATH="/usr/lib/babeltrace2/ptest/tests/utils/python" | ||
| 10 | declare -x BT_TESTS_PROVIDER_DIR="/usr/lib/babeltrace2/plugin-providers" | ||
| 11 | |||
| 9 | exec 2> error.log | 12 | exec 2> error.log |
| 10 | make -C tests -k -s $makeargs $target | 13 | make -C tests -k -s $makeargs $target |
| 11 | exitcode=$? | 14 | exitcode=$? |
diff --git a/meta/recipes-kernel/lttng/babeltrace2_2.1.1.bb b/meta/recipes-kernel/lttng/babeltrace2_2.1.1.bb index 88f589eafb..52768f6ce3 100644 --- a/meta/recipes-kernel/lttng/babeltrace2_2.1.1.bb +++ b/meta/recipes-kernel/lttng/babeltrace2_2.1.1.bb | |||
| @@ -13,6 +13,7 @@ SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.1;protocol=http | |||
| 13 | file://0001-tests-fix-test-applications-in-cpp-common.patch \ | 13 | file://0001-tests-fix-test-applications-in-cpp-common.patch \ |
| 14 | file://0001-tests-set-the-correct-plugin-directory.patch \ | 14 | file://0001-tests-set-the-correct-plugin-directory.patch \ |
| 15 | file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \ | 15 | file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \ |
| 16 | file://external-python-tests.patch \ | ||
| 16 | " | 17 | " |
| 17 | SRCREV = "7f2f8cd6dac497cbb466efb31219b531c62013f5" | 18 | SRCREV = "7f2f8cd6dac497cbb466efb31219b531c62013f5" |
| 18 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$" | 19 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$" |
| @@ -21,6 +22,8 @@ inherit autotools pkgconfig ptest python3targetconfig | |||
| 21 | 22 | ||
| 22 | EXTRA_OECONF = "--disable-debug-info --disable-Werror --enable-python-plugins --enable-python-bindings" | 23 | EXTRA_OECONF = "--disable-debug-info --disable-Werror --enable-python-plugins --enable-python-bindings" |
| 23 | 24 | ||
| 25 | export DISTSETUPOPTS = " --install-lib=${PYTHON_SITEPACKAGES_DIR}" | ||
| 26 | |||
| 24 | PACKAGECONFIG ??= "manpages" | 27 | PACKAGECONFIG ??= "manpages" |
| 25 | PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" | 28 | PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native" |
| 26 | 29 | ||
| @@ -67,8 +70,8 @@ do_install_ptest () { | |||
| 67 | find "${S}/tests/$d" -maxdepth 1 -name *.json \ | 70 | find "${S}/tests/$d" -maxdepth 1 -name *.json \ |
| 68 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; | 71 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \; |
| 69 | done | 72 | done |
| 70 | install -d "${D}${PTEST_PATH}/tests/data/ctf-traces/" | 73 | install -d "${D}${PTEST_PATH}/tests/data/" |
| 71 | cp -a ${S}/tests/data/ctf-traces/* ${D}${PTEST_PATH}/tests/data/ctf-traces/ | 74 | cp -a ${S}/tests/data/* ${D}${PTEST_PATH}/tests/data/ |
| 72 | 75 | ||
| 73 | # Copy the tests directory tree and the executables and | 76 | # Copy the tests directory tree and the executables and |
| 74 | # Makefiles found within. | 77 | # Makefiles found within. |
