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
Paas
is created that already exists.
Given that a specifiedPaas
already exists,
when someone configures a newPaas
with the same name,
then thePaas
related namespace must not be created
and the operator must return an error. -
A minimal
Paas
is created.
Given that thePaas
does not exist,
when someone configures the minimalPaas
then thePaas
namespace must be created
and the status of thePaas
contains no errors. -
A
Paas
is renamed.
Given that a specifiedPaas
exists,
when thePaas
is renamed in the configuration,
then the relatedPaas
namespace must be renamed as well. -
A
Paas
is deleted.
Given that a specifiedPaas
exists,
when thePaas
is deleted,
then the namespace belonging to thePaas
is also removed.
Post scenarios: reset environment to clean slate.
PaasNs¶
What we test: CRUD for PaasNs
Scenarios:
-
A
PaasNs
is created for aPaas
that does not exist.
Given that a specifiedPaas
does not exist,
when someone configures aPaasNs
to be created under specifiedPaas
,
then thePaasNs
related namespace must not be created
and the status of saidPaasNs
must contain the correct error. -
A minimal
Paas
that is referenced in thePaasNs
is created.
Given that thePaasNs
does not exist,
and that the minimalPaas
does not exist,
when someone configures the minimalPaas
and someone configures thePaasNs
referencing the minimalPaas
then thePaasNS
namespace must be created
and thePaasNS
namespace has thequota_label
label with the value of ... FIXME
and the status of thePaasNs
contains no errors. -
A
PaasNs
is renamed.
Given that a specifiedPaasNs
exists,
when thePaasNs
is renamed in the configuration,
then the relatedPaasNs
namespace must be renamed as well. -
A
PaasNs
is deleted.
Given that a specifiedPaasNs
exists,
when thePaasNs
is deleted,
then the namespace belonging to thePaasNs
is also removed.
Post scenarios: reset environment to clean slate.
Namespaces¶
-
A minimal
Paas
configuration without namespaces results in one namespace.
Given a minimalPaas
configuration 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 minimalPaas
without any namespaces exists,
when thePaas
is updated by adding 2 namespaces to the spec,
then one namespace with the same name as thePaas
must exist,
and twoPaasNs
's must exist in the namespace of thePaas
,
and thesePaasNs
's each have a namespace,
and thesePaasNs
namespaces must be named according to theirspec.namespaces
entries, prefixed by thePaas
namespace name -
Removing the namespaces from a
Paas
.
Given a minimalPaas
with two namespaces exists,
when thePaas
configuration is updated to remove the namespaces,
then thePaasNs
's should have be removed from thePaas
namespace,
and thePaas
namespace 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 minimalPaas
exists,
when someone adds a quota tospec.quota
for thePaas
configuration,
then a CRQ with the name of thePaas
must be created,
andclusterquotagroup=
followed by thePaas
name 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.quota
for aPaas
is updated.
Given a minimalPaas
exists,
and a valid CRQ exists for thisPaas
,
when someone updates thespec.quota
section for the specifiedPaas
configuration,
then the CRQ should be updated,
and the size of the updated CRQ equals the size as specified in thespec.quota
. -
Removing the
Paas
should remove the associated CRQ.
Given a minimalPaas
and its associated CRQ exist,
when thePaas
is removed,
then the associated CRW with the name of thePaas
should 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 minimalPaas
with a single namespace,
and a group with a single user without a specified role,
when thatPaas
is created,
then aGroup
was 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 there are were no changes to the Whitelist,
and the rolebinding on the namespace points to the group to the default role,
and the rolebinding was not applied to the defaultPaas
namespace (name of thePaas
) -
Updating the
Paas
, adding a group with a role other than default.
Given an existing, minimalPaas
with 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 aGroup
was 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 there are were no changes to the Whitelist,
and the rolebinding on the namespace points to the group to the default role,
and the rolebinding was not applied to the defaultPaas
namespace (name of thePaas
) -
Removing the
Paas
.
Given an existingPaas
with a single group,
when saidPaas
is removed,
Note
There are known issues on groups, updating / removing does not go perfectly. Goal here is to test the baseline in the current situation.
Determine what that baseline currently is.
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
Paas
with one namespace and aGroup
with aQuery
but noRole
.
Given no existingPaas
,
when a minimalPaas
is created with a single namespace,
and aGroup
with aQuery
, but without aRole
,
then aGroup
with the correct name should have been created,
and there should be no users in saidGroup
,
and the correct labels were added onto theGroup
,
and the Owner Reference for the Group points to the correct Paas,
and the query was added to the whitelist,
and the rolebinding on the namespace points to the group, to the specified role,
and the rolebinding was not applied to the defaultPaas
namespace (name of thePaas
). -
Updating the
Paas
, adding a group with a role other than default.
Given an existing, minimalPaas
with 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 aGroup
was created with the correct name,
and there are no users in said group,
and the correct labels were placed on the group, (no ldap things)
and the Owner Reference for the Group points to the correct Paas,
and there were changes made to the Whitelist,
and the rolebinding on the namespace points to the group to the specified role,
and the rolebinding was not applied to the defaultPaas
namespace (name of thePaas
) -
Removing the
Paas
.
Given an existingPaas
with a single group,
when saidPaas
is removed,
Note
There are known issues on groups, updating / removing does not go perfectly. Goal here is to test the baseline in the current situation.
Determine what that baseline currently is.
Post scenarios: reset environment to clean slate.
Note
TODO, there a known issue regarding groups. Good regression test to model the following steps:
1. Create Paas
with query;
2. Update Paas
from step 1, remove query and add users to the group;
3. Group is not removed from whitelist;
4. Sync fails because the required ldap.uid
doesn't match the groupname. (We don't fully test sync.)
Secrets¶
The capabilities are also used to test clusterwide quotas
Capability ArgoCD¶
What we test: creating a Paas
with the ArgoCD
capability enabled.
Scenarios:
- A minimal
Paas
with ArgoCD capability enabled.
Given a minimalPaas
andArgoCD
capability configuration,
when the minimalPaas
is created with theArgoCD
capability enabled,
then the list entry in the applicationset should have been created,
and a namespace with the namepaasname-argocd
should have been created,
and an ArgoCD Application should have been created in namespaces,
and a quota with the namepaasname-argocd
should have been created,
and the ArgoCD Application and quota conform to the points below.
ArgoCD Application points: 1. Assess gitUrl, path etc. exist in spec; 2. Assess RBAC .. determine how; 3. Assess Secrets exist in namespace and in argo...? 4. Assess Exclude appset is included in spec as ignoreDiff;
Quota points:
1. Assess a quota with the name `paasnaam-argocd` was created;
2. Assess that the `quota_label` label was used as selector on the quota;
3. Assess that the quota selector was set in such a manner so that only the `paasnaam-sso` namespace is selected;
4. Assess that the size of the quota equals the size of the default quota specified in the paas_config;
!!! Note TODO Assess default_permissions; 1. Rolebindings to service account etc. (TODO: can these RBs be created without the existence of a ServiceAccount?)
Post scenarios: reset environment to clean slate.
Capability Tekton¶
Check Quota
Capability Grafana¶
Check Quota
Capability SSO¶
What we test: creating a Paas
with the SSO
capability enabled.
Scenarios:
- A minimal
Paas
with SSO capability enabled and no capability quota.
Given a minimalPaas
andSSO
capability configuration,
when the minimalPaas
is created with theSSO
capability enabled,
then the list entry in the applicationset should have been created,
and a namespace with the namepaasname-sso
should have been created,
and a quota with the namepaasname-sso
should have been created,
and the quota conforms to the points below.
Quota points:
1. Assess that the quota_label
label was used as selector on the quota;
2. Assess that the quota selector was set in such a manner so that only the paasnaam-sso
namespace is selected;
3. Assess that the size of the quota equals the size of the default quota specified in the paas_config;
- The
Paas
from scenario 1 is removed.
Given a thePaas
remaining from scenario 1 above,
when saidPaas
is deleted,
then the associatedQuota
should have been removed,
then the associatedNamespace
should have been removed,
then the associated list entry in theApplicationSet
should have been removed.
Post scenarios: reset environment to clean slate.