From patchwork Mon Mar 27 15:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Quaresma X-Patchwork-Id: 21828 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 87ECEC76195 for ; Mon, 27 Mar 2023 16:00:20 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web10.39601.1679932816226119286 for ; Mon, 27 Mar 2023 09:00:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QYCBK4xp; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: quaresma.jose@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id t17-20020a05600c451100b003edc906aeeaso5086433wmo.1 for ; Mon, 27 Mar 2023 09:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679932814; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1rp9AGKie5i659qJ94RFxQUzkqcfw1jgowTdxTwTGU8=; b=QYCBK4xpiF3vY+FgRicT4gu4a7wxpFkdOLCCOfvldIlKPHM6WIHLobiq3/NYJUwi2Y QRRA7IAk0vhyYAxU2idtWYQNmnRUxG90umdCyqrS6V82Oq/yAVfTq9HXrBUlAhtLoMU5 gA/5HLgWXZ5Ri1dXZT9K4Xp1dzDQr8dwrCL0WBUp0k0BXl6XthNJW56lKQtjNjVd/ZOQ 0RbZ3osbBPG/Qt+jPt6Ef75k/KbUJYjwCVJJn1kvKLU8t6QUUbHt5fBGGf9Du89FCf9v lik6Ru7E3/GEzrWRFmnH32URiqUAy5r6ko+XmjpUs9Qv5HsfjbOhrlzAJRKJTCD8vaUT w68w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679932814; 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=1rp9AGKie5i659qJ94RFxQUzkqcfw1jgowTdxTwTGU8=; b=sE498BtDwH5Imp6TmR77g/2mm0QOvSh6xAp1JDTd5NR/sluK+iF90h+Soi64JJqLDJ yT6qNxgOrEHW1q7QeGUlgnU3tProMRLdx+pRp+49UwouNurDFsD9QQA5ScixBwKERNdX tnWoU5I6eL7k3T1m/eeKS/ypiNmpOW9eQbRQJAQWnI+Y+mRrqqnb6KjPINUR046ImQoB V0zMnN/tTPQnr4jjHurdzIPfUDvOxpPrXJQh3WNup4+eXus4FVVnIiVxV3N8PGIFt6Na lOSS+m2ml02QYqnYlr6+Syo/KpV1W7daZeqNrA6C8oRpaa/c7RaKggdLBmOzAPbIueSh EGmw== X-Gm-Message-State: AO0yUKWQkg6KdSFPyHRJguq36db7kOu0+pZousnkZauWUcxOVcQED4yW xS3B4My2FtTvDYc5KdQ03bc3P/vMl2Ot9A== X-Google-Smtp-Source: AK7set+MwdBiCyLNEVD3ADzxihYlPhoWgs2wiBnTFUI6j7BEhoDeVruny9PfhiBOKHldmPkgbj7R6A== X-Received: by 2002:a7b:cbc2:0:b0:3df:de28:f819 with SMTP id n2-20020a7bcbc2000000b003dfde28f819mr10055603wmi.15.1679932814349; Mon, 27 Mar 2023 09:00:14 -0700 (PDT) Received: from og-worker-dev-01.infra.foundries.io.net (51-159-19-113.rev.poneytelecom.eu. [51.159.19.113]) by smtp.gmail.com with ESMTPSA id e8-20020a05600c218800b003ede06f3178sm14096726wme.31.2023.03.27.09.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 09:00:13 -0700 (PDT) From: Jose Quaresma X-Google-Original-From: Jose Quaresma To: openembedded-core@lists.openembedded.org Cc: Jose Quaresma Subject: [PATCH 1/2] OESelftestTestContext: replace the os.environ after subprocess.check_output Date: Mon, 27 Mar 2023 15:59:36 +0000 Message-Id: <20230327155937.460133-1-jose.quaresma@foundries.io> 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 ; Mon, 27 Mar 2023 16:00:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/179165 No function change but is needed to simplify the next patch. Signed-off-by: Jose Quaresma --- meta/lib/oeqa/selftest/context.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index ab13131f29..adfb1170db 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py @@ -97,17 +97,17 @@ class OESelftestTestContext(OETestContext): oe.path.copytree(builddir + "/cache", newbuilddir + "/cache") oe.path.copytree(selftestdir, newselftestdir) + subprocess.check_output("git init; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True) + + # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow + subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) + for e in os.environ: if builddir + "/" in os.environ[e]: os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/") if os.environ[e].endswith(builddir): os.environ[e] = os.environ[e].replace(builddir, newbuilddir) - subprocess.check_output("git init; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True) - - # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow - subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) - os.chdir(newbuilddir) def patch_test(t): From patchwork Mon Mar 27 15:59:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jose Quaresma X-Patchwork-Id: 21827 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 895E0C761A6 for ; Mon, 27 Mar 2023 16:00:20 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.39629.1679932818812677002 for ; Mon, 27 Mar 2023 09:00:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eOuWbLKs; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: quaresma.jose@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id u11-20020a05600c19cb00b003edcc414997so5661260wmq.3 for ; Mon, 27 Mar 2023 09:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679932817; 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=kuFhfOa812HKvAKMsnohKt75GGL7AHrrzM7RN1x0Q0g=; b=eOuWbLKsoVRTOFujdzW1gupnpRnuOQMtApgOZNeOL+WQf700TSMMPrjEmICkNiB1+L DV+KlpDrzw/SmGDhccJTEJrDURZOnLSHmdRuBnrb58Xf7ZdsD2Kdk4U0SagTwRUnVpCY EfINC2lJ+8kXDCSSRJ7UORj3zVQ5gpVDqtaeFqDaeRjMwq0o322cWFXUnGe4aLnqW9aM XqJKm3kfedDo67RjTghjr7Va2impT7T16oKCO46lKTGp8cnXz56CioZqHyeXyWVRvTmK ZdTIYQ6T3537Y6HceSLXxudToLH/Jmb9PFRJPE458+sCDWL1r4MK8P9xxquCUZKhBmWp s7Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679932817; 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=kuFhfOa812HKvAKMsnohKt75GGL7AHrrzM7RN1x0Q0g=; b=qhoP3qsamtThY73XsA86xtFVZpbVSr7Jlb7eEZ/Y1aEl7ZNhCK8J2nXe0w29ESeOqo zjg3HbnKBrs92zp89zQgRdQyxVLnpC0WCUIJHT3+PkXnWefqOj28Jj/FLJMqMSG+UqF4 uAHbUMbHFDawpF3TABhsHnyWRviGfUNdCZO20FHK6WYt9dwJDFWYTBtawbnuQAmqoy4M d03sjqj+KTiEmymj7GJCK1RtLLcI4YCv78/f1grM5SQtCYhDLBTgolg2WH87i5tw2GvD fxkBfv9FVx+Kc2b28toYJzo9CZr44O5sSrWz04LLvwyD5Co+3xWa8GX4SnlMTKdlUL9P fLoA== X-Gm-Message-State: AO0yUKVS7rDeFGq9vojzJbPClZfxTW8iQ7iSFF3VFT02RygxbpNDKKF4 qw/V86g+Dr3q4twLdLwFR+CT4CNZZHeIAQ== X-Google-Smtp-Source: AK7set/O1m2/Il9vihtK3aVvlchPzVLTGD8J97+LLZGetNI5gCj/DcF4W3Z4tL/jei3KnAeCdboxUQ== X-Received: by 2002:a1c:4b07:0:b0:3eb:2b88:a69a with SMTP id y7-20020a1c4b07000000b003eb2b88a69amr9714133wma.14.1679932816994; Mon, 27 Mar 2023 09:00:16 -0700 (PDT) Received: from og-worker-dev-01.infra.foundries.io.net (51-159-19-113.rev.poneytelecom.eu. [51.159.19.113]) by smtp.gmail.com with ESMTPSA id e8-20020a05600c218800b003ede06f3178sm14096726wme.31.2023.03.27.09.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 09:00:16 -0700 (PDT) From: Jose Quaresma X-Google-Original-From: Jose Quaresma To: openembedded-core@lists.openembedded.org Cc: Jose Quaresma Subject: [PATCH 2/2] OESelftestTestContext: convert relative to full path when newbuilddir is provided Date: Mon, 27 Mar 2023 15:59:37 +0000 Message-Id: <20230327155937.460133-2-jose.quaresma@foundries.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327155937.460133-1-jose.quaresma@foundries.io> References: <20230327155937.460133-1-jose.quaresma@foundries.io> 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 ; Mon, 27 Mar 2023 16:00:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/179166 Relative paths in BBLAYERS only works when the new build dir are on the same ascending directory node: . ├── build ├── build-st It works because they share the same ascending relative directory node. So use the full path when the argument newbuilddir is provided to make the oe-selftest work everywere regardless of the location chosen. Signed-off-by: Jose Quaresma --- meta/lib/oeqa/selftest/context.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index adfb1170db..0a7a9da72a 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py @@ -102,6 +102,16 @@ class OESelftestTestContext(OETestContext): # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) + # Relative paths in BBLAYERS only works when the new build dir share the same ascending node + if self.newbuilddir: + bblayers = subprocess.check_output("bitbake-getvar --value BBLAYERS | tail -1", cwd=builddir, shell=True, text=True) + if '..' in bblayers: + bblayers_abspath = [os.path.abspath(path) for path in bblayers.split()] + with open("%s/conf/bblayers.conf" % newbuilddir, "a") as f: + newbblayers = "# new bblayers to be used by selftest in the new build dir '%s'\n" % newbuilddir + newbblayers += 'BBLAYERS = "%s"\n' % ' '.join(bblayers_abspath) + f.write(newbblayers) + for e in os.environ: if builddir + "/" in os.environ[e]: os.environ[e] = os.environ[e].replace(builddir + "/", newbuilddir + "/")