From patchwork Wed May 17 09:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 24093 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 E8CEDC77B75 for ; Wed, 17 May 2023 09:40:58 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web10.45436.1684316453071784448 for ; Wed, 17 May 2023 02:40:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=q0cyblfB; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: peron.clem@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3f50020e0f8so56362445e9.0 for ; Wed, 17 May 2023 02:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684316451; x=1686908451; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/Tv8b2NK/U7U5e/XMUJ4UL/th5tyka3V646pANKlfJA=; b=q0cyblfBZFKqwO+5qWGutB4ICQ4mqbBgdlb8JnoUHE76IGtbWB2V5ed8O8nZ6Nkzhc 5zv0AVQdrhgp7iLocz3f1n189TiHG7PJ0y9oZjX+lY0Rsuwsf1GTQiBywk1s5DRFfmgs RT6rEMo2g95rqWVflQVdnWPYFseMCNVCFdcjlcWq5NqXXxVafqY5YQ+EFFWA5ZOzdx7Y G7prUHiUUjV8KlL+ssK0Lta9D6ZFef/0txtZ7b41/QXkMQGX2xxuMMF1SEVor/9V6IHK UhSyZws2Ct/9us1mIJ7olTukzYOybOEhlkUkgagPy0a2tcyMpaE9qJXglICNsZwXcpuM VW9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684316451; x=1686908451; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/Tv8b2NK/U7U5e/XMUJ4UL/th5tyka3V646pANKlfJA=; b=iSEfgUjIhIMrIXAgP0S1lfEpMwZ8pX8Atmap68hsRPHptjMk+4uc/XdBQfG/Cx/k8O 1JnymvLa4zdKbS+z321omcCy9bXGIS3JAcVW8kWwmgzq/yQ7aqmKbxtf7DAiShH44F7H fw6AjwTBhjgJOJQaRMPuegEyINB2qfCJOlr2fN9HHiuVi7h5kyv8jS68CJShbIlr0+UG asKg4WXjGxJ8SJIo1uoX63W3zJ3W27HOidVmvEy6K+t3bLxxIH4Mc1WLfSG0Vx79hldc VZ7eg4Jq3LmmbK4i05DkY9zDGmV9vRgaljkRk7flncdfvMYGQ9cqEltHtqNYdmjCvdi4 0ikw== X-Gm-Message-State: AC+VfDy5SGUxjFIcV70Beih9hQ2J59Scvg6IlnTxkP3bEKkdAG3UAVRT D2iRKCN2ei9q7El6Aq6g0qLOB0baaUYnBQ== X-Google-Smtp-Source: ACHHUZ7W7Ici5e2xIUSPJunc2JnjeySmAP/nHfLrGcJN6YYe8/c9IBagqXTnJ2+gJpeOM42SRJHbhA== X-Received: by 2002:a1c:4c19:0:b0:3f4:2775:b45c with SMTP id z25-20020a1c4c19000000b003f42775b45cmr1212801wmf.3.1684316450889; Wed, 17 May 2023 02:40:50 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id n16-20020a1c7210000000b003f19b3d89e9sm1590811wmc.33.2023.05.17.02.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 02:40:50 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: meta-arm@lists.yoctoproject.org Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v4 1/2] arm/lib: pass the PATH to fvp runner Date: Wed, 17 May 2023 11:40:43 +0200 Message-Id: <20230517094044.84867-1-peron.clem@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 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 ; Wed, 17 May 2023 09:40:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4659 When running an FVP machine the model executable need to be found in the PATH environement. At the moment the script doesn't provide any PATH to the subprocess. Add PATH to the allowed environement variable to be forwaded. Signed-off-by: Clément Péron --- meta-arm/lib/fvp/runner.py | 2 +- meta-arm/lib/oeqa/selftest/cases/runfvp.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/meta-arm/lib/fvp/runner.py b/meta-arm/lib/fvp/runner.py index c52cdc1c..d957e780 100644 --- a/meta-arm/lib/fvp/runner.py +++ b/meta-arm/lib/fvp/runner.py @@ -91,7 +91,7 @@ class FVPRunner: # Pass through environment variables needed for GUI applications, such # as xterm, to work. env = config['env'] - for name in ('DISPLAY', 'WAYLAND_DISPLAY', 'XAUTHORITY'): + for name in ('DISPLAY', 'PATH', 'WAYLAND_DISPLAY', 'XAUTHORITY'): if name in os.environ: env[name] = os.environ[name] diff --git a/meta-arm/lib/oeqa/selftest/cases/runfvp.py b/meta-arm/lib/oeqa/selftest/cases/runfvp.py index 5cc8660f..46941ca9 100644 --- a/meta-arm/lib/oeqa/selftest/cases/runfvp.py +++ b/meta-arm/lib/oeqa/selftest/cases/runfvp.py @@ -83,6 +83,7 @@ class RunnerTests(OESelftestTestCase): def create_mock(self): return unittest.mock.patch("subprocess.Popen") + @unittest.mock.patch.dict(os.environ, {"PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"}) def test_start(self): from fvp import runner with self.create_mock() as m: @@ -106,9 +107,9 @@ class RunnerTests(OESelftestTestCase): stdin=unittest.mock.ANY, stdout=unittest.mock.ANY, stderr=unittest.mock.ANY, - env={"FOO":"BAR"}) + env={"FOO":"BAR", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"}) - @unittest.mock.patch.dict(os.environ, {"DISPLAY": ":42", "WAYLAND_DISPLAY": "wayland-42"}) + @unittest.mock.patch.dict(os.environ, {"DISPLAY": ":42", "WAYLAND_DISPLAY": "wayland-42", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"}) def test_env_passthrough(self): from fvp import runner with self.create_mock() as m: @@ -128,4 +129,4 @@ class RunnerTests(OESelftestTestCase): stdin=unittest.mock.ANY, stdout=unittest.mock.ANY, stderr=unittest.mock.ANY, - env={"DISPLAY":":42", "FOO": "BAR", "WAYLAND_DISPLAY": "wayland-42"}) + env={"DISPLAY":":42", "FOO": "BAR", "WAYLAND_DISPLAY": "wayland-42", "PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"}) From patchwork Wed May 17 09:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 24094 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 E27A9C77B7F for ; Wed, 17 May 2023 09:40:58 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web10.45437.1684316454236992433 for ; Wed, 17 May 2023 02:40:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=cMEopXpC; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: peron.clem@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3f50020e0f8so56363285e9.0 for ; Wed, 17 May 2023 02:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684316452; x=1686908452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6H2S7ST78v5hZZNUEwMOJpRiJH9Ts97Ij8a/ASG6OiQ=; b=cMEopXpCeK/IuakITVQDC8hSmIngJuud4UeXZ+mVADPUz9iM3VaYz2/B5lTGetxRbr aB3cbm0ZA0MQIkurEZcTkhRbmCQKjNS7TWWOCudxaLsYY6ylOOyLJ+r2C5wE7VgjyXhS ltIaJnnUrUGwltpCwvmkFTty6GstZyBT9JPoIbwegKlNDsrJRQimKXprwVVW6xkBmVs+ U46x7BCcKT4an5eLGB6Q2/77FGuX0Za6rhqdfbrwy07BbxvwXoLHCKZEgdmlACRcFBW0 c61DrH2eKsoyvN6qsvgxwaXteDkKLBcS4MbNYeSoGGszlu5igGAY8gTcjyKcyvxN2A58 KmHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684316452; x=1686908452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6H2S7ST78v5hZZNUEwMOJpRiJH9Ts97Ij8a/ASG6OiQ=; b=ITbWURHyjcAHapFAz516g154PvWN+cscRSFGrrh1IT8tFZ8UerDo0pXzI1opC6NTzJ bbGP5FBmGK6UwTCh+1ieNNF7c5A9omncrzU2rYY2Nnd4E5D8OeQ/CBfq6lc5EJPG8Ict zOsF6rvIc2G7DwoiyY3OwAk7o8spySvVjBPMIVOKU41Hdf67fYGizh399L2stNqjxobS lTpQRTI3s7bxyv3Ss68Nv2ShEi1BE5brUJo4Gnz4O9AlBm9wVr7O777YTahdIPzSZc7S cBgkya+gZP/H3EZcF9w51S6C0Z/YS4c6AsPYGkW7Y3LpdtFSHX6r22MehnGeqVYor0m4 1b6A== X-Gm-Message-State: AC+VfDxYJlXOkAfMp4n0UVNBT1T+wDfazakovZ+W3o3L3NyfWthspuzD niIXupQkt/gblb4eDdPO2hzo0FJQigluHw== X-Google-Smtp-Source: ACHHUZ5YJZUQJsdO6luF7MGXFv70i/hIOZsKNkeCwqxaKW6LcbcFEtvCBT4xNFTJY8oYJOLHEKT7/A== X-Received: by 2002:a05:600c:3513:b0:3f5:b15:87ee with SMTP id h19-20020a05600c351300b003f50b1587eemr1249243wmq.18.1684316452233; Wed, 17 May 2023 02:40:52 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id n16-20020a1c7210000000b003f19b3d89e9sm1590811wmc.33.2023.05.17.02.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 02:40:51 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: meta-arm@lists.yoctoproject.org Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v4 2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided Date: Wed, 17 May 2023 11:40:44 +0200 Message-Id: <20230517094044.84867-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517094044.84867-1-peron.clem@gmail.com> References: <20230517094044.84867-1-peron.clem@gmail.com> MIME-Version: 1.0 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 ; Wed, 17 May 2023 09:40:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4660 We access the dictionnary element that doesn't exist. Use the get() method instead that will default the element to None if it doesn't exist. Signed-off-by: Clément Péron --- scripts/runfvp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/runfvp b/scripts/runfvp index 939352b5..e4b00abc 100755 --- a/scripts/runfvp +++ b/scripts/runfvp @@ -55,8 +55,8 @@ def start_fvp(args, config, extra_args): fvp.start(config, extra_args, args.terminals) if args.console: - expected_terminal = config["consoles"]["default"] - if not expected_terminal: + expected_terminal = config["consoles"].get("default") + if expected_terminal is None: logger.error("--console used but FVP_CONSOLE not set in machine configuration") return 1 port_stdout, log_stdout = itertools.tee(fvp.stdout, 2)