From patchwork Thu Apr 6 15:29:07 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: 22319 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 12803C7618D for ; Thu, 6 Apr 2023 15:29:26 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web10.161503.1680794962190377680 for ; Thu, 06 Apr 2023 08:29:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tti1CkgY; spf=pass (domain: gmail.com, ip: 209.85.221.51, mailfrom: peron.clem@gmail.com) Received: by mail-wr1-f51.google.com with SMTP id d17so39888139wrb.11 for ; Thu, 06 Apr 2023 08:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680794960; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5q+blT60VkFVwUoMc6ps+Ve5jNFGXTq2DhzJY3KhgRs=; b=Tti1CkgYAJ/JDPeGHgPfDUMSzUhLnRRxx/nQ82wpW/OMq9hgiumn+g1FLhYZeEPME/ BfeUQNPhepKDlNC3zOO0FnYV0m1eRtd2ey/4kDjAbL2mPVyvBejPMjl7fWfdjthhWf5c Nqtf5FMv+rbAqfzaxFeJIgxGPXWFsmDu2A0liyWhaJKHsAzjiweA+aWc5wcK4igy1beX M/cIc1Id/er8vXAZTd0nWqbw01U6J/CTg7JAcDYOTeth3G40mumSa6bzGJyUfKdszExm tNH1OyQnuER9QS9K2g7icssMP4s4gATD7/z1zkwMVmH7yNKTKqJhcTJh79syFos8yc3z /qUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680794960; 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=5q+blT60VkFVwUoMc6ps+Ve5jNFGXTq2DhzJY3KhgRs=; b=q6UfaoIXXOlcRv2kFXrwZLfb3oFVhnXeOaq9QS/RCmGS8h4PGvPGFw6Sei30Ok4KPu yhJww9zAYHiZ81/qLLSZ95WlhhKE+sG6wQ0QPtTyYBGwYWSpE+OYOz5yyl1CiV00yciC HAu3Bzt8EjqLMEK+6HgqaGKGwqAWSds9KilSIOpdRXLLyfJgx0uMlLxh/sll59b/fvnS ord+JdzIM7tta3LVO3vEeACfba5wHdMX+1laHPY8MUnl99TLRuPjxXqMoVwzfn8HOJ9l wrWBMMSwmRquKZ+yGtXtYwga5xn7BsOzL0FtjV/0999DwNOg77CWdY6z2FrAqC/5HpQu s5Ng== X-Gm-Message-State: AAQBX9czr/e441ze1y389030VbnEQUyxi5W6I5c5rh7lICE70Q0Z+Iuq 7ML/ahjOGizFcx7BpAC653KM0IpbR1A= X-Google-Smtp-Source: AKy350ZyrUr1PD0NStbH46rQHuyuEejFZckq5SbrXEslPLTfPbd2sc3KYqU/jnLdEfb33uM1dkSSaw== X-Received: by 2002:a05:6000:8a:b0:2de:a953:6b05 with SMTP id m10-20020a056000008a00b002dea9536b05mr6316238wrx.67.1680794960266; Thu, 06 Apr 2023 08:29:20 -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 n5-20020a5d4845000000b002e5f6f8fc4fsm2006729wrs.100.2023.04.06.08.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:29:19 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: meta-arm@lists.yoctoproject.org Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v2 1/2] arm/lib: pass the PATH to fvp runner Date: Thu, 6 Apr 2023 17:29:07 +0200 Message-Id: <20230406152908.224075-1-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.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 ; Thu, 06 Apr 2023 15:29:26 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4560 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 | 4 ++-- 2 files changed, 3 insertions(+), 3 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..7e0d7808 100644 --- a/meta-arm/lib/oeqa/selftest/cases/runfvp.py +++ b/meta-arm/lib/oeqa/selftest/cases/runfvp.py @@ -108,7 +108,7 @@ class RunnerTests(OESelftestTestCase): stderr=unittest.mock.ANY, env={"FOO":"BAR"}) - @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 +128,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 Thu Apr 6 15:29:08 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: 22318 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 1456DC77B6F for ; Thu, 6 Apr 2023 15:29:26 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.web10.161507.1680794964456609395 for ; Thu, 06 Apr 2023 08:29:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J9l5m1w6; spf=pass (domain: gmail.com, ip: 209.85.221.41, mailfrom: peron.clem@gmail.com) Received: by mail-wr1-f41.google.com with SMTP id m2so39907367wrh.6 for ; Thu, 06 Apr 2023 08:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680794963; 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=rNjmtVVIqxse4q9ZGPYNjB1qJnGJm1e9g0B1e11A/44=; b=J9l5m1w6UVOrW4nkstkoffxV8mjDz05lez8/gIWXLSwZVDytFVBJxP+qQxHQ2hKOPX OJ5PAzeTuCfLOaEm9IAOWZ0PncmcajthPdKJ+3wpoRENeqBMoBLvnX9B/wzt73LDKXF2 6mCskZR+m/L+RO7+wDvB/zbOUBRd5i/e+nS+Ropm3dqvxjbUIarqrm0FAe6VHmTs4U1T EwSuptd8JuXTk5MWqdquhn4Bxg8sZ5Jl7MmOgmYQyHwcoyVjY0W0Fz+hVwT05cruGh88 0RxlVW2J+gIkOfe/hbuGesoeUJjiCrhIx3wOAZ2X2N+Xmr4tAi5i8i8OTfDBF2XquAGd IAeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680794963; 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=rNjmtVVIqxse4q9ZGPYNjB1qJnGJm1e9g0B1e11A/44=; b=Bu20LMbInI136d0Yh7ml/ZjyrQhDwJNQ3fYUnEPNL/9zwR7/pDRbVmPz6nh/kMQmqQ hUZlg7LZvzDt1XBzSXIqbPyHJguribYEAvLWqnnUGuEeIRHBIUqDBFBxTlVvqRaiZTvT TBRo8vt7f3WvxYamn5EDq94bfskcDPKNco2dGMZNlBa3YLRZth1wnrxqELqpJjAy7Vy/ n4q2acfXQ1ripX5JrVzRMi+1tD0giq3e4V0Ol/O6tjAXAMlMs/G+Rf+AKJ2SWGh8M0er b/I8/p5OqCw+895PtuKZcqf7lBt+ZQ6oOR9lF6DsferTWEcV1flRcXXc37JfGBvrsqei /sTQ== X-Gm-Message-State: AAQBX9dD+1tj/5W9H/8z5ge/l226D2ScJRBHdFujZi8TzEcHGG+0pROQ UJqAETFWMqgrbHMwXy3ZE+fj7+LbaIE= X-Google-Smtp-Source: AKy350ZjAyf3FEIkEPfOK8mrF0h4Ibv0R6aY0nXPCAKiilFhuJsLsQq3L/3t3SKqlzGJaZ3Ts7yxDg== X-Received: by 2002:a5d:570c:0:b0:2cf:e517:c138 with SMTP id a12-20020a5d570c000000b002cfe517c138mr7557176wrv.66.1680794962592; Thu, 06 Apr 2023 08:29:22 -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 n5-20020a5d4845000000b002e5f6f8fc4fsm2006729wrs.100.2023.04.06.08.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 08:29:22 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: meta-arm@lists.yoctoproject.org Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v2 2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided Date: Thu, 6 Apr 2023 17:29:08 +0200 Message-Id: <20230406152908.224075-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230406152908.224075-1-peron.clem@gmail.com> References: <20230406152908.224075-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 ; Thu, 06 Apr 2023 15:29:26 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/4561 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/runfvp b/scripts/runfvp index 939352b5..bfd60d71 100755 --- a/scripts/runfvp +++ b/scripts/runfvp @@ -55,8 +55,9 @@ 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: + fvp.add_line_callback(lambda line: logger.debug(f"FVP output: {line}")) + 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)