[clang][Driver][SPIR-V] Make tool names consistent (#122343)
[llvm-project.git] / lldb / test / API / commands / process / attach / attach_denied / TestAttachDenied.py
blobd72a710e8127bf76637f985d019b0534ebf3f0df
1 """
2 Test denied process attach.
3 """
6 import time
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
12 exe_name = "AttachDenied" # Must match Makefile
15 class AttachDeniedTestCase(TestBase):
16 NO_DEBUG_INFO_TESTCASE = True
18 @skipIfWindows
19 @skipIfiOSSimulator
20 @skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc
21 @skipIfAsan # Times out inconsistently under asan
22 def test_attach_to_process_by_id_denied(self):
23 """Test attach by process id denied"""
24 self.build()
25 exe = self.getBuildArtifact(exe_name)
27 # Use a file as a synchronization point between test and inferior.
28 pid_file_path = lldbutil.append_to_process_working_directory(
29 self, "pid_file_%d" % (int(time.time()))
31 self.addTearDownHook(
32 lambda: self.run_platform_command("rm %s" % (pid_file_path))
35 # Spawn a new process
36 popen = self.spawnSubprocess(exe, [pid_file_path])
38 pid = lldbutil.wait_for_file_on_target(self, pid_file_path)
40 self.expect(
41 "process attach -p " + pid, startstr="error: attach failed:", error=True