Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Dec 12, 2024
1 parent 05ed97b commit 5d4f8e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/api2/test_job_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def mock(self, *args):
return job.id
"""):
with mock("test.test2", """
from middlewared.service import job
@job(logs=True)
def mock(self, job, *args):
job.logs_fd.write(b'Job logs')
Expand All @@ -64,12 +66,14 @@ def mock(self, job, *args):

def test_job_download_logs_unprivileged_downloads_internal_logs_with_read_role(c_replication_read):
with mock("test.test1", """
from middlewared.service import accepts, job
from middlewared.service import job
@job(logs=True, read_roles=["REPLICATION_TASK_READ"])
def mock(self, job, *args):
job.logs_fd.write(b'Job logs')
"""):
c = c_replication_read

jid = call("test.test1")

c.call("core.job_wait", jid, job=True)
Expand Down

0 comments on commit 5d4f8e9

Please sign in to comment.