diff options
| author | Ross Burton <ross.burton@arm.com> | 2022-11-01 16:29:05 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-24 15:30:06 +0000 |
| commit | 452dbb90db8775a3be5bd98638ea343b96d0e745 (patch) | |
| tree | 634ecb93fecac42035e81cec160db4b2a822cb8c | |
| parent | fcab0b528d3c9e963e02d2f097c14258fb3e3c16 (diff) | |
| download | poky-452dbb90db8775a3be5bd98638ea343b96d0e745.tar.gz | |
oeqa/runtime/dnf: rewrite test_dnf_installroot_usrmerge
This test doesn't get exercised on the autobuilder and so it was broken:
specifically some of the ln commands silently fail and the chroot isn't
usable.
Rewrite the test case to correctly construct a chroot so the test can
pass.
(From OE-Core rev: 6f5e10d682be54a70456c4cea9abbde4add1fead)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bb6ebb9956a42df3ed8681aec9aedf340b12f934)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/runtime/cases/dnf.py | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py index 410d456bdf..3ccb18ce83 100644 --- a/meta/lib/oeqa/runtime/cases/dnf.py +++ b/meta/lib/oeqa/runtime/cases/dnf.py | |||
| @@ -147,29 +147,21 @@ class DnfRepoTest(DnfTest): | |||
| 147 | rootpath = '/home/root/chroot/test' | 147 | rootpath = '/home/root/chroot/test' |
| 148 | #Copy necessary files to avoid errors with not yet installed tools on | 148 | #Copy necessary files to avoid errors with not yet installed tools on |
| 149 | #installroot directory. | 149 | #installroot directory. |
| 150 | self.target.run('mkdir -p %s/etc' % rootpath, 1500) | 150 | self.target.run('mkdir -p %s/etc' % rootpath) |
| 151 | self.target.run('mkdir -p %s/usr/bin %s/usr/sbin' % (rootpath, rootpath), 1500) | 151 | self.target.run('mkdir -p %s/usr/bin %s/usr/sbin' % (rootpath, rootpath)) |
| 152 | self.target.run('ln -sf -r %s/usr/bin %s/bin' % (rootpath, rootpath), 1500) | 152 | self.target.run('ln -sf usr/bin %s/bin' % (rootpath)) |
| 153 | self.target.run('ln -sf -r %s/usr/sbin %s/sbin' % (rootpath, rootpath), 1500) | 153 | self.target.run('ln -sf usr/sbin %s/sbin' % (rootpath)) |
| 154 | self.target.run('mkdir -p %s/dev' % rootpath, 1500) | 154 | self.target.run('mkdir -p %s/dev' % rootpath) |
| 155 | #Handle different architectures lib dirs | 155 | #Handle different architectures lib dirs |
| 156 | self.target.run('mkdir -p %s/usr/lib' % rootpath, 1500) | 156 | self.target.run("for l in /lib*; do mkdir -p %s/usr/$l; ln -s usr/$l %s/$l; done" % (rootpath, rootpath)) |
| 157 | self.target.run('mkdir -p %s/usr/libx32' % rootpath, 1500) | 157 | self.target.run('cp -r /etc/rpm %s/etc' % rootpath) |
| 158 | self.target.run('mkdir -p %s/usr/lib64' % rootpath, 1500) | 158 | self.target.run('cp -r /etc/dnf %s/etc' % rootpath) |
| 159 | self.target.run('cp /lib/libtinfo.so.5 %s/usr/lib' % rootpath, 1500) | 159 | self.target.run('cp /bin/busybox %s/bin/sh' % rootpath) |
| 160 | self.target.run('cp /libx32/libtinfo.so.5 %s/usr/libx32' % rootpath, 1500) | 160 | self.target.run('mount -o bind /dev %s/dev/' % rootpath) |
| 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' % rootpath) | 161 | self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox' % rootpath) |
| 170 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500) | 162 | status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath) |
| 171 | self.assertEqual(0, status, output) | 163 | self.assertEqual(0, status, output) |
| 172 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500) | 164 | status, output = self.target.run('test -e %s/bin/busybox' % rootpath) |
| 173 | self.assertEqual(0, status, output) | 165 | self.assertEqual(0, status, output) |
| 174 | 166 | ||
| 175 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) | 167 | @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache']) |
