From patchwork Mon Jun 6 15:58:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8943 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 10816C43334 for ; Mon, 6 Jun 2022 15:58:25 +0000 (UTC) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by mx.groups.io with SMTP id smtpd.web11.6.1654531095898287330 for ; Mon, 06 Jun 2022 08:58:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WK8l/xly; spf=pass (domain: gmail.com, ip: 209.85.208.175, mailfrom: ptsneves@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id y15so10833376ljc.0 for ; Mon, 06 Jun 2022 08:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FI+Ba/Nd5qll1yZ+zqW2gvsDrb1buXJ9ijvgeYUH6WM=; b=WK8l/xlyW/CTJMMhrytej7rya/NCgXSQmzgiqbABQTMQFx4IOKvq1HQlKmlLcaRgb+ 50tORS1umlWc+QVPSU4quL66KAaq1Qa9pPdldqxTjEstn82dL5cbuOVuHhb8epUG4X8p rEuY7fc+2gS11QXsiYJas+M2Q4Q1/mAgUEnMntt/o1/W13+xuUYOWpYTEn0SfXIOxas8 QCipQzlGMJDbtjW17tZE4wpSBvcaXpHz+/2JqUuPwMaOvsLQ1SeBFSJKI5zX6ptbyFWa RL4N3FkvLqbqqoJPk20xEstco/Dqszq/Oq7a710oZCmkVWFS+btPpzbS54+M1kJ/0xvm y+mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FI+Ba/Nd5qll1yZ+zqW2gvsDrb1buXJ9ijvgeYUH6WM=; b=srNXwMVjrxSx4cGEaNOF+NRLefud0gR3JVOMoLEa2fPs0tIYc881HZXTGk5h0AxAbj I4RcSwLsuuseirq5vI6zLVebKKOp93w0LbIFsD4pYgB1QzkuwX4XUdC0eu2vPKZE9nqk ROK7N2V/mRpQQvfuXkqa6K1UrI9bbFgOVSiB2zvcGrqk5HKdlTNfmEO0yYXrfuYNdCwH C3tbjj9mLsk85dDrkzzQQ4lSEnl4Y3CUtkpuwugbR+8XcCluxnmLGa3nlE0OcuHyZlgU UldYXjzi2brzo+ld4Dd0VBh0eJYEdTCwWnziWyWdJoulCiI2qzpQlbEttmeH2OJKuJYV kzuA== X-Gm-Message-State: AOAM532dHYCN93IT0R6up3fT8uEPfZghmcBVCeAi6ZvqE504k+FKLZ/z FV5NleTefMvbRxuc6ivqvZ1H+zvhQA== X-Google-Smtp-Source: ABdhPJwZcuyvf/+szPUzcDwkuY2pkkMnf8C3DVaifmAVFdN2E39YXRRN+Ug8qZ/XHv3rgU++FmeAeQ== X-Received: by 2002:a2e:9682:0:b0:255:7b9f:6e8a with SMTP id q2-20020a2e9682000000b002557b9f6e8amr10402524lji.19.1654531093964; Mon, 06 Jun 2022 08:58:13 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id l10-20020a056512110a00b004791c4858e0sm1595074lfg.114.2022.06.06.08.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:58:13 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH 1/3] insane.bbclass: Make do_qa_staging check shebangs Date: Mon, 6 Jun 2022 17:58:05 +0200 Message-Id: <20220606155807.1414519-1-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.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, 06 Jun 2022 15:58:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166651 As reported in the bug report [1], there was no check for shebang sizes on native scripts and now this is fixed. The path scope of qa_staging needed to be increased from just checking libdir to all the relevant SYSROOT_DIRS. It is possible to skip this check through INSANE_SKIP. [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11053 --- meta/classes/insane.bbclass | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 9ca84bace9..dd0cf2a769 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -630,6 +630,11 @@ def qa_check_staged(path,d): bb.note("Recipe %s skipping qa checking: pkgconfig" % d.getVar('PN')) skip_pkgconfig = True + skip_shebang_size = False + if 'shebang-size' in skip: + bb.note("Recipe %s skipping qa checkking: shebang-size" % d.getVar('PN')) + skip_shebang_size = True + # find all .la and .pc files # read the content # and check for stuff that looks wrong @@ -651,6 +656,13 @@ def qa_check_staged(path,d): error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) oe.qa.handle_error("pkgconfig", error_msg, d) + if not skip_shebang_size: + errors = {} + package_qa_check_shebang_size(path, "", d, None, errors) + for e in errors: + oe.qa.handle_error(e, errors[e], d) + + # Run all package-wide warnfuncs and errorfuncs def package_qa_package(warnfuncs, errorfuncs, package, d): warnings = {} @@ -1139,7 +1151,9 @@ addtask do_package_qa_setscene python do_qa_staging() { bb.note("QA checking staging") - qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d) + sysroot_destdir = d.expand('${SYSROOT_DESTDIR}') + for sysroot_dir in d.expand('${SYSROOT_DIRS}').split(): + qa_check_staged(os.path.join(sysroot_destdir, sysroot_dir), d) oe.qa.exit_with_message_if_errors("QA staging was broken by the package built above", d) } From patchwork Mon Jun 6 15:58:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8944 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 2B9DACCA473 for ; Mon, 6 Jun 2022 15:58:25 +0000 (UTC) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mx.groups.io with SMTP id smtpd.web10.9.1654531099233859382 for ; Mon, 06 Jun 2022 08:58:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WsZwAs+q; spf=pass (domain: gmail.com, ip: 209.85.208.169, mailfrom: ptsneves@gmail.com) Received: by mail-lj1-f169.google.com with SMTP id b7so3715637ljr.6 for ; Mon, 06 Jun 2022 08:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NRfND8n6zeQEvt6wfaC5qOGgd/dhzG8dytXHSCo9Vyg=; b=WsZwAs+qAAUyPSHP9QbcL73b22gsg03pRsfck8yMEniMQ7T5KShU++nqhCGcIARdMx T3S/vMpFzsTZgUwJ9VP65Cy3jR9B9nNg+VXC8bl3++01DgrkIVMjjgHroqAKFeezUR46 wKoVE0mTmDr/eOyHF4fqJhnY1jhfuLP8QU1r6gtTkkgDigo3OJTmZY437OkNHjnIj4hd Q48bPSwB9swqBvncYOTraIA2rUNFkcB6dvExXxf5+XwOU8tbdp43lyWaBuVMDsqjPjIG KtmGq4+R6XzxTSHSInPHQNeT4iJ0yTSi/leoDUdcMHc5nAKPVNa28ToB2j3sVOmudoY8 NLyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NRfND8n6zeQEvt6wfaC5qOGgd/dhzG8dytXHSCo9Vyg=; b=brKoGdW39Yb+M+tSTKk3cNFLMOyFVzGqenVJtfKP9woMsdkQ+jvI+fLNMGQ04PI7at q6y6No333EMRM1gsi08gke6XoYn4SoB6CaiV/mBs8ofYGC/sBkWGBqJqE4ftlHW9DsEg V5cwM0FuIoObI4n20Y6E/u5MOz3LPUeheoxv2HAO1cjE4ySMhkAtGoTlVe6Ns7ZaSsEa SSZEPjlRAhbZet6JBY3kmGTv7IU56MOQuCz7mL05FdSRoa9drFAEGvevxRpygaMP2BBz gpVZrpdqEhEH1Da6jSTRfzKtkyVSyOMnlGuoB4cUCBsaqSUte0Cw7ikqLSIM/+yPjQil OnoA== X-Gm-Message-State: AOAM533StDD0YrQaK1w41hAfHN8K1WauoI+N5irzWtTBgl/BGVA9AAjn w0R/dsM6F4Tkd7jC3+CLw3essx9CAg== X-Google-Smtp-Source: ABdhPJzERQ93ktYoSATY/VLf80k60X5gIra2KUDRyt1SKQh3VHEW8pxC7wD/ErkFV6hB43VeP5Tm0w== X-Received: by 2002:a2e:508:0:b0:255:66fb:9fce with SMTP id 8-20020a2e0508000000b0025566fb9fcemr16342065ljf.171.1654531097613; Mon, 06 Jun 2022 08:58:17 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id l10-20020a056512110a00b004791c4858e0sm1595074lfg.114.2022.06.06.08.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:58:17 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH 2/3] oeqa/selftest: Add test for shebang overflow Date: Mon, 6 Jun 2022 17:58:06 +0200 Message-Id: <20220606155807.1414519-2-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220606155807.1414519-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@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 ; Mon, 06 Jun 2022 15:58:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166652 Make sure we do not stage any executable with a bigger shebang than 128. Fixes [1] [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11053 --- .../sysroot-test/sysroot-shebang-test_1.0.bb | 12 ++++++++++++ meta/lib/oeqa/selftest/cases/sysroot.py | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb new file mode 100644 index 0000000000..6c834be897 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Check that shebang does not exceed 128 characters" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" +do_install() { + install -d ${D}${bindir} + echo '#!BiM3cnVd1Amtv6PG+FynrQiVMbZnX5ELgF21q3EkuB+44JEGWtq8TvBJ7EGidfVs3eR3wVOUbLnjYDlKUWcm7YC/ute7f+KDHbwxziRUSUBZAUqgjiQdfQ0HnxajI0ozbM863E9JV9k13yZKYfh9/zR77Y6Dl4Dd3zOWS75LSpkAXV' > ${D}${bindir}/max-shebang + chmod 755 ${D}${bindir}/max-shebang +} + +BBCLASSEXTEND = "native" diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py index 315d1a61c2..9457f1e3ac 100644 --- a/meta/lib/oeqa/selftest/cases/sysroot.py +++ b/meta/lib/oeqa/selftest/cases/sysroot.py @@ -35,3 +35,13 @@ TESTSTRING:pn-sysroot-test-arch1 = "%s" TESTSTRING:pn-sysroot-test-arch2 = "%s" """ % (uuid1, uuid2)) bitbake("sysroot-test") + + def test_sysroot_max_shebang(self): + """ + Summary: Check max shebang triggers. To confirm [YOCTO #11053] is closed. + Expected: Fail when a shebang bigger than the max shebang-size is reached. + Author: Paulo Neves + """ + expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" + res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) From patchwork Mon Jun 6 15:58:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8942 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 0FC61C433EF for ; Mon, 6 Jun 2022 15:58:25 +0000 (UTC) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mx.groups.io with SMTP id smtpd.web10.9.1654531099233859382 for ; Mon, 06 Jun 2022 08:58:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AtbRC66q; spf=pass (domain: gmail.com, ip: 209.85.208.169, mailfrom: ptsneves@gmail.com) Received: by mail-lj1-f169.google.com with SMTP id b7so3715637ljr.6 for ; Mon, 06 Jun 2022 08:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AwuFuVIotauytERcW3KjdycidVWpyW/0IL4KZRC/B5E=; b=AtbRC66qGPOI4A9qAJnLFk3TdNc9pgJ6lG7BVFBgNXz9DGsfV1rUBpgKR+lLy8slYz RP+cYgf/TBa1dXr3R+rovkz70eXtjvYOTyjrX6cQyy2aYwpLxvnFhxnG21jopFl4/9aR N+n2B3kQgImsgPom5UoLFDAaDSV77NSx6Igxz58Mox5FnJZHxR3FiJmWzoLStAVyIWTj YzkxuTpdyCDQEEk/mg4EZaH4nwV69jx0nMQmhiHo9tdrnga0Qoo57/+bK02JSuTnMN/q P+x1YuuuTQ+a1ZXJ7T4IYs6//rGZh5DOmzaeljWr+CG5X7N9/zuFUYZjHQ+L8ckktUIu FONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AwuFuVIotauytERcW3KjdycidVWpyW/0IL4KZRC/B5E=; b=HSM4DZPPHO2u+TFe8ymJ8IOjlH//bdI3gP3gkuwsTBgoz8Nw8FwTXjK8ZqFjBrUsQl mcYyA6g9jkAFQh+XSoV4lkcumemCsD8OHrl73v+RzmPEIqGt7v4LSrImyotWx+E0qDQT afq78CUVK7ZBWxBE0sjPq2WKl7HP3W0Q/f6Fa4cQSBppKxn4eDEYHkAEvi06rZSzAw0n zZ4OuOVsATzJTvqQwI/uJaR4gpwjIJPlf05Ti4vgzIm2qrBZSmchg4pgffbX0OMGDNCE kG6brwAUwl3cLa4FspwNorRzBsVKk6KRIuTcuzyB9K+HofjpAqATAiM7JUq9Z7dKrwV+ QjSQ== X-Gm-Message-State: AOAM530PwNapBB/H49SN3Jx9YxnFqpw1ZELxdGyTs/hLvSSFBhF7Y+o8 pA1njIpy+vfVqOd0XgSZXgGGmzIiTQ== X-Google-Smtp-Source: ABdhPJzBHUvXcvcxwvxNQ8uqTC3p3Sao3nnJjUx0q5DrPWT4CSHCN2ukxwDp9nT8MbxLfhR4xNLjBA== X-Received: by 2002:a2e:8919:0:b0:255:5b60:e8b7 with SMTP id d25-20020a2e8919000000b002555b60e8b7mr18962880lji.294.1654531099736; Mon, 06 Jun 2022 08:58:19 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id l10-20020a056512110a00b004791c4858e0sm1595074lfg.114.2022.06.06.08.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:58:19 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH 3/3] oeqa/selftest: Test staged .la and .pc files Date: Mon, 6 Jun 2022 17:58:07 +0200 Message-Id: <20220606155807.1414519-3-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220606155807.1414519-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@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 ; Mon, 06 Jun 2022 15:58:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166653 These files are checked by qa_check_staged but there was no test cases for whether the tests actually worked. Now there are. --- .../sysroot-test/sysroot-la-test_1.0.bb | 16 ++++++++++ .../sysroot-test/sysroot-pc-test_1.0.bb | 12 +++++++ meta/lib/oeqa/selftest/cases/sysroot.py | 32 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb new file mode 100644 index 0000000000..21f06782fb --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb @@ -0,0 +1,16 @@ +SUMMARY = "Produce a broken la file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +# remove-libtool.bbclass is inherited by default and removes all +# .la files which for this test we specifically do not want. +REMOVE_LIBTOOL_LA = "0" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/la-test.la +} + +BBCLASSEXTEND += "native" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb new file mode 100644 index 0000000000..e748310fc4 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Produce a broken pc file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/test.pc +} + +BBCLASSEXTEND += "native" diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py index 9457f1e3ac..588fc8c713 100644 --- a/meta/lib/oeqa/selftest/cases/sysroot.py +++ b/meta/lib/oeqa/selftest/cases/sysroot.py @@ -45,3 +45,35 @@ TESTSTRING:pn-sysroot-test-arch2 = "%s" expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) self.assertTrue(expected in res.output, msg=res.output) + + def test_sysroot_la(self): + """ + Summary: Check that workdir paths are not contained in .la files. + Expected: Fail when a workdir path is found in the file content. + Author: Paulo Neves + """ + expected = "la-test.la failed sanity test (workdir) in path" + + res = bitbake("sysroot-la-test -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[la]' in res.output, msg=res.output) + + res = bitbake("sysroot-la-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[la]' in res.output, msg=res.output) + + def test_sysroot_pkgconfig(self): + """ + Summary: Check that tmpdir paths are not contained in .pc files. + Expected: Fail when a tmpdir path is found in the file content. + Author: Paulo Neves + """ + expected = "test.pc failed sanity test (tmpdir) in path" + + res = bitbake("sysroot-pc-test -c populate_sysroot", ignore_status=True) + self.assertTrue('[pkgconfig]' in res.output, msg=res.output) + self.assertTrue(expected in res.output, msg=res.output) + + res = bitbake("sysroot-pc-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[pkgconfig]' in res.output, msg=res.output) From patchwork Tue Jun 7 15:11:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8982 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 E00EDC43334 for ; Tue, 7 Jun 2022 15:11:51 +0000 (UTC) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by mx.groups.io with SMTP id smtpd.web11.13500.1654614705467326818 for ; Tue, 07 Jun 2022 08:11:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WDOEIeoU; spf=pass (domain: gmail.com, ip: 209.85.167.53, mailfrom: ptsneves@gmail.com) Received: by mail-lf1-f53.google.com with SMTP id be31so28828392lfb.10 for ; Tue, 07 Jun 2022 08:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uAMPa++ia1KnffFugYvd8o2vuvtd+oNHzbTD5UJLnpo=; b=WDOEIeoUAH4O0v6chDLp94tMmcG0OK9/6fGzRfagdqnPfzI4bt9/FJL6e1TmAmV50m qDoa81O94aB1gWzxfeuI4J9g+n0LQ+1sAJXGwHNbTl8S0aQeSoIg/n5y2dflcYvNBTw1 vFQHfWwnEdvDEIvjSmaKvTnGDpe9TWxdp0IVVinlNZ73SlVchJyrOAklXTDttaIDetYu 6z50Fn47I/BfueqvGj8XU4AlHgnKYgQosSBbUMiCkm49P+5d18KZaxYmH0myvVpfucx8 w3JTBq8G4qp79qyJhdc+zIMg9jnTju/Lndp/bcLD+3eft2vkg4/lnHZbm40vlLf2HDwh O80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uAMPa++ia1KnffFugYvd8o2vuvtd+oNHzbTD5UJLnpo=; b=RUce+azxopVQTR0KHkXUJkiQdqy7ES7zIrv/FLSb8QvO9dqsK2aGCtenJ5e+7g7hfm B1o9Gd8BR2E/9/l8Ju8vLeOd8mrQcYKYuaoI07i9sRuU+20W01lHqXOv+46GTDZAK7Pi G0JkFZWomBChmDiTGPx7aq5ZSxd/N2tY4I0r6Af8asmEK2uZMW1PeSn8wWh8fjV+VZ7e o7gMNXEhfxTvKemvcNE0ve3HKAuRzWU+0mKJWisE5hYyKrpeVSHwLioypRarAm7NXQiB NNUENG4xdnhMH83aC9GmzaV2Cj+svfIGi4po+PUqa/W9cayqYWlvvIQvmAlnc+hq/4c5 rayg== X-Gm-Message-State: AOAM530j4K/yGEHI32KfAXwJoSDKYUh3xDcbQY9nMuLAz1yzymuLCwdH cvgM0uflZZyG1Lw/YVQVieWTjpF0bg== X-Google-Smtp-Source: ABdhPJyIRzKagE1OpExVNaWvIle3lhsuFjMrEwjXmtmuzIPfgRggv+bOk2ndj4NVq8ptK4FsyA6bVQ== X-Received: by 2002:a05:6512:234f:b0:479:100e:1ce9 with SMTP id p15-20020a056512234f00b00479100e1ce9mr17215700lfu.192.1654614703725; Tue, 07 Jun 2022 08:11:43 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id i8-20020a05651c120800b002556e0248dbsm2831089lja.124.2022.06.07.08.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:11:43 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH v2 4/5] oeqa/selftest: Add test for shebang overflow Date: Tue, 7 Jun 2022 17:11:22 +0200 Message-Id: <20220607151123.3588947-4-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607151123.3588947-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@gmail.com> <20220607151123.3588947-1-ptsneves@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 ; Tue, 07 Jun 2022 15:11:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166673 Make sure we do not stage any executable with a bigger shebang than 128. Fixes [1] [1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=11053 Signed-off-by: Paulo Neves --- .../sysroot-test/sysroot-shebang-test_1.0.bb | 12 ++++++++++++ meta/lib/oeqa/selftest/cases/sysroot.py | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb new file mode 100644 index 0000000000..6c834be897 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-shebang-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Check that shebang does not exceed 128 characters" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" +do_install() { + install -d ${D}${bindir} + echo '#!BiM3cnVd1Amtv6PG+FynrQiVMbZnX5ELgF21q3EkuB+44JEGWtq8TvBJ7EGidfVs3eR3wVOUbLnjYDlKUWcm7YC/ute7f+KDHbwxziRUSUBZAUqgjiQdfQ0HnxajI0ozbM863E9JV9k13yZKYfh9/zR77Y6Dl4Dd3zOWS75LSpkAXV' > ${D}${bindir}/max-shebang + chmod 755 ${D}${bindir}/max-shebang +} + +BBCLASSEXTEND = "native" diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py index 315d1a61c2..9457f1e3ac 100644 --- a/meta/lib/oeqa/selftest/cases/sysroot.py +++ b/meta/lib/oeqa/selftest/cases/sysroot.py @@ -35,3 +35,13 @@ TESTSTRING:pn-sysroot-test-arch1 = "%s" TESTSTRING:pn-sysroot-test-arch2 = "%s" """ % (uuid1, uuid2)) bitbake("sysroot-test") + + def test_sysroot_max_shebang(self): + """ + Summary: Check max shebang triggers. To confirm [YOCTO #11053] is closed. + Expected: Fail when a shebang bigger than the max shebang-size is reached. + Author: Paulo Neves + """ + expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" + res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) From patchwork Tue Jun 7 15:11:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Neves X-Patchwork-Id: 8983 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 E2098CCA47C for ; Tue, 7 Jun 2022 15:11:51 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web11.13499.1654614702373657478 for ; Tue, 07 Jun 2022 08:11:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OVkt1bAo; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: ptsneves@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id w20so7160059lfa.11 for ; Tue, 07 Jun 2022 08:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L214Ml3yzg5bNWzkvsSdrl1/Ke3TbE7wfxjnrdmaebs=; b=OVkt1bAozN1A68huMJBCod+aS6p9cE7mTjuG1eAiAP7Z+VvSeJ2zOlk7/wHddIXhh/ WG+JCiofNeABvoGKt96YB3MnrYSg3sJFhATyS/XN6Lsbw2uovjFISEWv8U5iurJqqw7w jurnULKTHN8gF5tB/tO+hG5+TMyXANIdCL0fNE87fJU3tefV9ZwmXDwJcsUh4+0rO8sH a+7JynBQX4sv599mej/0Elxtu9MsPX1GZRhyAIG6Mk6Oswcm4zQ8KfdNkhfqbmV1mcuj uaQlvcYjQvH1wm1VJW9UtVAe91ytzvn/gu7UlhxinifSHH4aVtFZPnshaFbhmpoO7dwk ndrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L214Ml3yzg5bNWzkvsSdrl1/Ke3TbE7wfxjnrdmaebs=; b=c7RD5XIGDvJKO/AMEVs351vlYtW1EF/ySPxdg3QtiupFxaA+b0aCxN8p+iW9SL9IkX N2zx3E+S/IZsySX6DybFiX+pt+1X5j18/h7fJmOj6CXmsNd5UeRfWqOVw0PS1V6Vxx0u a0GCG4PjuYekAAT4UbHa1X4wJ8bEEifOgdTEQ5KSy6+Hlhk+35wtaiOthcVtE3iCHzxk jA+U//a0ob6dG9W7CPCss/uqZnJ9gRLMCZRL83DlhPDBdyiUIPrdz2mppMA/KX8JNumK eigC50z9jZFbPkoOH5oYy1CLOeWv5/bCF5AyDtrx3qRVckfukoLyCkOKh28pYClhBKcG rb3w== X-Gm-Message-State: AOAM531SgfdV4AATJC1ASTCpKCrPuzJE1RAI9T3Rib2Q2bRXtbgyXdJl BGs6M0/NPQVWOsETCi5bBcf8zH0+uw== X-Google-Smtp-Source: ABdhPJws4Tt+L33g+vPHD/9ltmcRdihF3hOX6gGoEkOQ+oWlur4cCpq4vKQTbZtukGaoPHaIb26vag== X-Received: by 2002:a05:6512:3284:b0:479:d2:4792 with SMTP id p4-20020a056512328400b0047900d24792mr21435450lfe.357.1654614705414; Tue, 07 Jun 2022 08:11:45 -0700 (PDT) Received: from pneves-XPS-15-9550.sigma.local (85-128-83-172.static.ip.netia.com.pl. [85.128.83.172]) by smtp.gmail.com with ESMTPSA id i8-20020a05651c120800b002556e0248dbsm2831089lja.124.2022.06.07.08.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:11:44 -0700 (PDT) From: Paulo Neves To: openembedded-core@lists.openembedded.org Cc: Paulo Neves Subject: [PATCH v2 5/5] oeqa/selftest: Test staged .la and .pc files Date: Tue, 7 Jun 2022 17:11:23 +0200 Message-Id: <20220607151123.3588947-5-ptsneves@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607151123.3588947-1-ptsneves@gmail.com> References: <20220606155807.1414519-1-ptsneves@gmail.com> <20220607151123.3588947-1-ptsneves@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 ; Tue, 07 Jun 2022 15:11:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166674 These files are checked by qa_check_staged but there was no test cases for whether the tests actually worked. Now there are. Signed-off-by: Paulo Neves --- .../sysroot-test/sysroot-la-test_1.0.bb | 16 ++++++++++ .../sysroot-test/sysroot-pc-test_1.0.bb | 12 +++++++ meta/lib/oeqa/selftest/cases/sysroot.py | 32 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb create mode 100644 meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb new file mode 100644 index 0000000000..21f06782fb --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-la-test_1.0.bb @@ -0,0 +1,16 @@ +SUMMARY = "Produce a broken la file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +# remove-libtool.bbclass is inherited by default and removes all +# .la files which for this test we specifically do not want. +REMOVE_LIBTOOL_LA = "0" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/la-test.la +} + +BBCLASSEXTEND += "native" diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb new file mode 100644 index 0000000000..e748310fc4 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-pc-test_1.0.bb @@ -0,0 +1,12 @@ +SUMMARY = "Produce a broken pc file" +LICENSE = "CLOSED" +INHIBIT_DEFAULT_DEPS = "1" + +EXCLUDE_FROM_WORLD = "1" + +do_install() { + install -d ${D}${libdir}/test/ + echo '${WORKDIR}' > ${D}${libdir}/test/test.pc +} + +BBCLASSEXTEND += "native" diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py index 9457f1e3ac..588fc8c713 100644 --- a/meta/lib/oeqa/selftest/cases/sysroot.py +++ b/meta/lib/oeqa/selftest/cases/sysroot.py @@ -45,3 +45,35 @@ TESTSTRING:pn-sysroot-test-arch2 = "%s" expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) self.assertTrue(expected in res.output, msg=res.output) + + def test_sysroot_la(self): + """ + Summary: Check that workdir paths are not contained in .la files. + Expected: Fail when a workdir path is found in the file content. + Author: Paulo Neves + """ + expected = "la-test.la failed sanity test (workdir) in path" + + res = bitbake("sysroot-la-test -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[la]' in res.output, msg=res.output) + + res = bitbake("sysroot-la-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[la]' in res.output, msg=res.output) + + def test_sysroot_pkgconfig(self): + """ + Summary: Check that tmpdir paths are not contained in .pc files. + Expected: Fail when a tmpdir path is found in the file content. + Author: Paulo Neves + """ + expected = "test.pc failed sanity test (tmpdir) in path" + + res = bitbake("sysroot-pc-test -c populate_sysroot", ignore_status=True) + self.assertTrue('[pkgconfig]' in res.output, msg=res.output) + self.assertTrue(expected in res.output, msg=res.output) + + res = bitbake("sysroot-pc-test-native -c populate_sysroot", ignore_status=True) + self.assertTrue(expected in res.output, msg=res.output) + self.assertTrue('[pkgconfig]' in res.output, msg=res.output)