deluge: Functional tests for bit-torrent group

Add tests to check that usage of Deluge is only permitted to users in
the group 'bit-torrent'.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Joseph Nuthalapati 2020-12-23 16:02:28 +05:30 committed by Veiko Aasa
parent c975fb94e3
commit 8085879643
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
2 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,18 @@ Scenario: Enable deluge application
When I enable the deluge application When I enable the deluge application
Then the deluge site should be available Then the deluge site should be available
Scenario: User of 'bit-torrent' group
Given the deluge application is enabled
When I create a user named delugeuser with password deluge&456 in group bit-torrent
And I'm logged in as the user delugeuser with password deluge&456
Then the deluge site should be available
Scenario: User not of 'bit-torrent' group
Given the deluge application is enabled
When I create a user named nogroupuser with password somep@ssw6
And I'm logged in as the user nogroupuser with password somep@ssw6
Then the deluge site should not be available
Scenario: Upload a torrent to deluge Scenario: Upload a torrent to deluge
Given the deluge application is enabled Given the deluge application is enabled
When all torrents are removed from deluge When all torrents are removed from deluge

View File

@ -170,7 +170,7 @@ def create_user(session_browser, name, password):
@when( @when(
parsers.parse('I create a user named {name:w} with password {password:S} ' parsers.parse('I create a user named {name:w} with password {password:S} '
'in group {group:w}')) 'in group {group:S}'))
def create_user_in_group(session_browser, name, password, group): def create_user_in_group(session_browser, name, password, group):
if not functional.user_exists(session_browser, name): if not functional.user_exists(session_browser, name):
functional.create_user(session_browser, name, password, groups=[group]) functional.create_user(session_browser, name, password, groups=[group])