Index: packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py =================================================================== --- packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py +++ packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py @@ -23,6 +23,10 @@ @no_debug_info_test def test_image_list_shows_multiple_architectures(self): """Test that image list properly shows the correct architecture for a set of different architecture object files.""" + # Don't leave residual open platform connections + if lldb.remote_platform: + lldb.remote_platform.DisconnectRemote() + images = { "hello-freebsd-10.0-x86_64-clang-3.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"), "hello-freebsd-10.0-x86_64-gcc-4.7.3": re.compile(r"x86_64-(\*)?-freebsd10.0(-unknown)? x86_64"), @@ -39,5 +43,11 @@ self.runCmd("file {}".format(file_name)) self.match("image list -t -A", [expected_triple_and_arch_regex]) - # Revert to the host platform after all of this is done - self.runCmd("platform select host") + + # Revert to the original platform after all of this is done + if lldb.remote_platform: + platform_connect_options = lldb.SBPlatformConnectOptions(configuration.lldb_platform_url) + err = lldb.remote_platform.ConnectRemote(platform_connect_options) + self.assertTrue(err.Success()) + else: + self.runCmd("platform select host")