From patchwork Sun Oct 5 22:00:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 71655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93B71CCA472 for ; Sun, 5 Oct 2025 22:01:03 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.web10.20222.1759701661192343292 for ; Sun, 05 Oct 2025 15:01:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=Nf/OMFuT; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-1329275-20251005220057eb9c017e27000207fb-uwqey3@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20251005220057eb9c017e27000207fb for ; Mon, 06 Oct 2025 00:00:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=YJ9fRIBckNk4dtFUs3OL8x3Z8dQccfPxET9yTrOgQOA=; b=Nf/OMFuT/nAcrEsJBojUwm4QOGi/td+dI1lJc9uAam7APSDguPxfK+4ufk0d65+Lbqz4zJ X9etB0fXmrkeLMgbi0V4PYfHqkB+iYXzWrn7vsGky9VlG5KuLIDo/6OlF3CN//HsfuIpkwKP Zt6TSko14d1i3H/8ZZQ+RjnrLl3kyseeFXNY1ybvzgT5qXLdbU5Dxmjw13E/PlXaaXWr7w23 59InDRnlhpOvdhjDwWfkVKXZ1RG9/87NbX2gFdEj7uXuxIRsSt524rStX8fBKWlWwN5gMJgc kVfm5XK9GcBg3AYIOC6JEDDqs8bF70wuvwexCmYYTFsozLSTNXbKoqqw==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/4] devtool: ide_sdk: trivial alphabetical reorder Date: Mon, 6 Oct 2025 00:00:31 +0200 Message-ID: <20251005220047.4101591-2-adrian.freihofer@siemens.com> In-Reply-To: <20251005220047.4101591-1-adrian.freihofer@siemens.com> References: <20251005220047.4101591-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 05 Oct 2025 22:01:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224447 From: Adrian Freihofer Signed-off-by: Adrian Freihofer --- scripts/lib/devtool/ide_sdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index 931408fa74..419222fa23 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -297,6 +297,7 @@ class RecipeModified: self.package_debug_split_style = None self.path = None self.pn = None + self.recipe_id = None self.recipe_sysroot = None self.recipe_sysroot_native = None self.staging_incdir = None @@ -305,7 +306,6 @@ class RecipeModified: self.target_dbgsrc_dir = None self.topdir = None self.workdir = None - self.recipe_id = None # replicate bitbake build environment self.exported_vars = None self.cmd_compile = None From patchwork Sun Oct 5 22:00:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 71656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94A69CCD182 for ; Sun, 5 Oct 2025 22:01:03 +0000 (UTC) Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by mx.groups.io with SMTP id smtpd.web11.20229.1759701661194036448 for ; Sun, 05 Oct 2025 15:01:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=JntGm3Lq; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.228, mailfrom: fm-1329275-20251005220058cc7e8cc4d10002070f-dhnrlw@rts-flowmailer.siemens.com) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20251005220058cc7e8cc4d10002070f for ; Mon, 06 Oct 2025 00:00:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=UOHbBGgRWpKOlQ3a2eanM+oT8csXLvpRIWIy0jqrg+M=; b=JntGm3LqreYHPHfAVg65FRbhYXYoTIMncPC8JIodnuxI+JFrXvOx5XlQ24iFyeAnwS333K RzVglpSikR/baAFYCkQwwiyWBtfwNLWkYMgTUsKSkrrrIRJibciQmaL9Flwx7izqR1tWPKTx 5Txu5T7SS+Xd6PrUPZ8EU9G/h6qvqQ3mySOv66qIXT2o0pnjGq9HzKarZmuS6MWpD9YywVNj pO69lBnKTuASJPKkMfPZ4ZRZd6E3oDBB1Job4mIxG4iMbkDhbNJxD9pgdQsam7nYVosp8BBU lInf3LvCjT85jVbJtbuAWNO0tcQAPlKBiI7hmFuKPz3Le+wLt6+Wp3kg==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/4] devtool: ide-sdk: use /bin/sh instead of /bin/bash Date: Mon, 6 Oct 2025 00:00:32 +0200 Message-ID: <20251005220047.4101591-3-adrian.freihofer@siemens.com> In-Reply-To: <20251005220047.4101591-1-adrian.freihofer@siemens.com> References: <20251005220047.4101591-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 05 Oct 2025 22:01:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224451 From: Adrian Freihofer When generating the install and deploy script for IDEs, use /bin/sh instead of /bin/bash. While this is not addressing a known issue, using the more portable /bin/sh shell is preferable and avoids requiring bash to be installed. Signed-off-by: Adrian Freihofer --- scripts/lib/devtool/ide_sdk.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index 419222fa23..ccb6cfbc61 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -710,14 +710,15 @@ class RecipeModified: def gen_install_deploy_script(self, args): """Generate a script which does install and deploy""" - cmd_lines = ['#!/bin/bash'] + cmd_lines = ['#!/bin/sh'] # . oe-init-build-env $BUILDDIR - # Note: Sourcing scripts with arguments requires bash + # Using 'set' to pass the build directory to oe-init-build-env in sh syntax cmd_lines.append('cd "%s" || { echo "cd %s failed"; exit 1; }' % ( self.oe_init_dir, self.oe_init_dir)) - cmd_lines.append('. "%s" "%s" || { echo ". %s %s failed"; exit 1; }' % ( - self.oe_init_build_env, self.topdir, self.oe_init_build_env, self.topdir)) + cmd_lines.append('set ' + self.topdir) + cmd_lines.append('. "%s" || { echo ". %s %s failed"; exit 1; }' % ( + self.oe_init_build_env, self.oe_init_build_env, self.topdir)) # bitbake -c install cmd_lines.append( From patchwork Sun Oct 5 22:00:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 71657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0AD2CCD184 for ; Sun, 5 Oct 2025 22:01:03 +0000 (UTC) Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) by mx.groups.io with SMTP id smtpd.web10.20221.1759701661192085116 for ; Sun, 05 Oct 2025 15:01:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=nheLdb0R; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.225, mailfrom: fm-1329275-2025100522005879e9ca27660002076a-lnprsi@rts-flowmailer.siemens.com) Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 2025100522005879e9ca27660002076a for ; Mon, 06 Oct 2025 00:00:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=sq2XgJRcQ8KzeQPGRDnhJmpO4P635Uf84Krikn+80S4=; b=nheLdb0RFLjGT9JHqNNzGiAiZqBBN2DF/7A6RHnl+QSN8RHYt65h8FnDdYOWyvjtoTsnJJ ZqI9dxEs8/ZD97wA/PTMJpw2XPYwqjFt0l2fwAArajSYeI6FFM3OEYct7NhnkPu5NEzQ7QBW C8z/dBoWMwwK0Uv6HZFJp6Ud5fT3Gk2N0azgXYWKkm+5We5x82FAFAgVR4LbgK4ApjVHwAi4 nQo3HzMqHBU31gRA2qBHBgm1X0BQvL26qaz+1Mx8KLnYE+AnN6AzqtfNIVum5skFVLiQdVtO OdfNFYHlpzP3AouLROhTo+ti4y0r8sMtMFUa1ozgL5331Q7/Ghx8txag==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/4] devtool: ide_sdk: pass BITBAKEDIR to oe-init-build-env Date: Mon, 6 Oct 2025 00:00:33 +0200 Message-ID: <20251005220047.4101591-4-adrian.freihofer@siemens.com> In-Reply-To: <20251005220047.4101591-1-adrian.freihofer@siemens.com> References: <20251005220047.4101591-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 05 Oct 2025 22:01:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224449 From: Adrian Freihofer This fixes an issue where the generated install_and_deploy script is unable to find the bitbake directory when run outside of the build environment. This happens if the oe-selftest suite runs in a bitbake environment that is bootstrapped by bitbake-setup. oe-selftest -r devtool.DevtoolIdeSdkTests.test_devtool_ide_sdk_none_qemu AssertionError: Command '.../build-st/workspace/ide-sdk/cmake-example/ scripts/install_and_deploy_cmake-example-cortexa57' returned non-zero exit status 1: Error: The bitbake directory (/tmp/devtoolqakq7kzgeo/bitbake) does not exist! Please ensure a copy of bitbake exists at this location or specify an alternative path on the command line . /tmp/devtoolqakq7kzgeo/core-copy/oe-init-build-env /home/adrian/bitbake-builds/poky-master-poky-with-sstate-distro_poky-altcfg-machine_qemuarm64/build-st failed Another reason this issue occurs with oe-selftests is that devtool tests assume the full poky git repository is available. The setUpModule function clones layer repositories, which for poky includes bitbake. However, when using separate git repositories for bitbake and openembedded-core, the bitbake directory is not preserved during layer copying. While copying layers to allow modification during tests makes sense, copying bitbake is less beneficial. Referring to the original bitbake location is preferable, but cleaning up the devtool tests is not part of this change. Signed-off-by: Adrian Freihofer --- scripts/lib/devtool/ide_sdk.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index ccb6cfbc61..d9b54f7991 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -286,6 +286,7 @@ class RecipeModified: self.b = None self.base_libdir = None self.bblayers = None + self.bitbakepath = None self.bpn = None self.d = None self.debug_build = None @@ -346,6 +347,7 @@ class RecipeModified: self.b = recipe_d.getVar('B') self.base_libdir = recipe_d.getVar('base_libdir') self.bblayers = recipe_d.getVar('BBLAYERS').split() + self.bitbakepath = recipe_d.getVar('BITBAKEPATH') self.bpn = recipe_d.getVar('BPN') self.cxx = recipe_d.getVar('CXX') self.d = recipe_d.getVar('D') @@ -712,11 +714,11 @@ class RecipeModified: """Generate a script which does install and deploy""" cmd_lines = ['#!/bin/sh'] - # . oe-init-build-env $BUILDDIR + # . oe-init-build-env $BUILDDIR $BITBAKEDIR # Using 'set' to pass the build directory to oe-init-build-env in sh syntax cmd_lines.append('cd "%s" || { echo "cd %s failed"; exit 1; }' % ( self.oe_init_dir, self.oe_init_dir)) - cmd_lines.append('set ' + self.topdir) + cmd_lines.append('set %s %s' % (self.topdir, self.bitbakepath.rstrip('/bin'))) cmd_lines.append('. "%s" || { echo ". %s %s failed"; exit 1; }' % ( self.oe_init_build_env, self.oe_init_build_env, self.topdir)) From patchwork Sun Oct 5 22:00:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 71654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97DBECCD183 for ; Sun, 5 Oct 2025 22:01:03 +0000 (UTC) Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by mx.groups.io with SMTP id smtpd.web10.20223.1759701661440345322 for ; Sun, 05 Oct 2025 15:01:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=FLYIIoim; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.227, mailfrom: fm-1329275-2025100522005834d3bd826200020755-_qbluy@rts-flowmailer.siemens.com) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 2025100522005834d3bd826200020755 for ; Mon, 06 Oct 2025 00:00:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=Dbo7+i+PAJxvg2VlMtMjvPJ0QtWtfZwDw5ji5hDs224=; b=FLYIIoimOiltAPpT2PngJx+l73E8r7sWd10iwqp8XUYpeO8xLKL/qV4EElzghv8LeNN2P8 pSlBtCD7gFy+2P9rKme/JsAfBM92uCgjn9v7pPC2HH8zT9iGGeeIvcejpmuWoWVYsTjnlOZp /wCsI8jcXeUS3Mc8uXX1mSkBQOU2eshCE7zGVvJ+VxQdVz7srIJD73xoSEEwDHuFwToVU1X1 i1ycSUsUjuXcBjfLKmaWyx6YoAa9CCzLBEYChldjTT0wpj9eVj45i45C0wp4bJtg+gs+A7Ob xLi3Q1wUQHMnHHAm2iDGwggr41OU+gO8S73SAwOeSK4+JyMmwMvNcKEw==; From: AdrianF To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/4] oe-selftest: devtool: DevtoolIdeSdkTests debug logging Date: Mon, 6 Oct 2025 00:00:34 +0200 Message-ID: <20251005220047.4101591-5-adrian.freihofer@siemens.com> In-Reply-To: <20251005220047.4101591-1-adrian.freihofer@siemens.com> References: <20251005220047.4101591-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 05 Oct 2025 22:01:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/224450 From: Adrian Freihofer Add optional debug logging to all runCmd calls in DevtoolIdeSdkTests to improve debugging capabilities when tests fail. The logging is only enabled when the test logger is set to DEBUG level. Signed-off-by: Adrian Freihofer --- meta/lib/oeqa/selftest/cases/devtool.py | 101 +++++++++++++++--------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index b92f017b81..2b7c02ec6a 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -13,6 +13,7 @@ import glob import fnmatch import unittest import json +import logging from oeqa.selftest.case import OESelftestTestCase from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer @@ -2523,6 +2524,13 @@ class DevtoolUpgradeTests(DevtoolBase): class DevtoolIdeSdkTests(DevtoolBase): + + def setUp(self): + super().setUp() + self._cmd_logger = None + if self.logger.isEnabledFor(logging.DEBUG): + self._cmd_logger = self.logger + def _write_bb_config(self, recipe_names): """Helper to write the bitbake local.conf file""" conf_lines = [ @@ -2562,7 +2570,8 @@ class DevtoolIdeSdkTests(DevtoolBase): self.track_for_cleanup(tempdir) self.add_command_to_tearDown('bitbake -c clean %s' % recipe_name) - result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir)) + result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir), + output_log=self._cmd_logger) self.assertExists(os.path.join(tempdir, build_file), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', @@ -2572,7 +2581,7 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertTrue(matches, 'bbappend not created %s' % result.output) # Test devtool status - result = runCmd('devtool status') + result = runCmd('devtool status', output_log=self._cmd_logger) self.assertIn(recipe_name, result.output) self.assertIn(tempdir, result.output) self._check_src_repo(tempdir) @@ -2628,7 +2637,7 @@ class DevtoolIdeSdkTests(DevtoolBase): self._workspace_scripts_dir(recipe_name), i_and_d_script) self.assertExists(install_deploy_cmd, '%s script not found' % install_deploy_cmd) - runCmd(install_deploy_cmd) + runCmd(install_deploy_cmd, output_log=self._cmd_logger) MAGIC_STRING_ORIG = "Magic: 123456789" MAGIC_STRING_NEW = "Magic: 987654321" @@ -2661,7 +2670,7 @@ class DevtoolIdeSdkTests(DevtoolBase): cpp_code = cpp_code.replace(MAGIC_STRING_ORIG, MAGIC_STRING_NEW) with open(cpp_example_lib_hpp, 'w') as file: file.write(cpp_code) - runCmd(install_deploy_cmd, cwd=tempdir) + runCmd(install_deploy_cmd, cwd=tempdir, output_log=self._cmd_logger) # Verify the modified example prints the modified magic string status, output = qemu.run(example_exe) @@ -2688,7 +2697,8 @@ class DevtoolIdeSdkTests(DevtoolBase): native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", gdb_recipe) r = runCmd("%s --version" % gdb_binary, - native_sysroot=native_sysroot, target_sys=target_sys) + native_sysroot=native_sysroot, target_sys=target_sys, + output_log=self._cmd_logger) self.assertEqual(r.status, 0) self.assertIn("GNU gdb", r.output) @@ -2716,18 +2726,20 @@ class DevtoolIdeSdkTests(DevtoolBase): recipe_name), 'gdb_1234_usr-bin-' + example_exe) # Start a gdbserver - r = runCmd(gdbserver_script) + r = runCmd(gdbserver_script, output_log=self._cmd_logger) self.assertEqual(r.status, 0) # Check there is a gdbserver running - r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) + r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), + output_log=self._cmd_logger) self.assertEqual(r.status, 0) self.assertIn("gdbserver ", r.output) # Check the pid file is correct test_cmd = "cat /proc/$(cat /tmp/gdbserver_1234_usr-bin-" + \ example_exe + "/pid)/cmdline" - r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd)) + r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd), + output_log=self._cmd_logger) self.assertEqual(r.status, 0) self.assertIn("gdbserver", r.output) @@ -2738,7 +2750,7 @@ class DevtoolIdeSdkTests(DevtoolBase): gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:13,13'" gdb_batch_cmd += " -ex 'continue'" - r = runCmd(gdb_script + gdb_batch_cmd) + r = runCmd(gdb_script + gdb_batch_cmd, output_log=self._cmd_logger) self.logger.debug("%s %s returned: %s", gdb_script, gdb_batch_cmd, r.output) self.assertEqual(r.status, 0) @@ -2750,11 +2762,11 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertIn("exited normally", r.output) # Stop the gdbserver - r = runCmd(gdbserver_script + ' stop') + r = runCmd(gdbserver_script + ' stop', output_log=self._cmd_logger) self.assertEqual(r.status, 0) # Check there is no gdbserver running - r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) + r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), output_log=self._cmd_logger) self.assertEqual(r.status, 0) self.assertNotIn("gdbserver ", r.output) @@ -2775,29 +2787,29 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertExists(cmake_exe) # Verify the cmake preset generated by devtool ide-sdk is available - result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir) + result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir, output_log=self._cmd_logger) self.assertIn(preset_name, result.output) # Verify cmake re-uses the o files compiled by bitbake result = runCmd('%s --build --preset %s' % - (cmake_exe, preset_name), cwd=tempdir) + (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) self.assertIn("ninja: no work to do.", result.output) # Verify the unit tests work (in Qemu user mode) result = runCmd('%s --build --preset %s --target test' % - (cmake_exe, preset_name), cwd=tempdir) + (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) self.assertIn("100% tests passed", result.output) # Verify re-building and testing works again result = runCmd('%s --build --preset %s --target clean' % - (cmake_exe, preset_name), cwd=tempdir) + (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) self.assertIn("Cleaning", result.output) result = runCmd('%s --build --preset %s' % - (cmake_exe, preset_name), cwd=tempdir) + (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) self.assertIn("Building", result.output) self.assertIn("Linking", result.output) result = runCmd('%s --build --preset %s --target test' % - (cmake_exe, preset_name), cwd=tempdir) + (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) self.assertIn("Running tests...", result.output) self.assertIn("100% tests passed", result.output) @@ -2822,7 +2834,7 @@ class DevtoolIdeSdkTests(DevtoolBase): recipe_name, build_file, testimage) bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( recipe_name, testimage, qemu.ip) - runCmd(bitbake_sdk_cmd) + runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) self._gdb_cross() self._verify_cmake_preset(tempdir) self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) @@ -2838,7 +2850,7 @@ class DevtoolIdeSdkTests(DevtoolBase): recipe_name, build_file, testimage) bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( recipe_name, testimage, qemu.ip) - runCmd(bitbake_sdk_cmd) + runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) self._gdb_cross() self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) # Verify the oe-scripts sym-link is valid @@ -2857,7 +2869,7 @@ class DevtoolIdeSdkTests(DevtoolBase): recipe_name, build_file, testimage) bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( recipe_name, testimage) - runCmd(bitbake_sdk_cmd) + runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) self._verify_cmake_preset(tempdir) self._verify_install_script_code(tempdir, recipe_name) self._gdb_cross() @@ -2874,7 +2886,7 @@ class DevtoolIdeSdkTests(DevtoolBase): recipe_name, build_file, testimage) bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( recipe_name, testimage) - runCmd(bitbake_sdk_cmd) + runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) with open(os.path.join(tempdir, '.vscode', 'settings.json')) as settings_j: settings_d = json.load(settings_j) @@ -2886,20 +2898,25 @@ class DevtoolIdeSdkTests(DevtoolBase): # Verify meson re-uses the o files compiled by bitbake result = runCmd('%s compile -C %s' % - (meson_exe, meson_build_folder), cwd=tempdir) + (meson_exe, meson_build_folder), cwd=tempdir, + output_log=self._cmd_logger) self.assertIn("ninja: no work to do.", result.output) # Verify the unit tests work (in Qemu) - runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) + runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, + output_log=self._cmd_logger) # Verify re-building and testing works again result = runCmd('%s compile -C %s --clean' % - (meson_exe, meson_build_folder), cwd=tempdir) + (meson_exe, meson_build_folder), cwd=tempdir, + output_log=self._cmd_logger) self.assertIn("Cleaning...", result.output) result = runCmd('%s compile -C %s' % - (meson_exe, meson_build_folder), cwd=tempdir) + (meson_exe, meson_build_folder), cwd=tempdir, + output_log=self._cmd_logger) self.assertIn("Linking target", result.output) - runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) + runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, + output_log=self._cmd_logger) self._verify_install_script_code(tempdir, recipe_name) self._gdb_cross() @@ -2911,7 +2928,8 @@ class DevtoolIdeSdkTests(DevtoolBase): self._check_workspace() result_init = runCmd( - 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code') + 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code', + output_log=self._cmd_logger) bb_vars = get_bb_vars( ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support") environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS'] @@ -2926,18 +2944,21 @@ class DevtoolIdeSdkTests(DevtoolBase): def runCmdEnv(cmd, cwd): cmd = '/bin/sh -c ". %s > /dev/null && %s"' % ( environment_script_path, cmd) - return runCmd(cmd, cwd) + return runCmd(cmd, cwd, output_log=self._cmd_logger) # Verify building the C++ example works with CMake tempdir_cmake = tempfile.mkdtemp(prefix='devtoolqa') self.track_for_cleanup(tempdir_cmake) - result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake) + result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake, + output_log=self._cmd_logger) cmake_native = os.path.normpath(result_cmake.output.strip()) self.assertExists(cmake_native) - runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake) - runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake) + runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake, + output_log=self._cmd_logger) + runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake, + output_log=self._cmd_logger) # Verify the printed note really referres to a cmake executable cmake_native_code = "" @@ -2953,12 +2974,14 @@ class DevtoolIdeSdkTests(DevtoolBase): tempdir_meson = tempfile.mkdtemp(prefix='devtoolqa') self.track_for_cleanup(tempdir_meson) - result_cmake = runCmdEnv("which meson", cwd=tempdir_meson) + result_cmake = runCmdEnv("which meson", cwd=tempdir_meson, + output_log=self._cmd_logger) meson_native = os.path.normpath(result_cmake.output.strip()) self.assertExists(meson_native) - runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src) - runCmdEnv('meson compile', cwd=tempdir_meson) + runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src, + output_log=self._cmd_logger) + runCmdEnv('meson compile', cwd=tempdir_meson, output_log=self._cmd_logger) def test_devtool_ide_sdk_plugins(self): """Test that devtool ide-sdk can use plugins from other layers.""" @@ -2981,7 +3004,7 @@ class DevtoolIdeSdkTests(DevtoolBase): return m.group(1).split(',') # verify the default plugins are available but the foo plugin is not - result = runCmd('devtool ide-sdk -h') + result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) found_ides = get_ides_from_help(result.output) self.assertIn('code', found_ides) self.assertIn('none', found_ides) @@ -3012,7 +3035,7 @@ class DevtoolIdeSdkTests(DevtoolBase): plugin_file.write(plugin_code) # Verify the foo plugin is available as well - result = runCmd('devtool ide-sdk -h') + result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) found_ides = get_ides_from_help(result.output) self.assertIn('code', found_ides) self.assertIn('none', found_ides) @@ -3020,14 +3043,16 @@ class DevtoolIdeSdkTests(DevtoolBase): # Verify the foo plugin generates a shared config result = runCmd( - 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name) + 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name, + output_log=self._cmd_logger) with open(shared_config_file) as shared_config: shared_config_new = shared_config.read() self.assertEqual(shared_config_str, shared_config_new) # Verify the foo plugin generates a modified config result = runCmd('devtool ide-sdk --skip-bitbake --ide foo %s %s' % - (modified_recipe_name, testimage)) + (modified_recipe_name, testimage), + output_log=self._cmd_logger) with open(modified_config_file) as modified_config: modified_config_new = modified_config.read() self.assertEqual(modified_config_str, modified_config_new)