diff --git a/functional_tests/features/tahoe.feature b/functional_tests/features/tahoe.feature index fa78bcc59..c0d657fd9 100644 --- a/functional_tests/features/tahoe.feature +++ b/functional_tests/features/tahoe.feature @@ -19,7 +19,7 @@ # /var/lib/tahoe-lafs and failes to start in the next run. Enable tests after # this is fixed. -@apps @tahoe @skip +@apps @tahoe @backups @skip Feature: Tahoe-LAFS distribute file storage Run the Tahoe distribute file storage server @@ -34,11 +34,6 @@ Scenario: Enable tahoe application When I enable the tahoe application Then the tahoe service should be running -Scenario: Disable tahoe application - Given the tahoe application is enabled - When I disable the tahoe application - Then the tahoe service should not be running - Scenario: Default tahoe introducers Given the tahoe application is enabled Then mydomain.example should be a tahoe local introducer @@ -55,3 +50,18 @@ Scenario: Remove tahoe introducer And anotherdomain.example is a tahoe introducer When I remove anotherdomain.example as a tahoe introducer Then anotherdomain.example should not be a tahoe connected introducer + +Scenario: Backup and restore tahoe + Given the tahoe application is enabled + And backupdomain.example is a tahoe introducer + When I create a backup of the tahoe app data + And I remove backupdomain.example as a tahoe introducer + And I export the tahoe app data backup + And I restore the tahoe app data backup + Then the tahoe service should be running + And backupdomain.example should be a tahoe connected introducer + +Scenario: Disable tahoe application + Given the tahoe application is enabled + When I disable the tahoe application + Then the tahoe service should not be running diff --git a/plinth/modules/tahoe/__init__.py b/plinth/modules/tahoe/__init__.py index c6be36264..a30753f35 100644 --- a/plinth/modules/tahoe/__init__.py +++ b/plinth/modules/tahoe/__init__.py @@ -32,6 +32,7 @@ from plinth.menu import main_menu from plinth.utils import format_lazy from .errors import TahoeConfigurationError +from .manifest import backup version = 1 diff --git a/plinth/modules/tahoe/manifest.py b/plinth/modules/tahoe/manifest.py new file mode 100644 index 000000000..d5129735f --- /dev/null +++ b/plinth/modules/tahoe/manifest.py @@ -0,0 +1,28 @@ +# +# This file is part of FreedomBox. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +""" +Application manfiest for tahoe-lafs. +""" + +from plinth.modules.backups.api import validate as validate_backup + +backup = validate_backup({ + 'secrets': { + 'directories': ['/var/lib/tahoe-lafs/'] + }, + 'services': ['tahoe-lafs'] +})