diff --git a/src/deadline_test_fixtures/fixtures.py b/src/deadline_test_fixtures/fixtures.py index b32cdb6c..b8d8f2ba 100644 --- a/src/deadline_test_fixtures/fixtures.py +++ b/src/deadline_test_fixtures/fixtures.py @@ -56,7 +56,9 @@ class BootstrapResources: job_attachments_root_prefix: InitVar[str | None] = None job_run_as_user: JobRunAsUser = field( - default_factory=lambda: JobRunAsUser(PosixSessionUser("", "")) + default_factory=lambda: JobRunAsUser( + posix=PosixSessionUser("", ""), runAs="WORKER_AGENT_USER" + ) ) def __post_init__( diff --git a/src/deadline_test_fixtures/job_attachment_manager.py b/src/deadline_test_fixtures/job_attachment_manager.py index 1edf438b..aaa6fa08 100644 --- a/src/deadline_test_fixtures/job_attachment_manager.py +++ b/src/deadline_test_fixtures/job_attachment_manager.py @@ -58,13 +58,17 @@ def deploy_resources(self): client=self.deadline_client, display_name="job_attachments_test_queue", farm=self.farm, - job_run_as_user=JobRunAsUser(PosixSessionUser("", "")), + job_run_as_user=JobRunAsUser( + posix=PosixSessionUser("", ""), runAs="WORKER_AGENT_USER" + ), ) self.queue_with_no_settings = Queue.create( client=self.deadline_client, display_name="job_attachments_test_no_settings_queue", farm=self.farm, - job_run_as_user=JobRunAsUser(PosixSessionUser("", "")), + job_run_as_user=JobRunAsUser( + posix=PosixSessionUser("", ""), runAs="WORKER_AGENT_USER" + ), ) self.stack.deploy(cfn_client=self.cfn_client) except (ClientError, WaiterError): diff --git a/src/deadline_test_fixtures/models.py b/src/deadline_test_fixtures/models.py index b103c3da..5229b941 100644 --- a/src/deadline_test_fixtures/models.py +++ b/src/deadline_test_fixtures/models.py @@ -10,7 +10,7 @@ from contextlib import contextmanager from dataclasses import dataclass from pathlib import Path -from typing import Generator +from typing import Generator, Literal @dataclass(frozen=True) @@ -34,6 +34,7 @@ class PosixSessionUser: @dataclass(frozen=True) class JobRunAsUser: posix: PosixSessionUser + runAs: Literal["QUEUE_CONFIGURED_USER", "WORKER_AGENT_USER"] @dataclass(frozen=True) diff --git a/test/unit/deadline/test_resources.py b/test/unit/deadline/test_resources.py index 958b523a..5c8ee1e7 100644 --- a/test/unit/deadline/test_resources.py +++ b/test/unit/deadline/test_resources.py @@ -98,7 +98,10 @@ def test_create(self, farm: Farm) -> None: job_attachments = JobAttachmentSettings(bucket_name="bucket", root_prefix="root") mock_client = MagicMock() mock_client.create_queue.return_value = {"queueId": queue_id} - job_run_as_user = JobRunAsUser(posix=PosixSessionUser(user="test-user", group="test-group")) + job_run_as_user = JobRunAsUser( + posix=PosixSessionUser(user="test-user", group="test-group"), + runAs="QUEUE_CONFIGURED_USER", + ) # WHEN result = Queue.create(