diff options
author | Scott Kuhl <kuhl@mtu.edu> | 2020-12-26 15:25:33 -0500 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2020-12-28 10:21:56 +1100 |
commit | 6d4261e3f9de17720c07239d0370f14a6fed36a9 (patch) | |
tree | 12fdce0285335c9c1efa4ece8a2b24b5cd325c48 /tests | |
parent | 7c338866bf1806d0c14887ff7b44be1bdf97a277 (diff) |
Refactor automatic method selection.
Add an "is_supported()" function to the different methods so that each
method can include whatever logic they wish to indicate if they are
supported on a particular machine. Previously, methods/__init__.py
contained all of the logic for selecting individual methods. Now, it
iterates through a list of possible options and stops on the first
method that it finds that is_supported().
Currently, the decision is made based on the presence of programs in
the PATH. In the future, things such as the platform sshuttle is
running on could be considered.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/client/test_firewall.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/client/test_firewall.py b/tests/client/test_firewall.py index d19839b..71f1940 100644 --- a/tests/client/test_firewall.py +++ b/tests/client/test_firewall.py @@ -116,6 +116,8 @@ def test_main(mock_get_method, mock_setup_daemon, mock_rewrite_etc_hosts): assert mock_setup_daemon.mock_calls == [call()] assert mock_get_method.mock_calls == [ call('not_auto'), + call().is_supported(), + call().is_supported().__bool__(), call().setup_firewall( 1024, 1026, [(AF_INET6, u'2404:6800:4004:80c::33')], |