mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
shadowsocks: Enable backup/restore
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
5f15fdda45
commit
5ee0f71e62
5 files changed
+70
-5
No files matched your search
@@ -34,3 +34,12 @@ Scenario: Disable shadowsocks application
|
||||
When I disable the shadowsocks application
|
||||
Then the shadowsocks service should not be running
|
||||
|
||||
Scenario: Backup and restore shadowsocks
|
||||
Given the shadowsocks application is enabled
|
||||
When I configure shadowsocks with server beforebackup.example.com and password beforebackup123
|
||||
And I create a backup of the shadowsocks app data
|
||||
And I configure shadowsocks with server afterbackup.example.com and password afterbackup123
|
||||
And I export the shadowsocks app data backup
|
||||
And I restore the shadowsocks app data backup
|
||||
Then the shadowsocks service should be running
|
||||
And shadowsocks should be configured with server beforebackup.example.com and password beforebackup123
|
||||
@@ -96,7 +96,25 @@ def select_domain_name(browser, app_name, domain_name):
|
||||
|
||||
@given('the shadowsocks application is configured')
|
||||
def configure_shadowsocks(browser):
|
||||
application.configure_shadowsocks(browser)
|
||||
application.configure_shadowsocks(browser, 'some.shadow.tunnel',
|
||||
'fakepassword')
|
||||
|
||||
|
||||
@when(
|
||||
parsers.parse(
|
||||
'I configure shadowsocks with server {server:S} and password {password:w}'
|
||||
))
|
||||
def configure_shadowsocks_with_details(browser, server, password):
|
||||
application.configure_shadowsocks(browser, server, password)
|
||||
|
||||
|
||||
@then(
|
||||
parsers.parse(
|
||||
'shadowsocks should be configured with server {server:S} and password {password:w}'
|
||||
))
|
||||
def assert_shadowsocks_configuration(browser, server, password):
|
||||
assert (server,
|
||||
password) == application.shadowsocks_get_configuration(browser)
|
||||
|
||||
|
||||
@when(
|
||||
|
||||
@@ -116,14 +116,22 @@ def select_domain_name(browser, app_name, domain_name):
|
||||
interface.submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
def configure_shadowsocks(browser):
|
||||
"""Configure shadowsocks client with some fake server details"""
|
||||
def configure_shadowsocks(browser, server, password):
|
||||
"""Configure shadowsocks client with given server details."""
|
||||
browser.visit('{}/plinth/apps/shadowsocks/'.format(default_url))
|
||||
browser.find_by_id('id_server').fill('some.shadow.tunnel')
|
||||
browser.find_by_id('id_password').fill('fakepassword')
|
||||
browser.find_by_id('id_server').fill(server)
|
||||
browser.find_by_id('id_password').fill(password)
|
||||
interface.submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
def shadowsocks_get_configuration(browser):
|
||||
"""Return the server and password currently configured in shadowsocks."""
|
||||
browser.visit('{}/plinth/apps/shadowsocks/'.format(default_url))
|
||||
server = browser.find_by_id('id_server').value
|
||||
password = browser.find_by_id('id_password').value
|
||||
return server, password
|
||||
|
||||
|
||||
def modify_max_file_size(browser, size):
|
||||
"""Change the maximum file size of coquelicot to the given value"""
|
||||
browser.visit('{}/plinth/apps/coquelicot/'.format(default_url))
|
||||
|
||||
Reference in new issue
Block a user