diff options
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/dnf.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index 629b9af3ed..80cc86a4fb 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py | |||
| @@ -9,7 +9,7 @@ from oeqa.utils.httpserver import HTTPService | |||
| 9 | 9 | ||
| 10 | from oeqa.runtime.case import OERuntimeTestCase | 10 | from oeqa.runtime.case import OERuntimeTestCase |
| 11 | from oeqa.core.decorator.depends import OETestDepends | 11 | from oeqa.core.decorator.depends import OETestDepends |
| 12 | from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature | 12 | from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature, skipIfInDataVar, skipIfNotInDataVar |
| 13 | from oeqa.runtime.decorator.package import OEHasPackage | 13 | from oeqa.runtime.decorator.package import OEHasPackage |
| 14 | 14 | ||
| 15 | class DnfTest(OERuntimeTestCase): | 15 | class DnfTest(OERuntimeTestCase): |
| @@ -116,6 +116,7 @@ class DnfRepoTest(DnfTest): | |||
| 116 | self.dnf_with_repo('reinstall -y run-postinsts-dev') | 116 | self.dnf_with_repo('reinstall -y run-postinsts-dev') |
| 117 | 117 | ||
| 118 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 118 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 119 | @skipIfInDataVar('DISTRO_FEATURES', 'usrmerge', 'Test run when not enable usrmerge') | ||
| 119 | def test_dnf_installroot(self): | 120 | def test_dnf_installroot(self): |
| 120 | rootpath = '/home/root/chroot/test' | 121 | rootpath = '/home/root/chroot/test' |
| 121 | #Copy necessary files to avoid errors with not yet installed tools on | 122 | #Copy necessary files to avoid errors with not yet installed tools on |
| @@ -141,6 +142,37 @@ class DnfRepoTest(DnfTest): | |||
| 141 | self.assertEqual(0, status, output) | 142 | self.assertEqual(0, status, output) |
| 142 | 143 | ||
| 143 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 144 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
| 145 | @skipIfNotInDataVar('DISTRO_FEATURES', 'usrmerge', 'Test run when enable usrmege') | ||
| 146 | def test_dnf_installroot_usrmerge(self): | ||
| 147 | rootpath = '/home/root/chroot/test' | ||
| 148 | #Copy necessary files to avoid errors with not yet installed tools on | ||
| 149 | #installroot directory. | ||
| 150 | self.target.run('mkdir -p %s/etc' % rootpath, 1500) | ||
| 151 | self.target.run('mkdir -p %s/usr/bin %s/usr/sbin' % (rootpath, rootpath), 1500) | ||
| 152 | self.target.run('ln -sf -r %s/usr/bin %s/bin' % (rootpath, rootpath), 1500) | ||
| 153 | self.target.run('ln -sf -r %s/usr/sbin %s/sbin' % (rootpath, rootpath), 1500) | ||
| 154 | self.target.run('mkdir -p %s/dev' % rootpath, 1500) | ||
| 155 | #Handle different architectures lib dirs | ||
| 156 | self.target.run('mkdir -p %s/usr/lib' % rootpath, 1500) | ||
| 157 | self.target.run('mkdir -p %s/usr/libx32' % rootpath, 1500) | ||
| 158 | self.target.run('mkdir -p %s/usr/lib64' % rootpath, 1500) | ||
| 159 | self.target.run('cp /lib/libtinfo.so.5 %s/usr/lib' % rootpath, 1500) | ||
| 160 | self.target.run('cp /libx32/libtinfo.so.5 %s/usr/libx32' % rootpath, 1500) | ||
| 161 | self.target.run('cp /lib64/libtinfo.so.5 %s/usr/lib64' % rootpath, 1500) | ||
| 162 | self.target.run('ln -sf -r %s/lib %s/usr/lib' % (rootpath,rootpath), 1500) | ||
| 163 | self.target.run('ln -sf -r %s/libx32 %s/usr/libx32' % (rootpath,rootpath), 1500) | ||
| 164 | self.target.run('ln -sf -r %s/lib64 %s/usr/lib64' % (rootpath,rootpath), 1500) | ||
| 165 | self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500) | ||
| 166 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500) | ||
| 167 | self.target.run('cp /bin/sh %s/bin' % rootpath, 1500) | ||
| 168 | self.target.run('mount -o bind /dev %s/dev/' % rootpath, 1500) | ||
| 169 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath) | ||
| 170 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) | ||
| 171 | self.assertEqual(0, status, output) | ||
| 172 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) | ||
| 173 | self.assertEqual(0, status, output) | ||
| 174 | |||
| 175 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | ||
| 144 | def test_dnf_exclude(self): | 176 | def test_dnf_exclude(self): |
| 145 | excludepkg = 'curl-dev' | 177 | excludepkg = 'curl-dev' |
| 146 | self.dnf_with_repo('install -y curl*') | 178 | self.dnf_with_repo('install -y curl*') |
