Skip to content

Commit

Permalink
systemtests: add 'status subscription' ACL test
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens authored and arogge committed Dec 8, 2022
1 parent e42d96a commit 592c5db
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Expand Up @@ -23,4 +23,6 @@ Director { # define myself
# Plugin Names = ""
Working Directory = "@working_dir@"
DirPort = @dir_port@

Subscriptions = 10
}
29 changes: 28 additions & 1 deletion systemtests/tests/python-bareos/test_acl.py
@@ -1,7 +1,7 @@
#
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2019-2021 Bareos GmbH & Co. KG
# Copyright (C) 2019-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -375,3 +375,30 @@ def test_json_list_jobid_with_job_acl(self):
#
self._test_list_with_valid_jobid(director, jobid1)
self._test_list_with_invalid_jobid(director, jobid2)

def _test_status_subscription(self, username, password):
logger = logging.getLogger()

configured_subscriptions = "10"

director_root = bareos.bsock.DirectorConsoleJson(
address=self.director_address,
port=self.director_port,
name=username,
password=password,
**self.director_extra_options
)

result = director_root.call("status subscription all")
self.assertEqual(
configured_subscriptions, result["total-units-required"]["configured"]
)

def test_status_subscription_admin(self):
username = self.get_operator_username()
password = self.get_operator_password(username)
self._test_status_subscription(username, password)

def test_status_subscription_user_fails(self):
with self.assertRaises(bareos.exceptions.JsonRpcErrorReceivedException):
self._test_status_subscription(u"client-bareos-fd", u"secret")

0 comments on commit 592c5db

Please sign in to comment.