diff --git a/test/e2e/no_user_identity_test.go b/test/e2e/no_user_identity_test.go index 4d8145dc4..c78881986 100644 --- a/test/e2e/no_user_identity_test.go +++ b/test/e2e/no_user_identity_test.go @@ -66,7 +66,7 @@ func TestCreationOfUserAndIdentityIsSkipped(t *testing.T) { Execute(t) signup := u.UserSignup - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "appstudio") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, signup, "deactivate30", "appstudio") // preexisting user & identity are still there and not modified // Verify provisioned User diff --git a/test/e2e/parallel/e2e_test.go b/test/e2e/parallel/e2e_test.go index bb981b827..aa5a707c8 100644 --- a/test/e2e/parallel/e2e_test.go +++ b/test/e2e/parallel/e2e_test.go @@ -116,10 +116,10 @@ func TestE2EFlow(t *testing.T) { // Confirm the originalSub property has been set during signup require.Equal(t, originalSubJohnClaim, originalSubJohnSignup.Spec.IdentityClaims.OriginalSub) - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") - VerifyResourcesProvisionedForSignup(t, awaitilities, targetedJohnSignup, "deactivate30", "base1ns") - VerifyResourcesProvisionedForSignup(t, awaitilities, originalSubJohnSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) + VerifyResourcesProvisionedForSignup(t, awaitilities, targetedJohnSignup) + VerifyResourcesProvisionedForSignup(t, awaitilities, originalSubJohnSignup) t.Run("try to break UserAccount", func(t *testing.T) { t.Run("delete user and wait until recreated", func(t *testing.T) { @@ -133,8 +133,8 @@ func TestE2EFlow(t *testing.T) { // then require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("delete identity and wait until recreated", func(t *testing.T) { @@ -149,8 +149,8 @@ func TestE2EFlow(t *testing.T) { // then require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("delete user mapping and wait until recreated", func(t *testing.T) { @@ -165,8 +165,8 @@ func TestE2EFlow(t *testing.T) { // then require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("delete identity mapping and wait until recreated", func(t *testing.T) { @@ -182,8 +182,8 @@ func TestE2EFlow(t *testing.T) { // then require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("delete namespaces and wait until recreated", func(t *testing.T) { @@ -207,8 +207,8 @@ func TestE2EFlow(t *testing.T) { _, err := memberAwait.WaitForNamespace(t, johnSignup.Spec.IdentityClaims.PreferredUsername, ref, "base", wait.UntilNamespaceIsActive()) require.NoError(t, err) } - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("delete useraccount and expect recreation", func(t *testing.T) { @@ -230,7 +230,7 @@ func TestE2EFlow(t *testing.T) { require.NoError(t, err) // then verify the recreated user account - VerifyResourcesProvisionedForSignup(t, awaitilities, johnSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, johnSignup, "deactivate30", "base") }) }) @@ -257,7 +257,7 @@ func TestE2EFlow(t *testing.T) { require.Equal(t, "laracroft", laraSignup.Status.CompliantUsername) - VerifyResourcesProvisionedForSignup(t, awaitilities, laraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, laraSignup) VerifySpaceBinding(t, hostAwait, laraUserName, laraUserName, "admin") @@ -361,50 +361,50 @@ func TestE2EFlow(t *testing.T) { t.Run("namespace role accidentally deleted by user in dev namespace is recreated", func(t *testing.T) { DeletedRoleAndAwaitRecreation(t, memberAwait, devNs, "exec-pods") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("namespace rolebinding accidentally deleted by user in dev namespace is recreated", func(t *testing.T) { DeleteRoleBindingAndAwaitRecreation(t, memberAwait, devNs, "crtadmin-pods") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("namespace role accidentally deleted by user in stage namespace is recreated", func(t *testing.T) { DeletedRoleAndAwaitRecreation(t, memberAwait, stageNs, "exec-pods") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("namespace rolebinding accidentally deleted by user in stage namespace is recreated", func(t *testing.T) { DeleteRoleBindingAndAwaitRecreation(t, memberAwait, stageNs, "crtadmin-pods") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) // roles and role bindings defined in the spacerole templates t.Run("space role accidentally deleted by user in dev namespace is recreated", func(t *testing.T) { DeletedRoleAndAwaitRecreation(t, memberAwait, devNs, "rbac-edit") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("space rolebinding accidentally deleted by user in dev namespace is recreated", func(t *testing.T) { DeleteRoleBindingAndAwaitRecreation(t, memberAwait, devNs, "wonderwoman-rbac-edit") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("space role accidentally deleted by user in stage namespace is recreated", func(t *testing.T) { DeletedRoleAndAwaitRecreation(t, memberAwait, stageNs, "rbac-edit") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) t.Run("space rolebinding accidentally deleted by user in stage namespace is recreated", func(t *testing.T) { DeleteRoleBindingAndAwaitRecreation(t, memberAwait, stageNs, "wonderwoman-rbac-edit") // then the user account should be recreated - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, userSignup, "deactivate30", "base") }) }) @@ -448,7 +448,7 @@ func TestE2EFlow(t *testing.T) { require.NoError(t, err, "johnsmith-stage namespace is not deleted") // also, verify that other user's resource are left intact - VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, johnExtraSignup) }) t.Run("deactivate UserSignup and ensure that all user and identity resources are deleted", func(t *testing.T) { diff --git a/test/e2e/parallel/nstemplatetier_test.go b/test/e2e/parallel/nstemplatetier_test.go index 13b33d37f..3ea2d8b0b 100644 --- a/test/e2e/parallel/nstemplatetier_test.go +++ b/test/e2e/parallel/nstemplatetier_test.go @@ -67,7 +67,7 @@ func TestNSTemplateTiers(t *testing.T) { } // wait for the user to be provisioned for the first time - VerifyResourcesProvisionedForSignup(t, awaitilities, testingtiers, "deactivate30", "base1ns") // deactivate30 is the default UserTier and base is the default SpaceTier + VerifyResourcesProvisionedForSignup(t, awaitilities, testingtiers) // deactivate30 is the default UserTier and base is the default SpaceTier for _, tierToCheck := range tiersToCheck { // check that the tier exists, and all its namespace other cluster-scoped resource revisions @@ -81,7 +81,7 @@ func TestNSTemplateTiers(t *testing.T) { tiers.MoveSpaceToTier(t, hostAwait, space.Name, tierToCheck) // then - VerifyResourcesProvisionedForSignup(t, awaitilities, testingtiers, "deactivate30", tierToCheck) // deactivate30 is the default UserTier + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, testingtiers, "deactivate30", tierToCheck) // deactivate30 is the default UserTier }) } } @@ -182,7 +182,7 @@ func TestResetDeactivatingStateWhenPromotingUser(t *testing.T) { promotedUserSignup, err := hostAwait.WaitForUserSignup(t, updatedUserSignup.Name) require.NoError(t, err) require.False(t, states.Deactivating(promotedUserSignup), "usersignup should not be deactivating") - VerifyResourcesProvisionedForSignup(t, awaitilities, promotedUserSignup, "deactivate90", "base1ns") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, promotedUserSignup, "deactivate90", "base1ns") }) } @@ -225,7 +225,7 @@ func setupAccounts(t *testing.T, awaitilities wait.Awaitilities, tier *tiers.Cus // let's promote to users the new tier for i := range userSignups { - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignups[i], "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, userSignups[i]) username := fmt.Sprintf(nameFmt, i) tiers.MoveSpaceToTier(t, hostAwait, username, tier.Name) } diff --git a/test/e2e/parallel/proxy_test.go b/test/e2e/parallel/proxy_test.go index fb113d405..6bf01868d 100644 --- a/test/e2e/parallel/proxy_test.go +++ b/test/e2e/parallel/proxy_test.go @@ -1060,7 +1060,7 @@ func createAppStudioUser(t *testing.T, awaitilities wait.Awaitilities, user *pro user.signup = u.UserSignup user.token = u.Token tiers.MoveSpaceToTier(t, awaitilities.Host(), u.Space.Name, "appstudio") - VerifyResourcesProvisionedForSignup(t, awaitilities, user.signup, "deactivate30", "appstudio") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, user.signup, "deactivate30", "appstudio") user.compliantUsername = user.signup.Status.CompliantUsername _, err := awaitilities.Host().WaitForMasterUserRecord(t, user.compliantUsername, wait.UntilMasterUserRecordHasCondition(wait.Provisioned())) require.NoError(t, err) diff --git a/test/e2e/parallel/registration_service_test.go b/test/e2e/parallel/registration_service_test.go index 5ed0fd2ef..77bd368c0 100644 --- a/test/e2e/parallel/registration_service_test.go +++ b/test/e2e/parallel/registration_service_test.go @@ -422,7 +422,7 @@ func TestSignupOK(t *testing.T) { require.NoError(t, err) // Wait for the resources to be provisioned - VerifyResourcesProvisionedForSignup(t, await, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, await, userSignup) // Call signup endpoint with same valid token to check if status changed to Provisioned now now := time.Now() diff --git a/test/e2e/parallel/usersignup_test.go b/test/e2e/parallel/usersignup_test.go index 7c2eb09c7..074373bf1 100644 --- a/test/e2e/parallel/usersignup_test.go +++ b/test/e2e/parallel/usersignup_test.go @@ -87,8 +87,8 @@ func TestTransformUsernameWithSpaceConflict(t *testing.T) { // then userSignup, _ = VerifyUserRelatedResources(t, awaitilities, userSignup, "deactivate30", ExpectAnyUserAccount()) - VerifySpaceRelatedResources(t, awaitilities, userSignup, "base") - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base") + VerifySpaceRelatedResources(t, awaitilities, userSignup, "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup) require.Equal(t, fmt.Sprintf("%s-3", conflictingSpace.Name), userSignup.Status.CompliantUsername) }) } diff --git a/test/e2e/user_management_test.go b/test/e2e/user_management_test.go index ca19c7090..1cf803deb 100644 --- a/test/e2e/user_management_test.go +++ b/test/e2e/user_management_test.go @@ -334,7 +334,7 @@ func (s *userManagementTestSuite) TestUserDeactivation() { require.NoError(t, err) // Verify resources still exist - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignupMember1, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignupMember1) }) s.T().Run("test full automatic user deactivation lifecycle", func(t *testing.T) { @@ -400,7 +400,7 @@ func (s *userManagementTestSuite) TestUserDeactivation() { require.Less(t, comparison, time.Hour) // Verify resources have been provisioned - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) t.Run("user set to deactivated after deactivating", func(t *testing.T) { // Set the provisioned time even further back @@ -710,7 +710,7 @@ func (s *userManagementTestSuite) TestUserDisabled() { Execute(s.T()) userSignup := u.UserSignup - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) // Disable MUR mur, err := hostAwait.UpdateMasterUserRecordSpec(s.T(), @@ -752,7 +752,7 @@ func (s *userManagementTestSuite) TestUserDisabled() { }) require.NoError(s.T(), err) - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) }) } diff --git a/test/e2e/usersignup_test.go b/test/e2e/usersignup_test.go index 69b60b3c2..eba3abe89 100644 --- a/test/e2e/usersignup_test.go +++ b/test/e2e/usersignup_test.go @@ -138,7 +138,7 @@ func (s *userSignupIntegrationTest) TestAutomaticApproval() { wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) s.userIsNotProvisioned(t, waitingList2) t.Run("reset the max number of spaces and expect the second user will be provisioned as well", func(t *testing.T) { @@ -153,7 +153,7 @@ func (s *userSignupIntegrationTest) TestAutomaticApproval() { wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) }) }) }) @@ -186,7 +186,7 @@ func (s *userSignupIntegrationTest) TestAutomaticApproval() { wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedAutomatically())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) }) }) @@ -218,7 +218,7 @@ func (s *userSignupIntegrationTest) TestAutomaticApproval() { wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedAutomatically())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) }) t.Run("add user with bad email format and expect the user will not be approved nor provisioned", func(t *testing.T) { @@ -297,7 +297,7 @@ func (s *userSignupIntegrationTest) TestUserIDAndAccountIDClaimsPropagated() { Execute(s.T()) // then - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup) } func (s *userSignupIntegrationTest) TestGetSignupEndpointUpdatesIdentityClaims() { @@ -321,7 +321,7 @@ func (s *userSignupIntegrationTest) TestGetSignupEndpointUpdatesIdentityClaims() userSignup := user.UserSignup // then - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) // Create a token and identity to invoke the GetSignup endpoint with userIdentity := &commonauth.Identity{ @@ -376,7 +376,7 @@ func (s *userSignupIntegrationTest) TestUserResourcesCreatedWhenOriginalSubIsSet Execute(s.T()) // then - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup) } func (s *userSignupIntegrationTest) TestUserResourcesUpdatedWhenPropagatedClaimsModified() { @@ -402,7 +402,7 @@ func (s *userSignupIntegrationTest) TestUserResourcesUpdatedWhenPropagatedClaims userSignup := user.UserSignup // then - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) // Update the UserSignup userSignup, err := hostAwait.UpdateUserSignup(s.T(), userSignup.Name, func(us *toolchainv1alpha1.UserSignup) { @@ -415,7 +415,7 @@ func (s *userSignupIntegrationTest) TestUserResourcesUpdatedWhenPropagatedClaims require.Equal(s.T(), "nnnbbb111234", userSignup.Spec.IdentityClaims.AccountID) // Verify that the resources are updated with the propagated claim - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) } // TestUserResourcesCreatedWhenOriginalSubIsSetAndUserIDSameAsSub tests the case where: @@ -447,7 +447,7 @@ func (s *userSignupIntegrationTest) TestUserResourcesCreatedWhenOriginalSubIsSet Execute(s.T()) // then - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, user.UserSignup) } func (s *userSignupIntegrationTest) userIsNotProvisioned(t *testing.T, userSignup *toolchainv1alpha1.UserSignup) { @@ -546,7 +546,7 @@ func (s *userSignupIntegrationTest) TestCapacityManagementWithManualApproval() { wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedByAdmin())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) }) }) @@ -579,7 +579,7 @@ func (s *userSignupIntegrationTest) TestCapacityManagementWithManualApproval() { wait.UntilUserSignupHasConditions(wait.ConditionSet(wait.Default(), wait.ApprovedByAdmin())...), wait.UntilUserSignupHasStateLabel(toolchainv1alpha1.UserSignupStateLabelValueApproved)) require.NoError(t, err) - VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, s.Awaitilities, userSignup) }) }) @@ -633,7 +633,7 @@ func (s *userSignupIntegrationTest) TestTargetClusterSelectedAutomatically() { require.NoError(s.T(), err) // Confirm the MUR was created and target cluster was set - VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup) } func (s *userSignupIntegrationTest) createUserSignupVerificationRequiredAndAssertNotProvisioned() *toolchainv1alpha1.UserSignup { diff --git a/test/migration/verify/verify_migration_test.go b/test/migration/verify/verify_migration_test.go index 5ff87c195..941624e80 100644 --- a/test/migration/verify/verify_migration_test.go +++ b/test/migration/verify/verify_migration_test.go @@ -160,20 +160,20 @@ func verifyProvisionedSubSpace(t *testing.T, awaitilities wait.Awaitilities) { func verifyProvisionedSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup) { cleanup.AddCleanTasks(t, awaitilities.Host().Client, signup) - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, signup) DeactivateAndCheckUser(t, awaitilities, signup) ReactivateAndCheckUser(t, awaitilities, signup) } func verifySecondMemberProvisionedSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup) { cleanup.AddCleanTasks(t, awaitilities.Host().Client, signup) - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, signup) CreateBannedUser(t, awaitilities.Host(), signup.Spec.IdentityClaims.Email) } func verifyAppStudioProvisionedSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup) { cleanup.AddCleanTasks(t, awaitilities.Host().Client, signup) - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "appstudio") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, signup, "deactivate30", "appstudio") } func verifyDeactivatedSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup) { @@ -224,7 +224,7 @@ func verifyBannedSignup(t *testing.T, awaitilities wait.Awaitilities, signup *to require.NoError(t, err) // verify that it's unbanned - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, signup) } func checkMURMigratedAndGetSignup(t *testing.T, hostAwait *wait.HostAwaitility, murName string) *toolchainv1alpha1.UserSignup { diff --git a/testsupport/deactivation.go b/testsupport/deactivation.go index c64fc05cc..591c201c7 100644 --- a/testsupport/deactivation.go +++ b/testsupport/deactivation.go @@ -75,7 +75,7 @@ func ReactivateAndCheckUser(t *testing.T, awaitilities wait.Awaitilities, userSi require.NoError(t, err) require.False(t, states.Deactivated(userSignup), "usersignup should not be deactivated") - VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, userSignup) return userSignup } diff --git a/testsupport/user_assertions.go b/testsupport/user_assertions.go index a02eaf97f..0833381fe 100644 --- a/testsupport/user_assertions.go +++ b/testsupport/user_assertions.go @@ -6,6 +6,7 @@ import ( "testing" "time" + "github.com/codeready-toolchain/toolchain-common/pkg/configuration" testsupportsb "github.com/codeready-toolchain/toolchain-e2e/testsupport/spacebinding" corev1 "k8s.io/api/core/v1" @@ -20,11 +21,18 @@ import ( func VerifyMultipleSignups(t *testing.T, awaitilities wait.Awaitilities, signups []*toolchainv1alpha1.UserSignup) { for _, signup := range signups { - VerifyResourcesProvisionedForSignup(t, awaitilities, signup, "deactivate30", "base1ns") + VerifyResourcesProvisionedForSignup(t, awaitilities, signup) } } -func VerifyResourcesProvisionedForSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup, userTierName, spaceTierName string) { +func VerifyResourcesProvisionedForSignup(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup) { + toolchainConfig := awaitilities.Host().GetToolchainConfig(t) + spaceTier := configuration.GetString(toolchainConfig.Spec.Host.Tiers.DefaultSpaceTier, "base") + userTier := configuration.GetString(toolchainConfig.Spec.Host.Tiers.DefaultUserTier, "deactivate30") + VerifyResourcesProvisionedForSignupWithTiers(t, awaitilities, signup, userTier, spaceTier) +} + +func VerifyResourcesProvisionedForSignupWithTiers(t *testing.T, awaitilities wait.Awaitilities, signup *toolchainv1alpha1.UserSignup, userTierName, spaceTierName string) { space := VerifySpaceRelatedResources(t, awaitilities, signup, spaceTierName) spaceMember := GetSpaceTargetMember(t, awaitilities, space) VerifyUserRelatedResources(t, awaitilities, signup, userTierName, ExpectUserAccountIn(spaceMember))