From e2dc7ba09d54fb4fa4af796d5c37cd36174f8897 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 1 Jan 2013 11:13:56 +1300 Subject: First draft of OSX transparent proxy mode. --- test/data/pf01 | 4 ++++ test/test_platform_pf.py | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/data/pf01 create mode 100644 test/test_platform_pf.py (limited to 'test') diff --git a/test/data/pf01 b/test/data/pf01 new file mode 100644 index 00000000..3139a289 --- /dev/null +++ b/test/data/pf01 @@ -0,0 +1,4 @@ +No ALTQ support in kernel +ALTQ related functions disabled +ALL tcp 127.0.0.1:8080 <- 5.5.5.6:80 <- 192.168.1.111:40001 FIN_WAIT_2:FIN_WAIT_2 +ALL tcp 127.0.0.1:8080 <- 5.5.5.5:80 <- 192.168.1.111:40000 ESTABLISHED:ESTABLISHED diff --git a/test/test_platform_pf.py b/test/test_platform_pf.py new file mode 100644 index 00000000..a2e7c3c1 --- /dev/null +++ b/test/test_platform_pf.py @@ -0,0 +1,13 @@ +import tutils +from libmproxy.platform import pf + + +class TestLookup: + def test_simple(self): + p = tutils.test_data.path("data/pf01") + d = open(p).read() + assert pf.lookup("192.168.1.111", 40000, d) == ("5.5.5.5", 80) + assert not pf.lookup("192.168.1.112", 40000, d) + assert not pf.lookup("192.168.1.111", 40001, d) + + -- cgit v1.2.3