E2E test cases for opr-paas¶
Below you will find a list of features that we want to test using end-to-end testing. For each feature, the setup and the assessments are listed.
Paas¶
What we test: CRUD for Paas
Scenarios:
-
A
Paasis created that already exists.
Given that a specifiedPaasalready exists,
when someone configures a newPaaswith the same name,
then thePaasrelated namespace must not be created
and the operator must return an error. -
A minimal
Paasis created.
Given that thePaasdoes not exist,
when someone configures the minimalPaas
then thePaasnamespace must be created
and the status of thePaascontains no errors. -
A
Paasis renamed.
Given that a specifiedPaasexists,
when thePaasis renamed in the configuration,
then the relatedPaasnamespace must be renamed as well. -
A
Paasis deleted.
Given that a specifiedPaasexists,
when thePaasis deleted,
then the namespace belonging to thePaasis also removed.
Post scenarios: reset environment to clean slate.
PaasNs¶
What we test: CRUD for PaasNs
Scenarios:
-
A
PaasNsis created for aPaasthat does not exist.
Given that a specifiedPaasdoes not exist,
when someone configures aPaasNsto be created under specifiedPaas,
then thePaasNsrelated namespace must not be created
and the status of saidPaasNsmust contain the correct error. -
A minimal
Paasthat is referenced in thePaasNsis created.
Given that thePaasNsdoes not exist,
and that the minimalPaasdoes not exist,
when someone configures the minimalPaas
and someone configures thePaasNsreferencing the minimalPaas
then thePaasNSnamespace must be created
and thePaasNSnamespace has thequota_labellabel with the value of ... FIXME
and the status of thePaasNscontains no errors. -
A
PaasNsis renamed.
Given that a specifiedPaasNsexists,
when thePaasNsis renamed in the configuration,
then the relatedPaasNsnamespace must be renamed as well. -
A
PaasNsis deleted.
Given that a specifiedPaasNsexists,
when thePaasNsis deleted,
then the namespace belonging to thePaasNsis also removed.
Post scenarios: reset environment to clean slate.
Namespaces¶
-
A minimal
Paasconfiguration without namespaces results in one namespace.
Given a minimalPaasconfiguration without namespaces,
when someone adds said configuration to the system,
then a single namespace should have been created,
and this namespace should be named the same as thePaas,
and noPaasNs's or there namespaces are linked to thPaas. -
Adding two namespaces to the
Paas's spec.
Given a minimalPaaswithout any namespaces exists,
when thePaasis updated by adding 2 namespaces to the spec,
then one namespace with the same name as thePaasmust exist,
and twoPaasNs's must exist in the namespace of thePaas,
and thesePaasNs's each have a namespace,
and thesePaasNsnamespaces must be named according to theirspec.namespacesentries, prefixed by thePaasnamespace name -
Removing the namespaces from a
Paas.
Given a minimalPaaswith two namespaces exists,
when thePaasconfiguration is updated to remove the namespaces,
then thePaasNs's should have be removed from thePaasnamespace,
and thePaasnamespace was removed.
Post scenarios: reset environment to clean slate.
ClusterResourceQuotas¶
What we test: CRQ CRUD
Note
The spec.quota does not fall under not cluster wide quotas, hence a separate
set of test scenarios.
-
Ensure the correct CRQ is created for a
Paas.
Given a minimalPaasexists,
when someone adds a quota tospec.quotafor thePaasconfiguration,
then a CRQ with the name of thePaasmust be created,
andclusterquotagroup=followed by thePaasname should have been applied as label selector on the CRQ,
and the size of the created CRQ equals the size as specified in thespec.quota. -
The
spec.quotafor aPaasis updated.
Given a minimalPaasexists,
and a valid CRQ exists for thisPaas,
when someone updates thespec.quotasection for the specifiedPaasconfiguration,
then the CRQ should be updated,
and the size of the updated CRQ equals the size as specified in thespec.quota. -
Removing the
Paasshould remove the associated CRQ.
Given a minimalPaasand its associated CRQ exist,
when thePaasis removed,
then the associated CRW with the name of thePaasshould have removed as well.
Post scenarios: reset environment to clean slate.
Cluster wide quotas¶
What we test: cluster wide quota CRUD
Scenarios:
TODO
Post scenarios: reset environment to clean slate.
Groups => Users¶
What we test: managing users and group memberships through Paas configuration.
Scenarios:
-
Creating a group with a single user without a specified role.
Given a minimalPaaswith a single namespace,
and a group with a single user without a specified role,
when thatPaasis created,
then aGroupwas created with the correct name,
and the user is a member of said group,
and the correct labels were placed on the group,
and the Owner Reference for the Group points to the correct Paas,
and the rolebinding on the namespace points to the group to the default role, -
Updating the
Paas, adding a group with a role other than default.
Given an existing, minimalPaaswith a single namespace,
when a group is added to saidPaas,
and said group has a specific role, other than default (see test_config),
and a different user is a member of said group than in scenario 1,
then aGroupwas created with the correct name,
and the user is a member of said group,
and the correct labels were placed on the group,
and the Owner Reference for the Group points to the correct Paas,
and the rolebinding on the namespace points to the group to the default role, -
Removing the
Paas.
Given an existingPaaswith a single group,
when saidPaasis removed,
Post scenarios: reset environment to clean slate.
Groups => Query¶
What we test: managing users and group memberships through an LDAP query specified
in the Paas configuration.
Scenarios:
- Minimal
Paaswith one namespace and aGroupwith aQuerybut noRole.
Given no existingPaas,
when a minimalPaasis created with a single namespace,
and aGroupwith aQuery, but without aRole,
then theGroupshould not have been created,
and there should be no users in saidGroup,
and the correct labels were added onto theGroup,
and the rolebinding on the namespace points to the group, to the specified role, -
Updating the
Paas, adding a group with a role other than default.
Given an existing, minimalPaaswith a single namespace,
when another query is added to saidPaas(compared to step scenario 1),
and said group has a specific role, other than default (see test_config),
then theGroupshould not have been created,
and there are no users in said group,
and the correct labels were placed on the group, (no ldap things)
and the rolebinding on the namespace points to the group to the specified role, -
Removing the
Paas.
Given an existingPaaswith a single group,
when saidPaasis removed,
Post scenarios: reset environment to clean slate.
Secrets¶
The capabilities are also used to test clusterwide quotas
Capability ArgoCD¶
What we test: creating a Paas with a capability named: argocd enabled.
Scenarios:
-
A minimal
Paaswith a capability named:argocdenabled.
Given a minimalPaasandargocdcapability configuration,
when the minimalPaasis created with theargocdcapability enabled,
then the list entry in the applicationset should have been created,
and a namespace with the namepaasname-argocdshould have been created,
and a quota with the namepaasname-argocdshould have been created,
and quota conform to the points below.Quota points:
- Assess a quota with the name
paasnaam-argocdwas created; - Assess that the
quota_labellabel was used as selector on the quota; - Assess that the quota selector was set in such a manner so that only the
paasnaam-argocdnamespace is selected; - Assess that the size of the quota equals the size of the default quota specified in the paas_config;
Default_permissions points:
- Assess that a rolebinding for
monitoring-editis created - Assess that the
monitoring-editrolebinding contains theargo-service-applicationset-controllerservice account - Assess that the
monitoring-editrolebinding contains theargo-service-argocd-application-controllerservice account
- Assess a quota with the name
Post scenarios: reset environment to clean slate.
Capability Tekton¶
Quota points:
- Assess a quota with the name
paasnaam-tektonwas created; - Assess that the
quota_labellabel was used as selector on the quota; - Assess that the quota selector was set in such a manner so that only the
paasnaam-tektonnamespace is selected; - Assess that the size of the quota equals the size of the default quota specified in the paas_config;
Default_permissions points:
- Assess that a rolebinding for
monitoring-editis created - Assess that the
monitoring-editrolebinding contains thetektonservice account - Assess that a rolebinding for
alert-routing-editis created - Assess that the
alert-routing-editrolebinding contains thetektonservice account
Capability SSO¶
What we test: creating a Paas with a capability named: sso enabled.
Scenarios:
- A minimal
Paaswith a capability namedssoenabled without a capability quota.
Given a minimalPaasandssocapability configuration,
when the minimalPaasis created with thessocapability enabled,
then the list entry in the applicationset should have been created,
and a namespace with the namepaasname-ssoshould have been created,
and a quota with the namepaasname-ssoshould have been created,
and the quota conforms to the points below.
Quota points:
- Assess that the
quota_labellabel was used as selector on the quota; - Assess that the quota selector was set in such a manner so that only the
paasnaam-ssonamespace is selected; -
Assess that the size of the quota equals the size of the default quota specified in the paas_config;
-
The
Paasfrom scenario 1 is removed.
Given a thePaasremaining from scenario 1 above,
when saidPaasis deleted,
then the associatedQuotashould have been removed,
then the associatedNamespaceshould have been removed,
then the associated list entry in theApplicationSetshould have been removed.
Post scenarios: reset environment to clean slate.
Configurable capabilities¶
What we test: adding a new capability with configuration
Scenarios:
- Add cap5 in a Paas and check that it does not work when not yet defined in config