transmission: Enable backup/restore

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2018-10-03 11:49:09 -07:00 committed by James Valleroy
parent eea5d6b754
commit e001a37449
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
4 changed files with 23 additions and 2 deletions

View File

@ -27,7 +27,6 @@ import sys
from plinth import action_utils
SERVICE_CONFIG = '/etc/default/transmission-daemon'
TRANSMISSION_CONFIG = '/etc/transmission-daemon/settings.json'

View File

@ -38,3 +38,14 @@ Scenario: Upload a torrent to transmission
When all torrents are removed from transmission
And I upload a sample torrent to transmission
Then there should be 1 torrents listed in transmission
Scenario: Backup and restore transmission
Given the transmission application is enabled
When all torrents are removed from transmission
And I upload a sample torrent to transmission
And I create a backup of the transmission app data
And I export the transmission app data backup
And all torrents are removed from transmission
And I restore the transmission app data backup
Then the transmission service should be running
And there should be 1 torrents listed in transmission

View File

@ -27,7 +27,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

View File

@ -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': _('Transmission'),
@ -26,3 +27,13 @@ clients = validate([{
'url': '/transmission'
}]
}])
backup = validate_backup({
'data': {
'directories': ['/var/lib/transmission-daemon/.config']
},
'secrets': {
'files': ['/etc/transmission-daemon/settings.json']
},
'services': ['transmission-daemon']
})