Feature/speedup quota tests (#1125)

* reduce the number of created entities in tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* merged master

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* adapted target count

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed RolloutManagementTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed flaky test ConcurrentDistributionSetInvalidationTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>
This commit is contained in:
Ahmed Sayed
2022-02-21 12:58:05 +01:00
committed by GitHub
parent 44a85f20eb
commit 949cd8cd8b
17 changed files with 144 additions and 88 deletions

View File

@@ -33,6 +33,7 @@ import org.eclipse.hawkbit.repository.DistributionSetManagement;
import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
import org.eclipse.hawkbit.repository.DistributionSetTypeManagement;
import org.eclipse.hawkbit.repository.EntityFactory;
import org.eclipse.hawkbit.repository.QuotaManagement;
import org.eclipse.hawkbit.repository.RolloutManagement;
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement;
@@ -173,6 +174,9 @@ public class TestdataFactory {
@Autowired
private RolloutManagement rolloutManagement;
@Autowired
private QuotaManagement quotaManagement;
/**
* Creates {@link DistributionSet} in repository including three
* {@link SoftwareModule}s of types {@link #SM_TYPE_OS}, {@link #SM_TYPE_RT} ,
@@ -1180,8 +1184,10 @@ public class TestdataFactory {
* @return created {@link Rollout}
*/
public Rollout createRollout(final String prefix) {
createTargets(10, prefix);
return createRolloutByVariables(prefix, prefix + " description", 10, "controllerId==" + prefix + "*",
createTargets(quotaManagement.getMaxTargetsPerRolloutGroup() * quotaManagement.getMaxRolloutGroupsPerRollout(),
prefix);
return createRolloutByVariables(prefix, prefix + " description",
quotaManagement.getMaxRolloutGroupsPerRollout(), "controllerId==" + prefix + "*",
createDistributionSet(prefix), "50", "5");
}

View File

@@ -53,4 +53,22 @@ hawkbit.artifact.url.protocols.md5sum-http.supports=DDI
hawkbit.artifact.url.protocols.md5sum-http.ref=${hawkbit.artifact.url.protocols.download-http.ref}.MD5SUM
## Download URL Generation - END
# Quota - START
hawkbit.server.security.dos.maxStatusEntriesPerAction=10
hawkbit.server.security.dos.maxAttributeEntriesPerTarget=10
hawkbit.server.security.dos.maxMetaDataEntriesPerSoftwareModule=10
hawkbit.server.security.dos.maxRolloutGroupsPerRollout=5
hawkbit.server.security.dos.maxMessagesPerActionStatus=10
hawkbit.server.security.dos.maxMetaDataEntriesPerDistributionSet=10
hawkbit.server.security.dos.maxSoftwareModuleTypesPerDistributionSetType=5
hawkbit.server.security.dos.maxSoftwareModulesPerDistributionSet=5
hawkbit.server.security.dos.maxArtifactsPerSoftwareModule=3
hawkbit.server.security.dos.maxTargetsPerRolloutGroup=25
hawkbit.server.security.dos.maxArtifactSize=600000
hawkbit.server.security.dos.maxArtifactStorage=1000000
hawkbit.server.security.dos.maxTargetDistributionSetAssignmentsPerManualAssignment=20
hawkbit.server.security.dos.maxTargetsPerAutoAssignment=20
hawkbit.server.security.dos.maxActionsPerTarget=20
# Quota - END
# Properties that are managed by autoconfigure module at runtime and not available during test - END