Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_syscall_unlink(ql, unlink_pathname, *args):
target = False
pathname = ql_read_string(ql, unlink_pathname)
if pathname == "test_syscall_unlink.txt":
print("test => unlink(%s)" % (pathname))
target = True
syscall.ql_syscall_unlink(ql, unlink_pathname, *args)
if target:
real_path = ql_transform_to_real_path(ql, pathname)
assert os.path.isfile(real_path) == False
def test_syscall_open(ql, open_pathname, open_flags, open_mode, *args):
target = False
pathname = ql_read_string(ql, open_pathname)
if pathname == "test_syscall_open.txt":
print("test => open(%s, 0x%x, 0%o)" % (pathname, open_flags, open_mode))
target = True
syscall.ql_syscall_open(ql, open_pathname, open_flags, open_mode, *args)
if target:
real_path = ql_transform_to_real_path(ql, pathname)
assert os.path.isfile(real_path) == True
os.remove(real_path)