diff options
| -rw-r--r-- | meta/classes-recipe/testimage.bbclass | 5 | ||||
| -rw-r--r-- | 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 819c7d2bf4..5cc408b0c4 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass | |||
| @@ -468,10 +468,7 @@ def create_rpm_index(d): | |||
| 468 | package_list = glob.glob(idx_path + "*/*.rpm") | 468 | package_list = glob.glob(idx_path + "*/*.rpm") |
| 469 | 469 | ||
| 470 | for pkg in package_list: | 470 | for pkg in package_list: |
| 471 | if os.path.basename(pkg).startswith(("curl-ptest")): | 471 | if not os.path.basename(pkg).startswith(("dnf-test-", "busybox", "update-alternatives", "libc6", "musl")): |
| 472 | bb.utils.remove(pkg) | ||
| 473 | |||
| 474 | if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl", "musl")): | ||
| 475 | bb.utils.remove(pkg) | 472 | bb.utils.remove(pkg) |
| 476 | 473 | ||
| 477 | bb.utils.unlockfile(lf) | 474 | bb.utils.unlockfile(lf) |
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index e0b91090b2..410d456bdf 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py | |||
| @@ -75,48 +75,43 @@ class DnfRepoTest(DnfTest): | |||
| 75 | def test_dnf_makecache(self): | 75 | def test_dnf_makecache(self): |
| 76 | self.dnf_with_repo('makecache') | 76 | self.dnf_with_repo('makecache') |
| 77 | 77 | ||
| 78 | |||
| 79 | # Does not work when repo is specified on the command line | ||
| 80 | # @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | ||
| 81 | # def test_dnf_repolist(self): | ||
| 82 | # self.dnf_with_repo('repolist') | ||
| 83 | |||
| 84 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 78 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 85 | def test_dnf_repoinfo(self): | 79 | def test_dnf_repoinfo(self): |
| 86 | self.dnf_with_repo('repoinfo') | 80 | self.dnf_with_repo('repoinfo') |
| 87 | 81 | ||
| 88 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 82 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 89 | def test_dnf_install(self): | 83 | def test_dnf_install(self): |
| 90 | output = self.dnf_with_repo('list run-postinsts-dev') | 84 | self.dnf_with_repo('remove -y dnf-test-*') |
| 91 | if 'Installed Packages' in output: | 85 | self.dnf_with_repo('install -y dnf-test-dep') |
| 92 | self.dnf_with_repo('remove -y run-postinsts-dev') | ||
| 93 | self.dnf_with_repo('install -y run-postinsts-dev') | ||
| 94 | 86 | ||
| 95 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) | 87 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) |
| 96 | def test_dnf_install_dependency(self): | 88 | def test_dnf_install_dependency(self): |
| 97 | self.dnf_with_repo('remove -y run-postinsts') | 89 | self.dnf_with_repo('remove -y dnf-test-*') |
| 98 | self.dnf_with_repo('install -y run-postinsts-dev') | 90 | self.dnf_with_repo('install -y dnf-test-main') |
| 91 | output = self.dnf('list --installed dnf-test-*') | ||
| 92 | self.assertIn("dnf-test-main.", output) | ||
| 93 | self.assertIn("dnf-test-dep.", output) | ||
| 99 | 94 | ||
| 100 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency']) | 95 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency']) |
| 101 | def test_dnf_install_from_disk(self): | 96 | def test_dnf_install_from_disk(self): |
| 102 | self.dnf_with_repo('remove -y run-postinsts-dev') | 97 | self.dnf_with_repo('remove -y dnf-test-dep') |
| 103 | self.dnf_with_repo('install -y --downloadonly run-postinsts-dev') | 98 | self.dnf_with_repo('install -y --downloadonly dnf-test-dep') |
| 104 | status, output = self.target.run('find /var/cache/dnf -name run-postinsts-dev*rpm', 1500) | 99 | status, output = self.target.run('find /var/cache/dnf -name dnf-test-dep*rpm') |
| 105 | self.assertEqual(status, 0, output) | 100 | self.assertEqual(status, 0, output) |
| 106 | self.dnf_with_repo('install -y %s' % output) | 101 | self.dnf_with_repo('install -y %s' % output) |
| 107 | 102 | ||
| 108 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk']) | 103 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk']) |
| 109 | def test_dnf_install_from_http(self): | 104 | def test_dnf_install_from_http(self): |
| 110 | output = subprocess.check_output('%s %s -name run-postinsts-dev*' % (bb.utils.which(os.getenv('PATH'), "find"), | 105 | output = subprocess.check_output('%s %s -name dnf-test-dep*' % (bb.utils.which(os.getenv('PATH'), "find"), |
| 111 | os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8") | 106 | os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8") |
| 112 | rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1] | 107 | rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1] |
| 113 | url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path) | 108 | url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path) |
| 114 | self.dnf_with_repo('remove -y run-postinsts-dev') | 109 | self.dnf_with_repo('remove -y dnf-test-dep') |
| 115 | self.dnf_with_repo('install -y %s' % url) | 110 | self.dnf_with_repo('install -y %s' % url) |
| 116 | 111 | ||
| 117 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) | 112 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_install']) |
| 118 | def test_dnf_reinstall(self): | 113 | def test_dnf_reinstall(self): |
| 119 | self.dnf_with_repo('reinstall -y run-postinsts-dev') | 114 | self.dnf_with_repo('reinstall -y dnf-test-main') |
| 120 | 115 | ||
| 121 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 116 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 122 | @skipIfInDataVar('DISTRO_FEATURES', 'usrmerge', 'Test run when not enable usrmerge') | 117 | @skipIfInDataVar('DISTRO_FEATURES', 'usrmerge', 'Test run when not enable usrmerge') |
| @@ -139,7 +134,7 @@ class DnfRepoTest(DnfTest): | |||
| 139 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) | 134 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) |
| 140 | self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) | 135 | self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) |
| 141 | self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) | 136 | self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) |
| 142 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath) | 137 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox' % rootpath) |
| 143 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) | 138 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) |
| 144 | self.assertEqual(0, status, output) | 139 | self.assertEqual(0, status, output) |
| 145 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) | 140 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) |
| @@ -171,7 +166,7 @@ class DnfRepoTest(DnfTest): | |||
| 171 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) | 166 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) |
| 172 | self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) | 167 | self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) |
| 173 | self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) | 168 | self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) |
| 174 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath) | 169 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox' % rootpath) |
| 175 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) | 170 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) |
| 176 | self.assertEqual(0, status, output) | 171 | self.assertEqual(0, status, output) |
| 177 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) | 172 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) |
| @@ -179,15 +174,8 @@ class DnfRepoTest(DnfTest): | |||
| 179 | 174 | ||
| 180 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 175 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 181 | def test_dnf_exclude(self): | 176 | def test_dnf_exclude(self): |
| 182 | excludepkg = 'curl-dev' | 177 | self.dnf_with_repo('remove -y dnf-test-*') |
| 183 | self.dnf_with_repo('install -y curl*') | 178 | self.dnf_with_repo('install -y --exclude=dnf-test-dep dnf-test-*') |
| 184 | self.dnf('list %s' % excludepkg, 0) | 179 | output = self.dnf('list --installed dnf-test-*') |
| 185 | #Avoid remove dependencies to skip some errors on different archs and images | 180 | self.assertIn("dnf-test-main.", output) |
| 186 | self.dnf_with_repo('remove --setopt=clean_requirements_on_remove=0 -y curl*') | 181 | self.assertNotIn("dnf-test-dev.", output) |
| 187 | #check curl-dev is not installed adter removing all curl occurrences | ||
| 188 | status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500) | ||
| 189 | self.assertEqual(1, status, "%s was not removed, is listed as installed"%excludepkg) | ||
| 190 | self.dnf_with_repo('install -y --exclude=%s --exclude=curl-staticdev curl*' % excludepkg) | ||
| 191 | #check curl-dev is not installed after being excluded | ||
| 192 | status, output = self.target.run('dnf list --installed | grep %s'% excludepkg , 1500) | ||
| 193 | self.assertEqual(1, status, "%s was not excluded, is listed as installed"%excludepkg) | ||
