From 80858796439dd0ee675b58d50285e67c92c97586 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Wed, 23 Dec 2020 16:02:28 +0530 Subject: [PATCH] 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 Reviewed-by: Veiko Aasa --- plinth/modules/deluge/tests/deluge.feature | 12 ++++++++++++ plinth/tests/functional/step_definitions.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plinth/modules/deluge/tests/deluge.feature b/plinth/modules/deluge/tests/deluge.feature index 419a9a45c..67bd401fc 100644 --- a/plinth/modules/deluge/tests/deluge.feature +++ b/plinth/modules/deluge/tests/deluge.feature @@ -13,6 +13,18 @@ Scenario: Enable deluge application When I enable the deluge application 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 Given the deluge application is enabled When all torrents are removed from deluge diff --git a/plinth/tests/functional/step_definitions.py b/plinth/tests/functional/step_definitions.py index abc5d883f..e659068ca 100644 --- a/plinth/tests/functional/step_definitions.py +++ b/plinth/tests/functional/step_definitions.py @@ -170,7 +170,7 @@ def create_user(session_browser, name, password): @when( 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): if not functional.user_exists(session_browser, name): functional.create_user(session_browser, name, password, groups=[group])