Skip to content

Commit

Permalink
Bring back the old real-world test case
Browse files Browse the repository at this point in the history
It's still failing.

But just replacing it without understanding *why* it was failing felt wrong, so
I'm re-instating it to figure out what's going wrong.
  • Loading branch information
walles committed Jul 2, 2016
1 parent 6b872ea commit 1b6de63
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Binary file added px/lsof-test-output-linux-1.txt
Binary file not shown.
File renamed without changes.
21 changes: 19 additions & 2 deletions px/px_ipc_map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,28 @@ def test_get_other_end_pids_localhost_socket_names():
assert postgres_file not in postgres_ipc_map.network_connections


def test_get_ipc_map():
def test_get_ipc_map_1():
"""Tyre kick IpcMap with some real world data"""
files = None
my_dir = os.path.dirname(__file__)
with open(os.path.join(my_dir, "lsof-test-output-linux.txt"), "r") as lsof_output:
with open(os.path.join(my_dir, "lsof-test-output-linux-1.txt"), "r") as lsof_output:
files = px_file.lsof_to_files(lsof_output.read())

ipc_map = testutils.create_ipc_map(1997, files)
assert len(ipc_map.keys()) == 2

peer0 = ipc_map.keys()[0]
assert len(ipc_map[peer0]) == 1

peer1 = ipc_map.keys()[1]
assert len(ipc_map[peer1]) == 1


def test_get_ipc_map_2():
"""Tyre kick IpcMap with some real world data"""
files = None
my_dir = os.path.dirname(__file__)
with open(os.path.join(my_dir, "lsof-test-output-linux-2.txt"), "r") as lsof_output:
files = px_file.lsof_to_files(lsof_output.read())

ipc_map = testutils.create_ipc_map(777, files)
Expand Down

0 comments on commit 1b6de63

Please sign in to comment.