aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/testimage.bbclass11
-rw-r--r--meta/lib/oeqa/runtime/cases/dnf.py30
2 files changed, 38 insertions, 3 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6c33e16e3d9..e1f4eb36c17 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..1dd3a5de388 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,34 @@ 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'
+ try:
+ self.dnf_with_repo('install --installroot=%s -v -y busybox run-postinsts' % rootpath)
+ except:
+ self.target.run('mkdir -p %s/etc' % rootpath, 1500)
+ self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500)
+ self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500)
+ self.dnf_with_repo('install --installroot=%s -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_makecache'])
+ @OETestID(1772)
+ def test_dnf_exclude(self):
+ excludepkg = 'curl-dev'
+ try:
+ self.dnf('list curl %s' % excludepkg ,0)
+ except:
+ self.dnf_with_repo('install -y curl*')
+ self.dnf('list %s' % excludepkg, 0)
+
+ self.dnf_with_repo('remove -y curl*')
+ self.dnf('list %s' % excludepkg, 1)
+ self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+ self.dnf('list %s' % excludepkg, 1)