summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-09-08 12:54:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-09 14:09:01 +0100
commitb064a9a51706325b9480b4fd7da2f3140d351c05 (patch)
tree7f15f7635c4cb902025bfe65403b5a858fff16f7
parenta46d486a2726ce9ed55fc47e6d2302be887987e7 (diff)
downloadpoky-b064a9a51706325b9480b4fd7da2f3140d351c05.tar.gz
oeqa/selftest/debuginfod: don't re-use the database
debuginfod writes the files it scans to a database in $HOME, which isn't ideal when the build trees that get scanned typically are deleted after the test has finished. This can result in debuginfod trying to return objects that no longer exist on disk: libc error: stat /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-1032306/tmp/deploy/rpm/core2_64/elfutils-dbg-0.187-r0.core2_64.rpm: No such file or directory libc error: stat /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-1113320/tmp/deploy/rpm/core2_64/elfutils-dbg-0.187-r0.core2_64.rpm: No such file or directory libc error: stat /home/pokybuild/yocto-worker/oe-selftest-debian/build/build-st-1113320/tmp/deploy/rpm/core2_64/elfutils-dbg-0.187-r0.core2_64.rpm: No such file or directory Solve this, and save writing a database on disk at all, by using the special database path :memory: which keeps the database in memory only, so state can't leak between tests. (From OE-Core rev: d1c2aa3d241bd17d68e8e38d9399cbb0a3f3b912) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/debuginfod.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/debuginfod.py b/meta/lib/oeqa/selftest/cases/debuginfod.py
index 01359ec649..3c40119282 100644
--- a/meta/lib/oeqa/selftest/cases/debuginfod.py
+++ b/meta/lib/oeqa/selftest/cases/debuginfod.py
@@ -10,16 +10,24 @@ import subprocess
10from oeqa.selftest.case import OESelftestTestCase 10from oeqa.selftest.case import OESelftestTestCase
11from oeqa.utils.commands import bitbake, get_bb_var, runqemu 11from oeqa.utils.commands import bitbake, get_bb_var, runqemu
12 12
13
13class Debuginfod(OESelftestTestCase): 14class Debuginfod(OESelftestTestCase):
14 def test_debuginfod(self): 15 def test_debuginfod(self):
15 self.write_config(""" 16 self.write_config(
17 """
16DISTRO_FEATURES:append = " debuginfod" 18DISTRO_FEATURES:append = " debuginfod"
17CORE_IMAGE_EXTRA_INSTALL += "elfutils" 19CORE_IMAGE_EXTRA_INSTALL += "elfutils"
18 """) 20 """
21 )
19 bitbake("core-image-minimal elfutils-native:do_addto_recipe_sysroot") 22 bitbake("core-image-minimal elfutils-native:do_addto_recipe_sysroot")
20 23
21 native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "elfutils-native") 24 native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "elfutils-native")
22 cmd = [os.path.join(native_sysroot, "usr", "bin", "debuginfod"), "--verbose", get_bb_var("DEPLOY_DIR")] 25 cmd = [
26 os.path.join(native_sysroot, "usr", "bin", "debuginfod"),
27 "--verbose",
28 "--database=:memory:",
29 get_bb_var("DEPLOY_DIR"),
30 ]
23 for format in get_bb_var("PACKAGE_CLASSES").split(): 31 for format in get_bb_var("PACKAGE_CLASSES").split():
24 if format == "package_deb": 32 if format == "package_deb":
25 cmd.append("--scan-deb-dir") 33 cmd.append("--scan-deb-dir")
@@ -36,7 +44,10 @@ CORE_IMAGE_EXTRA_INSTALL += "elfutils"
36 debuginfod = subprocess.Popen(cmd) 44 debuginfod = subprocess.Popen(cmd)
37 45
38 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: 46 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu:
39 cmd = "DEBUGINFOD_URLS=http://%s:%d/ debuginfod-find debuginfo /usr/bin/debuginfod" % (qemu.server_ip, port) 47 cmd = (
48 "DEBUGINFOD_URLS=http://%s:%d/ debuginfod-find debuginfo /usr/bin/debuginfod"
49 % (qemu.server_ip, port)
50 )
40 status, output = qemu.run_serial(cmd) 51 status, output = qemu.run_serial(cmd)
41 # This should be more comprehensive 52 # This should be more comprehensive
42 self.assertIn("/.cache/debuginfod_client/", output) 53 self.assertIn("/.cache/debuginfod_client/", output)