diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-01-01 11:13:56 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-01-01 11:13:56 +1300 |
commit | e2dc7ba09d54fb4fa4af796d5c37cd36174f8897 (patch) | |
tree | 09d6d4237e5864aeef6709b44a7a5a7633aaaf03 /test | |
parent | 5347cb9c269acdbc2fc36f92e3545fcbb9de45a1 (diff) | |
download | mitmproxy-e2dc7ba09d54fb4fa4af796d5c37cd36174f8897.tar.gz mitmproxy-e2dc7ba09d54fb4fa4af796d5c37cd36174f8897.tar.bz2 mitmproxy-e2dc7ba09d54fb4fa4af796d5c37cd36174f8897.zip |
First draft of OSX transparent proxy mode.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/pf01 | 4 | ||||
-rw-r--r-- | test/test_platform_pf.py | 13 |
2 files changed, 17 insertions, 0 deletions
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) + + |