diff --git a/functional_tests/features/deluge.feature b/functional_tests/features/deluge.feature index c87d77842..0e2bbe626 100644 --- a/functional_tests/features/deluge.feature +++ b/functional_tests/features/deluge.feature @@ -38,3 +38,14 @@ Scenario: Upload a torrent to deluge When all torrents are removed from deluge And I upload a sample torrent to deluge Then there should be 1 torrents listed in deluge + +Scenario: Backup and restore deluge + Given the deluge application is enabled + When all torrents are removed from deluge + And I upload a sample torrent to deluge + And I create a backup of the deluge app data + And I export the deluge app data backup + And all torrents are removed from deluge + And I restore the deluge app data backup + Then the deluge service should be running + And there should be 1 torrents listed in deluge diff --git a/plinth/modules/deluge/__init__.py b/plinth/modules/deluge/__init__.py index 6cfaab34c..bc8c52a59 100644 --- a/plinth/modules/deluge/__init__.py +++ b/plinth/modules/deluge/__init__.py @@ -25,7 +25,7 @@ from plinth import action_utils, actions, frontpage from plinth.menu import main_menu from plinth.modules.users import register_group -from .manifest import clients +from .manifest import backup, clients version = 2 diff --git a/plinth/modules/deluge/manifest.py b/plinth/modules/deluge/manifest.py index 16083f254..2adfadc1f 100644 --- a/plinth/modules/deluge/manifest.py +++ b/plinth/modules/deluge/manifest.py @@ -18,6 +18,7 @@ from django.utils.translation import ugettext_lazy as _ from plinth.clients import validate +from plinth.modules.backups.api import validate as validate_backup clients = validate([{ 'name': _('Deluge'), @@ -27,3 +28,10 @@ clients = validate([{ 'url': '/deluge' }] }]) + +backup = validate_backup({ + 'config': { + 'directories': ['/var/lib/deluged/.config', '/var/lib/deluged/config'] + }, + 'services': ['deluge-web'] +})