public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: jose.perez.carranza@linux.intel.com
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2] runtime/dnf: Add new dnf test cases
Date: Thu, 11 May 2017 12:33:03 -0500	[thread overview]
Message-ID: <20170511173303.26995-1-jose.perez.carranza@linux.intel.com> (raw)
In-Reply-To: <bd532acb-3dda-ac74-37d8-892fc797a407@linux.intel.com>

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 19 ++++++++++++++++++-
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..a0d07c9f003 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..0baf796278b 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,21 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        self.dnf_with_repo('install --installroot=%s --allowerasing -v -y busybox run-postinsts' % 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)
+        self.assertEqual(0, status, output)
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_reinstall'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'curl-dev'
+        self.dnf('list %s' % excludepkg, 0)
+        self.dnf_with_repo('remove -y curl')
+        self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
+        self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0



  reply	other threads:[~2017-05-11 17:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 19:38 [PATCH] runtime/dnf: Add new dnf test cases jose.perez.carranza
2017-05-10 19:52 ` Alexander Kanavin
2017-05-11 17:33   ` jose.perez.carranza [this message]
2017-05-11 18:56     ` [PATCH v2] " Alexander Kanavin
2017-05-11 19:21       ` Jose Perez Carranza
2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
2017-06-07 10:21         ` Burton, Ross
2017-06-07 17:31           ` Jose Perez Carranza
2017-06-08 11:31             ` Alexander Kanavin
2017-06-08 12:49               ` Jose Perez Carranza
2017-06-08 12:49                 ` Alexander Kanavin
2017-06-08 13:11                   ` Jose Perez Carranza
2017-06-08 16:35             ` Alexander Kanavin
2017-06-09  9:22               ` Alexander Kanavin
2017-06-09 12:54                 ` Jose Perez Carranza
2017-06-13 19:56         ` [PATCH v4] " jose.perez.carranza
2017-06-14 12:00           ` Alexander Kanavin
2017-06-14 12:32             ` Jose Perez Carranza
2017-11-30 16:23               ` [PATCH v5] " jose.perez.carranza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170511173303.26995-1-jose.perez.carranza@linux.intel.com \
    --to=jose.perez.carranza@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox