diff --git a/functional_tests/features/coquelicot.feature b/functional_tests/features/coquelicot.feature index 6f0dc9906..34f4f4dd9 100644 --- a/functional_tests/features/coquelicot.feature +++ b/functional_tests/features/coquelicot.feature @@ -15,7 +15,7 @@ # along with this program. If not, see . # -@apps @coquelicot +@apps @coquelicot @backups Feature: Coquelicot File Sharing Run Coquelicot File Sharing server. @@ -47,3 +47,16 @@ Scenario: Modify maximum upload size in disabled case Given the coquelicot application is disabled When I modify the maximum file size of coquelicot to 123 Then the coquelicot service should not be running + +Scenario: Backup and restore coquelicot + Given the coquelicot application is enabled + When I modify the coquelicot upload password to beforebackup123 + And I modify the maximum file size of coquelicot to 128 + And I create a backup of the coquelicot app data + And I export the coquelicot app data backup + And I modify the coquelicot upload password to afterbackup123 + And I modify the maximum file size of coquelicot to 64 + And I restore the coquelicot app data backup + Then the coquelicot service should be running + And I should be able to login to coquelicot with password beforebackup123 + And the maximum file size of coquelicot should be 128 diff --git a/plinth/modules/coquelicot/__init__.py b/plinth/modules/coquelicot/__init__.py index b6ebbd83f..255edd97a 100644 --- a/plinth/modules/coquelicot/__init__.py +++ b/plinth/modules/coquelicot/__init__.py @@ -24,7 +24,7 @@ from plinth import service as service_module from plinth import action_utils, actions, frontpage from plinth.menu import main_menu -from .manifest import clients +from .manifest import backup, clients clients = clients diff --git a/plinth/modules/coquelicot/manifest.py b/plinth/modules/coquelicot/manifest.py index 4cacade2b..c6e3483dd 100644 --- a/plinth/modules/coquelicot/manifest.py +++ b/plinth/modules/coquelicot/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_backups clients = validate([{ 'name': _('coquelicot'), @@ -26,3 +27,13 @@ clients = validate([{ 'url': '/coquelicot' }] }]) + +backup = validate_backups({ + 'data': { + 'directories': ['/var/lib/coquelicot'] + }, + 'secrets': { + 'files': ['/etc/coquelicot/settings.yml'] + }, + 'services': ['coquelicot'] +})