Skip to content

Commit

Permalink
systemtests: setup test to check resource available in show
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri authored and joergsteffens committed Nov 30, 2022
1 parent b0c1b01 commit 61e1976
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
@@ -0,0 +1,3 @@
Counter {
name = "random-counter"
}
@@ -0,0 +1,4 @@
Schedule {
Name = "TestCycle"
Run = Full at 14:00
}
@@ -0,0 +1,3 @@
User {
name = "random-user"
}
2 changes: 1 addition & 1 deletion systemtests/tests/python-bareos/test_list_command.py
Expand Up @@ -238,7 +238,7 @@ def test_list_jobs(self):
self.assertTrue(result["jobs"])
for job in result["jobs"]:
self.assertTrue(job["jobstatus"], "T")

# running a job a canceling
director.call("run job=backup-bareos-fd yes")
director.call("cancel job=backup-bareos-fd yes")
Expand Down
38 changes: 37 additions & 1 deletion systemtests/tests/python-bareos/test_show.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 @@ -74,3 +74,39 @@ def test_fileset(self):
fileset_show_description = result["filesets"][fileset]["description"]

self.assertIn(fileset_show_description, fileset_content_list)

def test_show_resources(self):
"""
show resources in bconsole
"""

username = self.get_operator_username()
password = self.get_operator_password(username)

director = bareos.bsock.DirectorConsoleJson(
address=self.director_address,
port=self.director_port,
name=username,
password=password,
**self.director_extra_options
)
list_of_resources = {
"directors",
"clients",
"jobs",
"jobdefs",
"storages",
"schedules",
"catalogs",
"filesets",
"pools",
"messages",
"profiles",
"consoles",
"counters",
"users",
}
for resource in list_of_resources:
call = director.call("show {}".format(resource))
result = call[resource]
self.assertTrue(len(result) > 0)

0 comments on commit 61e1976

Please sign in to comment.