Skip to content

Commit

Permalink
Add test that should fail
Browse files Browse the repository at this point in the history
FIXME: It doesn't, find out why!

When this test passes we should be able to trace pipes on Linux.
  • Loading branch information
walles committed Jun 30, 2016
1 parent dead135 commit a200a1a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions px/px_ipc_map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
import testutils


def create_file(type, name, device, pid, access=None):
def create_file(type, name, device, pid, access=None, inode=None):
file = px_file.PxFile()
file.type = type

# Remove leading [] group from name if any
file.name = re.match('(\[[^]]*\] )?(.*)', name).group(2)

file.pid = pid
file.access = access
file.device = device
file.access = access
file.inode = inode
return file


Expand Down Expand Up @@ -60,6 +61,15 @@ def test_get_other_end_pids_osx_pipe2():
assert found == set([25, 26])


def test_get_other_end_pids_linux_pipe():
files = [
create_file("FIFO", "pipe", None, 100, inode="100200", access="r"),
create_file("FIFO", "pipe", None, 200, inode="100200", access="w"),
]
assert get_other_end_pids(files[0], files) == set([200])
assert get_other_end_pids(files[1], files) == set([100])


def test_get_other_end_pids_fifo1():
files = [create_file("FIFO", "[] /fifo/name", None, 25, "r")]

Expand Down

0 comments on commit a200a1a

Please sign in to comment.