mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
wireguard: tests: Add functional tests
Add HTML classes to help with functional testing. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
4fc1844d89
commit
09ba3892e8
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<a title="{% trans 'Add a new peer' %}"
|
<a title="{% trans 'Add a new peer' %}"
|
||||||
role="button" class="btn btn-default"
|
role="button" class="btn btn-default btn-add-client"
|
||||||
href="{% url 'wireguard:add-client' %}">
|
href="{% url 'wireguard:add-client' %}">
|
||||||
<span class="fa fa-plus" aria-hidden="true"></span>
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
||||||
{% trans "Add Allowed Client" %}
|
{% trans "Add Allowed Client" %}
|
||||||
@ -82,8 +82,9 @@
|
|||||||
{% for peer in server.peers.values %}
|
{% for peer in server.peers.values %}
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ peer.endpoint }}</td>
|
<td class="peer-endpoint">{{ peer.endpoint }}</td>
|
||||||
<td>
|
<td class="peer-public-key"
|
||||||
|
data-public-key="{{ peer.public_key }}">
|
||||||
<a href="{% url 'wireguard:show-server' interface %}">
|
<a href="{% url 'wireguard:show-server' interface %}">
|
||||||
{{ peer.public_key }}
|
{{ peer.public_key }}
|
||||||
</a>
|
</a>
|
||||||
@ -107,7 +108,7 @@
|
|||||||
|
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<a title="{% trans 'Add a new server' %}"
|
<a title="{% trans 'Add a new server' %}"
|
||||||
role="button" class="btn btn-default"
|
role="button" class="btn btn-default btn-add-server"
|
||||||
href="{% url 'wireguard:add-server' %}">
|
href="{% url 'wireguard:add-server' %}">
|
||||||
<span class="fa fa-plus" aria-hidden="true"></span>
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
||||||
{% trans "Add Connection to Server" %}
|
{% trans "Add Connection to Server" %}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<h3>{{ title }}</h3>
|
<h3>{{ title }}</h3>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-add-client" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
{{ form|bootstrap }}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<h3>{{ title }}</h3>
|
<h3>{{ title }}</h3>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-add-server" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
{{ form|bootstrap }}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<b>{{ public_key }}</b>
|
<b>{{ public_key }}</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-delete-client" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<input type="submit" class="btn btn-danger"
|
<input type="submit" class="btn btn-danger"
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-delete-server" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<input type="submit" class="btn btn-danger"
|
<input type="submit" class="btn btn-danger"
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<h3>{{ title }}</h3>
|
<h3>{{ title }}</h3>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-edit-client" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
{{ form|bootstrap }}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<h3>{{ title }}</h3>
|
<h3>{{ title }}</h3>
|
||||||
|
|
||||||
<form class="form" method="post">
|
<form class="form form-edit-server" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
{{ form|bootstrap }}
|
||||||
|
|||||||
@ -17,19 +17,19 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr class="client-public-key">
|
||||||
<th>{% trans "Client public key:" %}</th>
|
<th>{% trans "Client public key:" %}</th>
|
||||||
<td>{{ client.public_key }}</td>
|
<td>{{ client.public_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="client-allowed-ips">
|
||||||
<th>{% trans "IP address to use for client:" %}</th>
|
<th>{% trans "IP address to use for client:" %}</th>
|
||||||
<td>{{ client.allowed_ips|join:", " }}</td>
|
<td>{{ client.allowed_ips|join:", " }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="client-preshared-key">
|
||||||
<th>{% trans "Pre-shared key:" %}</th>
|
<th>{% trans "Pre-shared key:" %}</th>
|
||||||
<td>{{ client.preshared_key }}</td>
|
<td>{{ client.preshared_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="server-endpoints">
|
||||||
<th>{% trans "Server endpoints:" %}</th>
|
<th>{% trans "Server endpoints:" %}</th>
|
||||||
<td>
|
<td>
|
||||||
{% for endpoint in endpoints %}
|
{% for endpoint in endpoints %}
|
||||||
@ -37,7 +37,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="server-public-key">
|
||||||
<th>{% trans "Server public key:" %}</th>
|
<th>{% trans "Server public key:" %}</th>
|
||||||
<td>{{ server.public_key }}</td>
|
<td>{{ server.public_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -49,15 +49,15 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr class="client-transfer-tx">
|
||||||
<th>{% trans "Data transmitted:" %}</th>
|
<th>{% trans "Data transmitted:" %}</th>
|
||||||
<td>{{ client.status.transfer_tx|filesizeformat }}</td>
|
<td>{{ client.status.transfer_tx|filesizeformat }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="client-transfer-rx">
|
||||||
<th>{% trans "Data received:" %}</th>
|
<th>{% trans "Data received:" %}</th>
|
||||||
<td>{{ client.status.transfer_rx|filesizeformat }}</td>
|
<td>{{ client.status.transfer_rx|filesizeformat }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="client-latest-handshake">
|
||||||
<th>{% trans "Latest handshake:" %}</th>
|
<th>{% trans "Latest handshake:" %}</th>
|
||||||
<td>{{ client.status.latest_handshake|default:'' }}</td>
|
<td>{{ client.status.latest_handshake|default:'' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -66,12 +66,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<a class="btn btn-default"
|
<a class="btn btn-default btn-edit-client"
|
||||||
href="{% url 'wireguard:edit-client' client.public_key|urlencode:'' %}">
|
href="{% url 'wireguard:edit-client' client.public_key|urlencode:'' %}">
|
||||||
<span class="fa fa-pencil-square-o" aria-hidden="true"></span>
|
<span class="fa fa-pencil-square-o" aria-hidden="true"></span>
|
||||||
{% trans "Edit" %}
|
{% trans "Edit" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-default"
|
<a class="btn btn-default btn-delete-client"
|
||||||
href="{% url 'wireguard:delete-client' client.public_key|urlencode:'' %}">
|
href="{% url 'wireguard:delete-client' client.public_key|urlencode:'' %}">
|
||||||
<span class="fa fa-trash-o" aria-hidden="true"></span>
|
<span class="fa fa-trash-o" aria-hidden="true"></span>
|
||||||
{% trans "Delete" %}
|
{% trans "Delete" %}
|
||||||
|
|||||||
@ -20,23 +20,23 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr class="peer-endpoint">
|
||||||
<th>{% trans "Server endpoint:" %}</th>
|
<th>{% trans "Server endpoint:" %}</th>
|
||||||
<td>{{ peer.endpoint }}</td>
|
<td>{{ peer.endpoint }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="peer-public-key">
|
||||||
<th>{% trans "Server public key:" %}</th>
|
<th>{% trans "Server public key:" %}</th>
|
||||||
<td>{{ peer.public_key }}</td>
|
<td>{{ peer.public_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="peer-preshared-key">
|
||||||
<th>{% trans "Pre-shared key:" %}</th>
|
<th>{% trans "Pre-shared key:" %}</th>
|
||||||
<td>{{ peer.preshared_key }}</td>
|
<td>{{ peer.preshared_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="server-public-key">
|
||||||
<th>{% trans "Public key of this machine:" %}</th>
|
<th>{% trans "Public key of this machine:" %}</th>
|
||||||
<td>{{ server.public_key }}</td>
|
<td>{{ server.public_key }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="server-ip-address">
|
||||||
<th>{% trans "IP address of this machine:" %}</th>
|
<th>{% trans "IP address of this machine:" %}</th>
|
||||||
<td>{{ server.ip_address }}</td>
|
<td>{{ server.ip_address }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -48,15 +48,15 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr class="peer-transfer-tx">
|
||||||
<th>{% trans "Data transmitted:" %}</th>
|
<th>{% trans "Data transmitted:" %}</th>
|
||||||
<td>{{ peer.status.transfer_tx|filesizeformat }}</td>
|
<td>{{ peer.status.transfer_tx|filesizeformat }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="peer-transfer-rx">
|
||||||
<th>{% trans "Data received:" %}</th>
|
<th>{% trans "Data received:" %}</th>
|
||||||
<td>{{ peer.status.transfer_rx|filesizeformat }}</td>
|
<td>{{ peer.status.transfer_rx|filesizeformat }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="peer-latest-handshake">
|
||||||
<th>{% trans "Latest handshake:" %}</th>
|
<th>{% trans "Latest handshake:" %}</th>
|
||||||
<td>{{ peer.status.latest_handshake|default:'' }}</td>
|
<td>{{ peer.status.latest_handshake|default:'' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -67,12 +67,12 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<div class="btn-toolbar">
|
<div class="btn-toolbar">
|
||||||
<a class="btn btn-default"
|
<a class="btn btn-default btn-edit-server"
|
||||||
href="{% url 'wireguard:edit-server' interface %}">
|
href="{% url 'wireguard:edit-server' interface %}">
|
||||||
<span class="fa fa-pencil-square-o" aria-hidden="true"></span>
|
<span class="fa fa-pencil-square-o" aria-hidden="true"></span>
|
||||||
{% trans "Edit" %}
|
{% trans "Edit" %}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-default"
|
<a class="btn btn-default btn-delete-server"
|
||||||
href="{% url 'wireguard:delete-server' interface %}">
|
href="{% url 'wireguard:delete-server' interface %}">
|
||||||
<span class="fa fa-trash-o" aria-hidden="true"></span>
|
<span class="fa fa-trash-o" aria-hidden="true"></span>
|
||||||
{% trans "Delete" %}
|
{% trans "Delete" %}
|
||||||
|
|||||||
194
plinth/modules/wireguard/tests/test_functional.py
Normal file
194
plinth/modules/wireguard/tests/test_functional.py
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
"""
|
||||||
|
Functional, browser based tests for wireguard app.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from plinth.tests import functional
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.apps, pytest.mark.wireguard]
|
||||||
|
|
||||||
|
|
||||||
|
class TestWireguardApp(functional.BaseAppTests):
|
||||||
|
app_name = 'wireguard'
|
||||||
|
has_web = False
|
||||||
|
|
||||||
|
_client_public_key1 = '8dlHfuAsU0WsnpQkNd8fguwmBtFX5/CkO0xYKbNBt24='
|
||||||
|
_client_public_key2 = 'xM/vyXbYtMf9bDTZY3W2x7Moxw4m1ckpnZvVSd4DLho='
|
||||||
|
|
||||||
|
_server = [
|
||||||
|
{
|
||||||
|
'peer_endpoint': 'wg1.example.org:1234',
|
||||||
|
'peer_public_key': 'HBCqZk4B93N6q19zNleJkAVs+PEfWAPgPpKnrhL/CVw=',
|
||||||
|
'ip_address': '10.0.0.2',
|
||||||
|
'private_key': '',
|
||||||
|
'preshared_key': ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'peer_endpoint': 'wg2.example.org:5678',
|
||||||
|
'peer_public_key': 'Z/iHo0vaeSN8Ykk5KwhQ819MMU5nyzD7y7xFFthlxXI=',
|
||||||
|
'ip_address': '192.168.0.2',
|
||||||
|
'private_key': 'QC2xEZMn3bgNsSVFrU51+ALSUiUaWg6gRWigh3EeVm0=',
|
||||||
|
'preshared_key': 'AHxZ4Rr8Ij4L1aq+ceusSIgBfluqiI9Vb5I2UtQFanI='
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
def test_backup_restore(self, session_browser):
|
||||||
|
"""Skip the test."""
|
||||||
|
pytest.skip('Does not implement backup/restore.')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _get_client_href(key):
|
||||||
|
"""Return the href for client show page."""
|
||||||
|
key = urllib.parse.quote(urllib.parse.quote(key, safe=''))
|
||||||
|
return f'/plinth/apps/wireguard/client/{key}/show/'
|
||||||
|
|
||||||
|
def _client_exists(self, browser, key):
|
||||||
|
"""Check whether a client key exists."""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
href = browser.links.find_by_href(self._get_client_href(key))
|
||||||
|
return bool(href)
|
||||||
|
|
||||||
|
def _assert_client_details(self, browser, key):
|
||||||
|
"""Check that the client's details are correct."""
|
||||||
|
|
||||||
|
def get_value(key):
|
||||||
|
return browser.find_by_css(f'tr.{key} > td').first.text
|
||||||
|
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
href = browser.links.find_by_href(self._get_client_href(key))
|
||||||
|
href.first.click()
|
||||||
|
assert get_value('client-public-key') == key
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _add_client(browser, key):
|
||||||
|
"""Add a client."""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
browser.find_by_css('.btn-add-client').first.click()
|
||||||
|
browser.find_by_id('id_public_key').fill(key)
|
||||||
|
functional.submit(browser, form_class='form-add-client')
|
||||||
|
|
||||||
|
def _edit_client(self, browser, key1, key2):
|
||||||
|
"""Edit a client"""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
browser.links.find_by_href(self._get_client_href(key1)).first.click()
|
||||||
|
browser.find_by_css('.btn-edit-client').first.click()
|
||||||
|
browser.find_by_id('id_public_key').fill(key2)
|
||||||
|
functional.submit(browser, form_class='form-edit-client')
|
||||||
|
|
||||||
|
def _delete_client(self, browser, key):
|
||||||
|
"""Delete a client"""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
browser.links.find_by_href(self._get_client_href(key)).first.click()
|
||||||
|
browser.find_by_css('.btn-delete-client').first.click()
|
||||||
|
functional.submit(browser, form_class='form-delete-client')
|
||||||
|
|
||||||
|
def test_add_edit_delete_client(self, session_browser):
|
||||||
|
"""Test adding, editing and deleting a WireGuard client."""
|
||||||
|
if self._client_exists(session_browser, self._client_public_key1):
|
||||||
|
self._delete_client(session_browser, self._client_public_key1)
|
||||||
|
|
||||||
|
if self._client_exists(session_browser, self._client_public_key2):
|
||||||
|
self._delete_client(session_browser, self._client_public_key2)
|
||||||
|
|
||||||
|
self._add_client(session_browser, self._client_public_key1)
|
||||||
|
assert self._client_exists(session_browser, self._client_public_key1)
|
||||||
|
|
||||||
|
self._edit_client(session_browser, self._client_public_key1,
|
||||||
|
self._client_public_key2)
|
||||||
|
assert not self._client_exists(session_browser,
|
||||||
|
self._client_public_key1)
|
||||||
|
assert self._client_exists(session_browser, self._client_public_key2)
|
||||||
|
|
||||||
|
self._delete_client(session_browser, self._client_public_key2)
|
||||||
|
assert not self._client_exists(session_browser,
|
||||||
|
self._client_public_key2)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _get_server_href(browser, key):
|
||||||
|
"""Return the href for server show page."""
|
||||||
|
return browser.find_by_css(
|
||||||
|
f'.peer-public-key[data-public-key="{key}"] a')
|
||||||
|
|
||||||
|
def _server_exists(self, browser, config):
|
||||||
|
"""Check whether a server key exists."""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
href = self._get_server_href(browser, config['peer_public_key'])
|
||||||
|
return bool(href)
|
||||||
|
|
||||||
|
def _assert_server_details(self, browser, config):
|
||||||
|
"""Check that the server's details are correct."""
|
||||||
|
|
||||||
|
def get_value(key):
|
||||||
|
return browser.find_by_css(f'tr.{key} > td').first.text
|
||||||
|
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
href = self._get_server_href(browser, config['peer_public_key'])
|
||||||
|
href.first.click()
|
||||||
|
assert get_value('peer-endpoint') == config['peer_endpoint']
|
||||||
|
assert get_value('peer-public-key') == config['peer_public_key']
|
||||||
|
assert get_value('server-ip-address') == config['ip_address']
|
||||||
|
assert get_value('peer-preshared-key') == (config['preshared_key']
|
||||||
|
or 'None')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _add_server(browser, config):
|
||||||
|
"""Add a server."""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
browser.find_by_css('.btn-add-server').first.click()
|
||||||
|
browser.find_by_id('id_peer_endpoint').fill(config['peer_endpoint'])
|
||||||
|
browser.find_by_id('id_peer_public_key').fill(
|
||||||
|
config['peer_public_key'])
|
||||||
|
browser.find_by_id('id_ip_address').fill(config['ip_address'])
|
||||||
|
browser.find_by_id('id_private_key').fill(config['private_key'])
|
||||||
|
browser.find_by_id('id_preshared_key').fill(config['preshared_key'])
|
||||||
|
functional.submit(browser, form_class='form-add-server')
|
||||||
|
|
||||||
|
def _edit_server(self, browser, config1, config2):
|
||||||
|
"""Edit a server."""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
self._get_server_href(browser,
|
||||||
|
config1['peer_public_key']).first.click()
|
||||||
|
browser.find_by_css('.btn-edit-server').first.click()
|
||||||
|
browser.find_by_id('id_peer_endpoint').fill(config2['peer_endpoint'])
|
||||||
|
browser.find_by_id('id_peer_public_key').fill(
|
||||||
|
config2['peer_public_key'])
|
||||||
|
browser.find_by_id('id_ip_address').fill(config2['ip_address'])
|
||||||
|
browser.find_by_id('id_private_key').fill(config2['private_key'])
|
||||||
|
browser.find_by_id('id_preshared_key').fill(config2['preshared_key'])
|
||||||
|
functional.submit(browser, form_class='form-edit-server')
|
||||||
|
|
||||||
|
def _delete_server(self, browser, config):
|
||||||
|
"""Delete a server"""
|
||||||
|
functional.nav_to_module(browser, 'wireguard')
|
||||||
|
self._get_server_href(browser, config['peer_public_key']).first.click()
|
||||||
|
browser.find_by_css('.btn-delete-server').first.click()
|
||||||
|
functional.submit(browser, form_class='form-delete-server')
|
||||||
|
|
||||||
|
def test_add_edit_delete_server(self, session_browser):
|
||||||
|
"""Test adding, editing and deleting a WireGuard server."""
|
||||||
|
if self._server_exists(session_browser, self._server[0]):
|
||||||
|
self._delete_server(session_browser, self._server[0])
|
||||||
|
|
||||||
|
if self._server_exists(session_browser, self._server[1]):
|
||||||
|
self._delete_server(session_browser, self._server[1])
|
||||||
|
|
||||||
|
self._add_server(session_browser, self._server[0])
|
||||||
|
self._assert_server_details(session_browser, self._server[0])
|
||||||
|
|
||||||
|
# XXX: Editing the connection is very flaky. Fails, incorrect and
|
||||||
|
# crashes. Fix it.
|
||||||
|
|
||||||
|
# self._edit_server(session_browser, self._server[0],
|
||||||
|
# self._server[1]) assert not self._server_exists(session_browser,
|
||||||
|
# self._server[0]) self._assert_server_details(session_browser,
|
||||||
|
# self._server[1])
|
||||||
|
|
||||||
|
# self._delete_server(session_browser, self._server[1])
|
||||||
|
# assert not self._server_exists(session_browser, self._server[1])
|
||||||
|
|
||||||
|
self._delete_server(session_browser, self._server[0])
|
||||||
|
assert not self._server_exists(session_browser, self._server[0])
|
||||||
@ -169,7 +169,7 @@ def add_server(settings):
|
|||||||
|
|
||||||
|
|
||||||
def edit_server(interface, settings):
|
def edit_server(interface, settings):
|
||||||
"""Edit information for a connecting to a server."""
|
"""Edit information for connecting to a server."""
|
||||||
settings['common']['interface'] = interface
|
settings['common']['interface'] = interface
|
||||||
settings['common']['name'] = 'WireGuard-Client-' + interface
|
settings['common']['name'] = 'WireGuard-Client-' + interface
|
||||||
if not settings['wireguard']['private_key']:
|
if not settings['wireguard']['private_key']:
|
||||||
|
|||||||
@ -65,6 +65,7 @@ markers = [
|
|||||||
"ttrss",
|
"ttrss",
|
||||||
"upgrades",
|
"upgrades",
|
||||||
"users",
|
"users",
|
||||||
|
"wireguard",
|
||||||
"wordpress",
|
"wordpress",
|
||||||
"zoph",
|
"zoph",
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user