New repository quota on messages per ActionStatus (#531)
* New quotaexception for repository quota hit on DDI. Added actionstatus messages quota. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove special log handling on the quota exception. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Raise time for slow machines. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Update allure to get rid of log spam in unit tests. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Typos fixed. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -232,7 +232,7 @@ public class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest {
|
||||
final DistributionSet ds = testdataFactory.createDistributionSet("", true);
|
||||
|
||||
final DistributionSetAssignmentResult result = deploymentManagement.assignDistributionSet(ds.getId(),
|
||||
ActionType.TIMEFORCED, System.currentTimeMillis() + 1_000, Arrays.asList(target.getControllerId()));
|
||||
ActionType.TIMEFORCED, System.currentTimeMillis() + 2_000, Arrays.asList(target.getControllerId()));
|
||||
|
||||
final Action action = deploymentManagement
|
||||
.findActiveActionsByTarget(PAGE, result.getAssignedEntity().get(0).getControllerId()).getContent()
|
||||
@@ -255,7 +255,7 @@ public class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest {
|
||||
+ "/controller/v1/4712/deploymentBase/" + action.getId());
|
||||
|
||||
// After the time is over we should see a new etag
|
||||
TimeUnit.MILLISECONDS.sleep(1_000);
|
||||
TimeUnit.MILLISECONDS.sleep(2_000);
|
||||
|
||||
mvcResult = mvc.perform(get("/{tenant}/controller/v1/4712", tenantAware.getCurrentTenant()))
|
||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||
@@ -539,7 +539,7 @@ public class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest {
|
||||
@Test
|
||||
@Description("The server protects itself against to many feedback upload attempts. The test verfies that "
|
||||
+ "it is not possible to exceed the configured maximum number of feedback uplods.")
|
||||
public void toMuchDeplomentActionFeedback() throws Exception {
|
||||
public void tooMuchDeplomentActionFeedback() throws Exception {
|
||||
final Target target = testdataFactory.createTarget("4712");
|
||||
final DistributionSet ds = testdataFactory.createDistributionSet("");
|
||||
|
||||
@@ -562,6 +562,31 @@ public class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest {
|
||||
.andExpect(status().isForbidden());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("The server protects itself against too large feedback bodies. The test verifies that "
|
||||
+ "it is not possible to exceed the configured maximum number of feedback details.")
|
||||
public void tooMuchDeploymentActionMessagesInFeedback() throws Exception {
|
||||
final Target target = testdataFactory.createTarget("4712");
|
||||
final DistributionSet ds = testdataFactory.createDistributionSet("");
|
||||
|
||||
assignDistributionSet(ds.getId(), "4712");
|
||||
final Action action = deploymentManagement.findActionsByTarget(target.getControllerId(), PAGE).getContent()
|
||||
.get(0);
|
||||
|
||||
final List<String> messages = new ArrayList<>();
|
||||
for (int i = 0; i < 51; i++) {
|
||||
messages.add(String.valueOf(i));
|
||||
}
|
||||
|
||||
final String feedback = JsonBuilder.deploymentActionFeedback(action.getId().toString(), "proceeding", "none",
|
||||
messages);
|
||||
mvc.perform(post("/{tenant}/controller/v1/4712/deploymentBase/" + action.getId() + "/feedback",
|
||||
tenantAware.getCurrentTenant()).content(feedback).contentType(MediaType.APPLICATION_JSON)
|
||||
.accept(MediaType.APPLICATION_JSON))
|
||||
.andExpect(status().isForbidden());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Multiple uploads of deployment status feedback to the server.")
|
||||
public void multipleDeplomentActionFeedback() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user