deluge: Allow to set a download directory

- add directory selection form to the app configuration page
- add debian-deluged user to the freedombox-share group
- storage: new validator parameter check-creatable
  (because deluged is able to create subdirectories)

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Veiko Aasa authored and James Valleroy committed 2020-01-25 18:27:11 -05:00
1 parent e217a4c87e
commit 8e698987de
8 files changed
+195 -17

No files matched your search

+17 -1
View File
@@ -247,11 +247,14 @@ class TestActions:
subprocess.run(command, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, check=True)
def assert_validate_directory(self, path, error, check_writable=False):
def assert_validate_directory(self, path, error, check_writable=False,
check_creatable=False):
"""Perform directory validation checks."""
action_command = ['storage', 'validate-directory', '--path', path]
if check_writable:
action_command += ['--check-writable']
if check_creatable:
action_command += ['--check-creatable']
proc = self.call_action(action_command, stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
output = proc.stdout.decode()
@@ -291,3 +294,16 @@ class TestActions:
"""Test that directory writable validation returns expected output."""
self.assert_validate_directory(directory['path'], directory['error'],
check_writable=True)
@pytest.mark.usefixtures('needs_not_root')
@pytest.mark.parametrize('directory', [{
'path': '/var/lib/plinth_storage_test_not_exists',
'error': '4'
}, {
'path': '/tmp/plint_storage_test_not_exists',
'error': ''
}])
def test_validate_directory_creatable(self, directory):
"""Test that directory creatable validation returns expected output."""
self.assert_validate_directory(directory['path'], directory['error'],
check_creatable=True)