From bc0e4002a93036ebbf08ad9981ffdb8f19ff1611 Mon Sep 17 00:00:00 2001 From: pkazlenka Date: Tue, 16 Jan 2024 13:18:46 +0100 Subject: [PATCH 1/4] 5521: [TEST] Update History validation test * Updated test that history response when time 'from' < time 'to' --- ...validRequestParametersExpectedError.groovy | 14 ++++++++++++++ .../spec/flows/FlowHistorySpec.groovy | 19 ++++++++++++++----- .../spec/flows/FlowLoopSpec.groovy | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 src-java/testing/functional-tests/src/main/groovy/org/openkilda/functionaltests/error/InvalidRequestParametersExpectedError.groovy diff --git a/src-java/testing/functional-tests/src/main/groovy/org/openkilda/functionaltests/error/InvalidRequestParametersExpectedError.groovy b/src-java/testing/functional-tests/src/main/groovy/org/openkilda/functionaltests/error/InvalidRequestParametersExpectedError.groovy new file mode 100644 index 00000000000..1c778da2e1c --- /dev/null +++ b/src-java/testing/functional-tests/src/main/groovy/org/openkilda/functionaltests/error/InvalidRequestParametersExpectedError.groovy @@ -0,0 +1,14 @@ +package org.openkilda.functionaltests.error + + +import org.springframework.http.HttpStatus + +import java.util.regex.Pattern + +class InvalidRequestParametersExpectedError extends AbstractExpectedError{ + final static HttpStatus statusCode = HttpStatus.BAD_REQUEST + + InvalidRequestParametersExpectedError(String message, Pattern descriptionPattern) { + super(statusCode, message, descriptionPattern) + } +} diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowHistorySpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowHistorySpec.groovy index 539593dd319..ad979b9e583 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowHistorySpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowHistorySpec.groovy @@ -1,5 +1,7 @@ package org.openkilda.functionaltests.spec.flows +import org.openkilda.functionaltests.error.InvalidRequestParametersExpectedError + import static org.openkilda.functionaltests.helpers.FlowHistoryConstants.PARTIAL_UPDATE_ACTION import static org.openkilda.functionaltests.helpers.FlowHistoryConstants.PARTIAL_UPDATE_ONLY_IN_DB import static org.openkilda.testing.Constants.FLOW_CRUD_TIMEOUT @@ -325,11 +327,6 @@ class FlowHistorySpec extends HealthCheckSpecification { params: [flowWithHistory, null, bigHistory[-2].timestamp, null], expectedHistory: bigHistory[0..-2] //101 ], - [ - descr: "timeBefore > timeAfter returns empty results", - params: [flowWithHistory, bigHistory[2].timestamp, bigHistory[0].timestamp], - expectedHistory: [] - ], [ descr: "Calling history for never existed flow returns empty results", params: [NON_EXISTENT_FLOW_ID], @@ -338,6 +335,18 @@ class FlowHistorySpec extends HealthCheckSpecification { ] } + @Tags(LOW_PRIORITY) + def "Check history: timeBefore > timeAfter returns error"() { + when: "Request history with timeBefore > timeAfter returns error" + northbound.getFlowHistory(flowWithHistory, bigHistory[2].timestamp, bigHistory[0].timestamp) + + then: "Error is returned" + def exc = thrown(HttpClientErrorException) + new InvalidRequestParametersExpectedError( + "Invalid 'timeFrom' and 'timeTo' arguments: ${bigHistory[2].timestamp} and ${bigHistory[0].timestamp + 1}", + ~/'timeFrom' must be less than or equal to 'timeTo'/).matches(exc) + } + @Tags([LOW_PRIORITY]) def "Root cause is registered in flow history while rerouting"() { given: "An active flow" diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowLoopSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowLoopSpec.groovy index e7732490ace..052fd7bf417 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowLoopSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowLoopSpec.groovy @@ -683,6 +683,7 @@ class FlowLoopSpec extends HealthCheckSpecification { then: "Human readable error is returned" //system can't update the flow when it is down def exc = thrown(HttpClientErrorException) new FlowNotUpdatedExpectedError(~/Source switch $switchPair.src.dpId is not connected to the controller/).matches(exc) + then: "FlowLoop is not created" !northbound.getFlow(flow.flowId).loopSwitchId From 4caa09a5e1926f1b6f9812fc0f6c799ddc8daad8 Mon Sep 17 00:00:00 2001 From: pkazlenka Date: Thu, 18 Jan 2024 13:25:47 +0100 Subject: [PATCH 2/4] Avoid non-existing directory warnings on WFM container creation * Fixed 'No such file or directory' warning during WFM container start * Replaced duplicate pip calls in Dockerfiles --- docker/base/kilda-base-lab-service/Dockerfile | 4 +--- docker/wfm/app/deploy_all_topologies.sh | 2 +- docker/wfm/app/deploy_single_topology.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/base/kilda-base-lab-service/Dockerfile b/docker/base/kilda-base-lab-service/Dockerfile index 7b27fb9a577..0e61cfcdff5 100644 --- a/docker/base/kilda-base-lab-service/Dockerfile +++ b/docker/base/kilda-base-lab-service/Dockerfile @@ -38,9 +38,7 @@ RUN apt update \ gcc \ build-essential \ automake \ - && pip3 install setuptools==45.2.0 \ - && pip3 install wheel==0.34.2 \ - && pip3 install tox==3.14.4 \ + && pip3 install setuptools==45.2.0 wheel==0.34.2 tox==3.14.4\ && cd /root \ && wget https://github.com/kilda/ovs/archive/refs/tags/${OVS_VERSION}.tar.gz \ && tar -xvf ${OVS_VERSION}.tar.gz \ diff --git a/docker/wfm/app/deploy_all_topologies.sh b/docker/wfm/app/deploy_all_topologies.sh index 30b339707bc..d2c1d3d64f9 100755 --- a/docker/wfm/app/deploy_all_topologies.sh +++ b/docker/wfm/app/deploy_all_topologies.sh @@ -30,7 +30,7 @@ for TOPOLOGY in $(find . -name "*-topology" -type d); do TOPOLOGY_JAR=$(ls -1 /app/${TOPOLOGY_NAME}-storm-topology/libs/ | grep -v "\-original" | head -1) COMMA_SEPARATED_DEPENDENCY_LIST="" - for DEPENDENCY_JAR in $(ls -1 ${TOPOLOGY}/dependency-jars); + for DEPENDENCY_JAR in $([[ -d ${TOPOLOGY}/dependency-jars ]] && ls -1 ${TOPOLOGY}/dependency-jars); do COMMA_SEPARATED_DEPENDENCY_LIST="${COMMA_SEPARATED_DEPENDENCY_LIST:+$COMMA_SEPARATED_DEPENDENCY_LIST,}/app/${TOPOLOGY_NAME}-storm-topology/dependency-jars/${DEPENDENCY_JAR}" done diff --git a/docker/wfm/app/deploy_single_topology.sh b/docker/wfm/app/deploy_single_topology.sh index 1cfd8bbf5ba..b5b5b1085fc 100755 --- a/docker/wfm/app/deploy_single_topology.sh +++ b/docker/wfm/app/deploy_single_topology.sh @@ -28,7 +28,7 @@ TOPOLOGY_DEFINITION=${5:-"/app/${TOPOLOGY_NAME}-storm-topology/topology-definiti TOPOLOGY_JAR=$(ls -1 /app/${TOPOLOGY_NAME}-storm-topology/libs/ | grep -v "\-original" | head -1) COMMA_SEPARATED_DEPENDENCY_LIST="" -for DEPENDENCY_JAR in $(ls -1 /app/${TOPOLOGY_NAME}-storm-topology/dependency-jars/); +for DEPENDENCY_JAR in $([[ -d /app/${TOPOLOGY_NAME}-storm-topology/dependency-jars/ ]] && ls -1 /app/${TOPOLOGY_NAME}-storm-topology/dependency-jars/); do COMMA_SEPARATED_DEPENDENCY_LIST="${COMMA_SEPARATED_DEPENDENCY_LIST:+$COMMA_SEPARATED_DEPENDENCY_LIST,}/app/${TOPOLOGY_NAME}-storm-topology/dependency-jars/${DEPENDENCY_JAR}" done From 55567a9c3c3520ba3126082060a2dc0c75cc8146 Mon Sep 17 00:00:00 2001 From: pkazlenka Date: Fri, 19 Jan 2024 12:29:05 +0100 Subject: [PATCH 3/4] 5390: [TEST]: Fix flaky protected path test * Added wait condition to flaky tests that eliminates race condition. * Commented out check in SwapEndpointSpec due to known issue. --- .../spec/flows/ProtectedPathSpec.groovy | 16 ++++++++++++---- .../spec/flows/SwapEndpointSpec.groovy | 11 +++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy index 0a859c85087..6846c8be445 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/ProtectedPathSpec.groovy @@ -10,6 +10,7 @@ import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE_SWITCHES import static org.openkilda.functionaltests.helpers.FlowHistoryConstants.REROUTE_ACTION import static org.openkilda.functionaltests.helpers.FlowHistoryConstants.REROUTE_FAIL import static org.openkilda.functionaltests.helpers.SwitchHelper.isDefaultMeter +import static org.openkilda.messaging.info.event.IslChangeType.FAILED import static org.openkilda.model.MeterId.MAX_SYSTEM_RULE_METER_ID import static org.openkilda.model.cookie.CookieBase.CookieType.SERVICE_OR_FLOW_SEGMENT import static org.openkilda.testing.Constants.NON_EXISTENT_FLOW_ID @@ -440,8 +441,9 @@ class ProtectedPathSpec extends HealthCheckSpecification { status == FlowState.DEGRADED.toString() flowStatusDetails.mainFlowPathStatus == "Up" flowStatusDetails.protectedFlowPathStatus == "Down" - statusInfo == "Not enough bandwidth or no path found. Switch ${switchPair.getSrc().getDpId()} \ -doesn't have links with enough bandwidth, Failed to find path with requested bandwidth=$flow.maximumBandwidth" + statusInfo =~ ~/Not enough bandwidth or no path found. Switch \ +(${switchPair.getSrc().getDpId()}|${switchPair.getDst().getDpId()}) doesn't have links with enough bandwidth, \ +Failed to find path with requested bandwidth=$flow.maximumBandwidth/ } } @@ -486,8 +488,14 @@ doesn't have links with enough bandwidth, Failed to find path with requested ban it != originalProtectedPath }.collectMany { pathHelper.getInvolvedIsls(it) } .findAll {!usedIsls.contains(it) } .unique { a, b -> a == b || a == b.reversed ? 0 : 1 } - otherIsls.each { - antiflap.portDown(it.srcSwitch.dpId, it.srcPort) + withPool { + otherIsls.eachParallel { + antiflap.portDown(it.srcSwitch.dpId, it.srcPort) + } + } + Wrappers.wait(WAIT_OFFSET) { + def links = northbound.getAllLinks() + assert otherIsls.each {islUtils.getIslInfo(links, it).get().state == FAILED} } and: "Main flow path breaks" diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/SwapEndpointSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/SwapEndpointSpec.groovy index 3a0db3d5cfe..969dbb0c918 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/SwapEndpointSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/SwapEndpointSpec.groovy @@ -1082,24 +1082,19 @@ switches"() { new FlowEndpointsNotSwappedExpectedError(~/Not enough bandwidth or no path found/).matches(exc) and: "All involved switches are valid" + /** https://github.com/telstra/open-kilda/issues/3770 Wrappers.wait(RULES_INSTALLATION_TIME) { assert switchHelper.validate(involvedSwIds).isEmpty() } - Boolean isTestCompleted = true + Boolean isTestCompleted = true **/ + switchHelper.synchronize(involvedSwIds) cleanup: "Restore topology and delete flows" [flow1, flow2].each { it && flowHelper.deleteFlow(it.id) } - //https://github.com/telstra/open-kilda/issues/3770 - switchHelper.synchronize(involvedSwIds) broughtDownPorts.every { antiflap.portUp(it.switchId, it.portNo) } Wrappers.wait(discoveryInterval + WAIT_OFFSET) { northbound.getAllLinks().each { assert it.state != IslChangeType.FAILED } } - if (!isTestCompleted) { - switchHelper.synchronize([flow1SwitchPair.src.dpId, flow1SwitchPair.dst.dpId, - flow2SwitchPair.src.dpId, flow2SwitchPair.dst.dpId] - .unique()) - } database.resetCosts(topology.isls) } From 52165f9bec0e1cdc6f1d45fdd59c62e76eadbccb Mon Sep 17 00:00:00 2001 From: ichupin Date: Wed, 24 Jan 2024 13:59:19 +0100 Subject: [PATCH 4/4] update CHANGELOG.md (release-1.152.0, release-1.153.0) --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17863319fc7..901fa32b830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,39 @@ # Changelog +## v1.153.0 (29/01/2024) + +### Improvements: +- [#5544](https://github.com/telstra/open-kilda/pull/5544) Avoid non-existing directory warnings on WFM container creation +- [#5546](https://github.com/telstra/open-kilda/pull/5546) 5390: [TEST]: Fix flaky protected path test [**tests**] + +### Other changes: +- [#5540](https://github.com/telstra/open-kilda/pull/5540) 5521: [TEST] Update History validation test (Issue: [#5221](https://github.com/telstra/open-kilda/issues/5221)) [**tests**] + +For the complete list of changes, check out [the commit log](https://github.com/telstra/open-kilda/compare/v1.152.0...v1.153.0). + +--- + +## v1.152.0 (19/01/2024) + +### Bug Fixes: +- [#5520](https://github.com/telstra/open-kilda/pull/5520) Add ordering for simple flow history actions (Issue: [#5519](https://github.com/telstra/open-kilda/issues/5519)) +- [#5521](https://github.com/telstra/open-kilda/pull/5521) Add parameters validation to get flow and HA-flow history API. + +### Improvements: +- [#5536](https://github.com/telstra/open-kilda/pull/5536) upgrade java version in sonargate.yml +- [#5514](https://github.com/telstra/open-kilda/pull/5514) [TEST]: 5162: Refactoring HC [**tests**] +- [#5518](https://github.com/telstra/open-kilda/pull/5518) Add default options for gradle (Issue: [#5155](https://github.com/telstra/open-kilda/issues/5155)) [**configuration**] + +### Other changes: +- [#5525](https://github.com/telstra/open-kilda/pull/5525) [TEST] Refactoring the way to choose switch pairs for test pt.2 [**tests**] +- [#5532](https://github.com/telstra/open-kilda/pull/5532) [TEST] Unignore tests which can be run [**tests**] + +For the complete list of changes, check out [the commit log](https://github.com/telstra/open-kilda/compare/v1.151.0...v1.152.0). + +### Affected Components: +history + +--- + ## v1.151.0 (02/01/2024) ### Improvements: