Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
7726dea2
Commit
7726dea2
authored
Oct 20, 2017
by
vieira
Committed by
Brian May
Oct 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test double restore (ipv4, ipv6) disables only once; test kldload
parent
3635cc17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
test_methods_pf.py
sshuttle/tests/client/test_methods_pf.py
+9
-2
No files found.
sshuttle/tests/client/test_methods_pf.py
View file @
7726dea2
...
...
@@ -278,10 +278,12 @@ def test_setup_firewall_darwin(mock_pf_get_dev, mock_ioctl, mock_pfctl):
@
patch
(
'sshuttle.helpers.verbose'
,
new
=
3
)
@
patch
(
'sshuttle.methods.pf.pf'
,
FreeBsd
())
@
patch
(
'subprocess.call'
)
@
patch
(
'sshuttle.methods.pf.pfctl'
)
@
patch
(
'sshuttle.methods.pf.ioctl'
)
@
patch
(
'sshuttle.methods.pf.pf_get_dev'
)
def
test_setup_firewall_freebsd
(
mock_pf_get_dev
,
mock_ioctl
,
mock_pfctl
):
def
test_setup_firewall_freebsd
(
mock_pf_get_dev
,
mock_ioctl
,
mock_pfctl
,
mock_subprocess_call
):
mock_pfctl
.
side_effect
=
pfctl
method
=
get_method
(
'pf'
)
...
...
@@ -312,6 +314,7 @@ def test_setup_firewall_freebsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
b
'to <dns_servers> port 53 keep state
\n
'
),
call
(
'-e'
),
]
assert
call
([
'kldload'
,
'pf'
])
in
mock_subprocess_call
.
mock_calls
mock_pf_get_dev
.
reset_mock
()
mock_ioctl
.
reset_mock
()
mock_pfctl
.
reset_mock
()
...
...
@@ -364,9 +367,11 @@ def test_setup_firewall_freebsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
mock_pfctl
.
reset_mock
()
method
.
restore_firewall
(
1025
,
2
,
False
,
None
)
method
.
restore_firewall
(
1024
,
10
,
False
,
None
)
assert
mock_ioctl
.
mock_calls
==
[]
assert
mock_pfctl
.
mock_calls
==
[
call
(
'-a sshuttle-1025 -F all'
),
call
(
'-a sshuttle6-1024 -F all'
),
call
(
"-d"
),
]
mock_pf_get_dev
.
reset_mock
()
...
...
@@ -467,10 +472,12 @@ def test_setup_firewall_openbsd(mock_pf_get_dev, mock_ioctl, mock_pfctl):
mock_pfctl
.
reset_mock
()
method
.
restore_firewall
(
1025
,
2
,
False
,
None
)
method
.
restore_firewall
(
1024
,
10
,
False
,
None
)
assert
mock_ioctl
.
mock_calls
==
[]
assert
mock_pfctl
.
mock_calls
==
[
call
(
'-a sshuttle-1025 -F all'
),
call
(
"-d"
),
call
(
'-a sshuttle6-1024 -F all'
),
call
(
'-d'
),
]
mock_pf_get_dev
.
reset_mock
()
mock_pfctl
.
reset_mock
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment