From 80b6b705f871953aed3b088ebf6f1c3b3ec8c25b Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 19 Jun 2019 08:41:13 +0000 Subject: Stabilize TestGdbRemoteLibrariesSvr4Support on some systems this test fails because the two methods it uses to cross-reference the data don't match in the case of the vdso module. The "read from /proc/%pid/maps" method returns "[vdso]", while the method which reads it from the linker rendezvous structures returns "linux-vdso.so.1". Neither of the two names match any actual file. This restricts the test to only consider the libraries that we ourselves have added to the test, minimizing the impact of system dependencies that we cannot control. llvm-svn: 363772 --- .../libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python') diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py index 2ea268a0569..521a150d8ff 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py @@ -20,6 +20,9 @@ class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase self.prep_debug_monitor_and_inferior(inferior_env=env) self.continue_process_and_wait_for_stop() + def get_expected_libs(self): + return ["libsvr4lib_a.so", 'libsvr4lib_b".so'] + def has_libraries_svr4_support(self): self.add_qSupported_packets() context = self.expect_gdbremote_sequence() @@ -80,7 +83,8 @@ class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase xml_root = self.get_libraries_svr4_xml() for child in xml_root: name = child.attrib.get("name") - if not name: + base_name = os.path.basename(name) + if os.path.basename(name) not in self.get_expected_libs(): continue load_addr = int(child.attrib.get("l_addr"), 16) self.reset_test_sequence() @@ -98,8 +102,7 @@ class TestGdbRemoteLibrariesSvr4Support(gdbremote_testcase.GdbRemoteTestCaseBase for child in xml_root: name = child.attrib.get("name") libraries_svr4_names.append(os.path.realpath(name)) - expected_libs = ["libsvr4lib_a.so", 'libsvr4lib_b".so'] - for lib in expected_libs: + for lib in self.get_expected_libs(): self.assertIn(self.getBuildDir() + "/" + lib, libraries_svr4_names) @llgs_test -- cgit v1.2.3