[Tests-Only] Do not overwrite user information when testing duplicate user creation #37917
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.
Description
Some test scenarios purposely try to create a user twice, to check that the 2nd user create request fails. They do this with different case of
userid
(username), because you should not be able to create bothbrand-new-user
andBRAND-NEW-USER
The test code remembers the users that have been created, so it can delete those users in the
afterScenario
cleanup of the test. But some test steps are remembering "again" the 2nd version of theuserid
and overwriting the first value. That means that, for example, the actual user on the system-under-test isbrand-new-user
but theafterScenario
tries to deleteBRAND-NEW-USER
. Actually that will work fine on a system-under-test that has a "correct" Provisioning API "delete" method. But on a system-under-test that is in development, a small problem in the Provisioning API can cause "bonus" test failures that impact on later scenarios.In
afterScenario
we should try as best we can to use the "lowest-risk" API calls to do the cleanup actions that reset the system back to a known state.In this PR the code is more careful that if the user create was not successful then to not overwrite any memory it already has about the existence of that user. That will ensure that deleting users in the
afterScenario
is done using the exact sameuserid
that was used to create the user.This should help with owncloud/ocis#587 - preventing the "duplicate user creation" tests from messing up later test scenarios.
How Has This Been Tested?
CI
Types of changes
Checklist: