summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFata Nugraha <fata.nugraha@grabtaxi.com>2023-08-04 19:59:33 +0700
committerBrian May <brian@linuxpenguins.xyz>2023-08-07 20:00:32 +1000
commit5b9f438d42c389aaf92f62ff58522c2f74f92b6b (patch)
treeaaa33e9afff08bb56afda80638c2aaf1341327d5
parent998e5c58491a6bc88d03682e680b65381f59f7f4 (diff)
Fix tests
-rw-r--r--tests/client/test_firewall.py2
-rw-r--r--tests/client/test_methods_nat.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/client/test_firewall.py b/tests/client/test_firewall.py
index 6a3b4db..f82ddfa 100644
--- a/tests/client/test_firewall.py
+++ b/tests/client/test_firewall.py
@@ -19,7 +19,7 @@ NSLIST
{inet},1.2.3.33
{inet6},2404:6800:4004:80c::33
PORTS 1024,1025,1026,1027
-GO 1 - 0x01 12345
+GO 1 - - 0x01 12345
HOST 1.2.3.3,existing
""".format(inet=AF_INET, inet6=AF_INET6))
stdout = Mock()
diff --git a/tests/client/test_methods_nat.py b/tests/client/test_methods_nat.py
index 218b629..fa969aa 100644
--- a/tests/client/test_methods_nat.py
+++ b/tests/client/test_methods_nat.py
@@ -120,13 +120,13 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt):
'--dest', u'2404:6800:4004:80c::33', '-p', 'udp',
'--dport', '53', '--to-ports', '1026'),
call(AF_INET6, 'nat', '-A', 'sshuttle-1024', '-j', 'RETURN',
- '-m', 'addrtype', '--dst-type', 'LOCAL'),
- call(AF_INET6, 'nat', '-A', 'sshuttle-1024', '-j', 'RETURN',
'--dest', u'2404:6800:4004:80c::101f/128', '-p', 'tcp',
'--dport', '80:80'),
call(AF_INET6, 'nat', '-A', 'sshuttle-1024', '-j', 'REDIRECT',
'--dest', u'2404:6800:4004:80c::/64', '-p', 'tcp',
- '--to-ports', '1024')
+ '--to-ports', '1024'),
+ call(AF_INET6, 'nat', '-A', 'sshuttle-1024', '-j', 'RETURN',
+ '-m', 'addrtype', '--dst-type', 'LOCAL')
]
mock_ipt_chain_exists.reset_mock()
mock_ipt.reset_mock()
@@ -175,12 +175,12 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt):
'--dest', u'1.2.3.33', '-p', 'udp',
'--dport', '53', '--to-ports', '1027'),
call(AF_INET, 'nat', '-A', 'sshuttle-1025', '-j', 'RETURN',
- '-m', 'addrtype', '--dst-type', 'LOCAL'),
- call(AF_INET, 'nat', '-A', 'sshuttle-1025', '-j', 'RETURN',
'--dest', u'1.2.3.66/32', '-p', 'tcp', '--dport', '8080:8080'),
call(AF_INET, 'nat', '-A', 'sshuttle-1025', '-j', 'REDIRECT',
'--dest', u'1.2.3.0/24', '-p', 'tcp', '--dport', '8000:9000',
- '--to-ports', '1025')
+ '--to-ports', '1025'),
+ call(AF_INET, 'nat', '-A', 'sshuttle-1025', '-j', 'RETURN',
+ '-m', 'addrtype', '--dst-type', 'LOCAL'),
]
mock_ipt_chain_exists.reset_mock()
mock_ipt.reset_mock()
@@ -200,7 +200,7 @@ def test_setup_firewall(mock_ipt_chain_exists, mock_ipt):
mock_ipt_chain_exists.reset_mock()
mock_ipt.reset_mock()
- method.restore_firewall(1025, AF_INET6, False, None,)
+ method.restore_firewall(1025, AF_INET6, False, None, None)
assert mock_ipt_chain_exists.mock_calls == [
call(AF_INET6, 'nat', 'sshuttle-1025')
]