feat: linux ec2-based tests test installer-based user creation #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the problem/requirement? (What/Why)
The linux ec2-based tests are currently structured to create the worker-agent user during instance startup using ec2-userdata scripting. The worker agent installer contains code that will create the agent-user if it does not exist. The current test setup prevents writing tests that test that functionality
What was the solution? (How)
Refactor the scripting that is materialized in the PosixInstanceWorker. Now, user-creation-wise the ec2-userdata only creates the job users and their groups. The 'worker configuration' scripting is now responsible for letting the install script create the worker agent user, and adding it to the required groups & sudoers rules.
What is the impact of this change?
Increased confidence that the deadline cloud worker agent's installer script on Linux correctly creates the agent-user if it needs to.
How was this change tested?
requirements-testing.txt
to point at my built whl file for the test-fixtures. (deadline-cloud-test-fixtures @ file:///home/<user>/deadline-cloud-test-fixtures/dist/deadline_cloud_test_fixtures-0.0.post98+g6d4023d.d20240813-py3-none-any.whl
)WORKER_AGENT_WHL_PATH
env var to point to my locally built agent whl file.I then checked command history in Systems Manager to ensure that the expected RunCommands were run (as a verification that my test fixtures changes were being tested).
All Linux tests pass:
Was this change documented?
There is no documentation to update.
Is this a breaking change?
It should not be.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.