From patchwork Mon Sep 26 11:16:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 13254 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 C8F61C32771 for ; Mon, 26 Sep 2022 11:16:06 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.27430.1664190963777158855 for ; Mon, 26 Sep 2022 04:16:04 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 162521576; Mon, 26 Sep 2022 04:16:10 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EDCB83F66F; Mon, 26 Sep 2022 04:16:02 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 2/2] oeqa/runtime/dnf: use dnf-test packages Date: Mon, 26 Sep 2022 12:16:00 +0100 Message-Id: <20220926111600.1324000-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926111600.1324000-1-ross.burton@arm.com> References: <20220926111600.1324000-1-ross.burton@arm.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, 26 Sep 2022 11:16:06 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/171060 Instead of installing run-postinsts with it's postinst scripts causing systemd restarts, use the new dnf-test-* packages instead. Remove from the installroot tests entirely as they're exercised enough using just busybox. Rewrite the exclude test to be simplier now these packages are not going to be part of an existing dependency chain. [ YOCTO #14787 ] Signed-off-by: Ross Burton --- meta/classes-recipe/testimage.bbclass | 5 +-- meta/lib/oeqa/runtime/cases/dnf.py | 52 +++++++++++---------------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass index 819c7d2bf4c..5cc408b0c47 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass @@ -468,10 +468,7 @@ def create_rpm_index(d): package_list = glob.glob(idx_path + "*/*.rpm") for pkg in package_list: - if os.path.basename(pkg).startswith(("curl-ptest")): - bb.utils.remove(pkg) - - if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl", "musl")): + if not os.path.basename(pkg).startswith(("dnf-test-", "busybox", "update-alternatives", "libc6", "musl")): bb.utils.remove(pkg) bb.utils.unlockfile(lf) diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index e0b91090b20..410d456bdf1 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py @@ -75,48 +75,43 @@ class DnfRepoTest(DnfTest): def test_dnf_makecache(self): self.dnf_with_repo('makecache') - -# Does not work when repo is specified on the command line -# @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) -# def test_dnf_repolist(self): -# self.dnf_with_repo('repolist') - @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) def test_dnf_repoinfo(self): self.dnf_with_repo('repoinfo') @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) def test_dnf_install(self): - output = self.dnf_with_repo('list run-postinsts-dev') - if 'Installed Packages' in output: - self.dnf_with_repo('remove -y run-postinsts-dev') - self.dnf_with_repo('install -y run-postinsts-dev') + self.dnf_with_repo('remove -y dnf-test-*') + self.dnf_with_repo('install -y dnf-test-dep') @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) def test_dnf_install_dependency(self): - self.dnf_with_repo('remove -y run-postinsts') - self.dnf_with_repo('install -y run-postinsts-dev') + self.dnf_with_repo('remove -y dnf-test-*') + self.dnf_with_repo('install -y dnf-test-main') + output = self.dnf('list --installed dnf-test-*') + self.assertIn("dnf-test-main.", output) + self.assertIn("dnf-test-dep.", output) @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency']) def test_dnf_install_from_disk(self): - self.dnf_with_repo('remove -y run-postinsts-dev') - self.dnf_with_repo('install -y --downloadonly run-postinsts-dev') - status, output = self.target.run('find /var/cache/dnf -name run-postinsts-dev*rpm', 1500) + self.dnf_with_repo('remove -y dnf-test-dep') + self.dnf_with_repo('install -y --downloadonly dnf-test-dep') + status, output = self.target.run('find /var/cache/dnf -name dnf-test-dep*rpm') self.assertEqual(status, 0, output) self.dnf_with_repo('install -y %s' % output) @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk']) def test_dnf_install_from_http(self): - output = subprocess.check_output('%s %s -name run-postinsts-dev*' % (bb.utils.which(os.getenv('PATH'), "find"), + output = subprocess.check_output('%s %s -name dnf-test-dep*' % (bb.utils.which(os.getenv('PATH'), "find"), os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8") rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1] url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path) - self.dnf_with_repo('remove -y run-postinsts-dev') + self.dnf_with_repo('remove -y dnf-test-dep') self.dnf_with_repo('install -y %s' % url) @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) def test_dnf_reinstall(self): - self.dnf_with_repo('reinstall -y run-postinsts-dev') + self.dnf_with_repo('reinstall -y dnf-test-main') @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) @skipIfInDataVar('DISTRO_FEATURES', 'usrmerge', 'Test run when not enable usrmerge') @@ -139,7 +134,7 @@ class DnfRepoTest(DnfTest): self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) - self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath) + self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox' % rootpath) status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) self.assertEqual(0, status, output) status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) @@ -171,7 +166,7 @@ class DnfRepoTest(DnfTest): self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) - self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath) + self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox' % rootpath) status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) self.assertEqual(0, status, output) status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) @@ -179,15 +174,8 @@ class DnfRepoTest(DnfTest): @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) def test_dnf_exclude(self): - excludepkg = 'curl-dev' - self.dnf_with_repo('install -y curl*') - self.dnf('list %s' % excludepkg, 0) - #Avoid remove dependencies to skip some errors on different archs and images - self.dnf_with_repo('remove --setopt=clean_requirements_on_remove=0 -y curl*') - #check curl-dev is not installed adter removing all curl occurrences - status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500) - self.assertEqual(1, status, "%s was not removed, is listed as installed"%excludepkg) - self.dnf_with_repo('install -y --exclude=%s --exclude=curl-staticdev curl*' % excludepkg) - #check curl-dev is not installed after being excluded - status, output = self.target.run('dnf list --installed | grep %s'% excludepkg , 1500) - self.assertEqual(1, status, "%s was not excluded, is listed as installed"%excludepkg) + self.dnf_with_repo('remove -y dnf-test-*') + self.dnf_with_repo('install -y --exclude=dnf-test-dep dnf-test-*') + output = self.dnf('list --installed dnf-test-*') + self.assertIn("dnf-test-main.", output) + self.assertNotIn("dnf-test-dev.", output)