diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudSpec.groovy index b131085f881..2348aed9d88 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudSpec.groovy @@ -39,7 +39,6 @@ import org.springframework.web.client.HttpClientErrorException import spock.lang.Narrative import spock.lang.See import spock.lang.Shared -import spock.lang.Unroll import javax.inject.Provider @@ -160,8 +159,7 @@ class FlowCrudSpec extends HealthCheckSpecification { srcDstStr = "src:${topology.find(flow.source.switchId).hwSwString}->dst:${topology.find(flow.destination.switchId).hwSwString}" } - @Unroll("Able to create a second flow if #data.description") - def "Able to create multiple flows on certain combinations of switch-port-vlans"() { + def "Able to create multiple flows with #data.description"() { given: "Two potential flows that should not conflict" Tuple2 flows = data.getNotConflictingFlows() @@ -337,7 +335,7 @@ class FlowCrudSpec extends HealthCheckSpecification { } @Tags([TOPOLOGY_DEPENDENT, SMOKE_SWITCHES]) - def "Able to create single switch single port flow with different vlan (#flow.source.switchId)"( + def "Able to create single switch single port flow with different vlan (#flow.source.switchId.description)"( FlowRequestV2 flow) { given: "A flow" flowHelperV2.addFlow(flow) @@ -389,8 +387,7 @@ class FlowCrudSpec extends HealthCheckSpecification { ~/It is not allowed to create one-switch flow for the same ports and VLANs/).matches(error) } - @Unroll("Unable to create flow with #data.conflict") - def "Unable to create flow with conflicting vlans or flow IDs"() { + def "Unable to create flow with conflict data (#data.conflict)"() { given: "A potential flow" def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudV1Spec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudV1Spec.groovy index 19b338db394..5297a9e6be9 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudV1Spec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowCrudV1Spec.groovy @@ -1,16 +1,28 @@ package org.openkilda.functionaltests.spec.flows -import com.google.common.collect.Sets -import groovy.util.logging.Slf4j -import org.apache.kafka.clients.producer.KafkaProducer -import org.apache.kafka.clients.producer.ProducerRecord -import org.openkilda.functionaltests.HealthCheckSpecification +import static org.openkilda.functionaltests.extension.tags.Tag.ISL_PROPS_DB_RESET +import static org.openkilda.functionaltests.extension.tags.Tag.ISL_RECOVER_ON_FAIL +import static org.openkilda.functionaltests.extension.tags.Tag.SWITCH_RECOVER_ON_FAIL +import static groovyx.gpars.GParsPool.withPool +import static org.junit.jupiter.api.Assumptions.assumeTrue +import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY +import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT +import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL +import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.RESET_ISLS_COST +import static org.openkilda.messaging.info.event.IslChangeType.DISCOVERED +import static org.openkilda.messaging.info.event.IslChangeType.MOVED +import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID +import static org.openkilda.testing.Constants.WAIT_OFFSET +import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW +import static org.openkilda.testing.tools.KafkaUtils.buildMessage + import org.openkilda.functionaltests.error.flow.FlowNotCreatedExpectedError import org.openkilda.functionaltests.error.flow.FlowNotCreatedWithConflictExpectedError import org.openkilda.functionaltests.error.flow.FlowNotCreatedWithMissingPathExpectedError import org.openkilda.functionaltests.error.flow.FlowNotDeletedExpectedError import org.openkilda.functionaltests.error.flow.FlowNotUpdatedExpectedError import org.openkilda.functionaltests.error.flow.FlowNotUpdatedWithConflictExpectedError +import org.openkilda.functionaltests.HealthCheckSpecification import org.openkilda.functionaltests.extension.tags.Tags import org.openkilda.functionaltests.helpers.PathHelper import org.openkilda.functionaltests.helpers.Wrappers @@ -31,6 +43,11 @@ import org.openkilda.testing.model.topology.TopologyDefinition.Switch import org.openkilda.testing.service.traffexam.FlowNotApplicableException import org.openkilda.testing.service.traffexam.TraffExamService import org.openkilda.testing.tools.FlowTrafficExamBuilder + +import com.google.common.collect.Sets +import groovy.util.logging.Slf4j +import org.apache.kafka.clients.producer.KafkaProducer +import org.apache.kafka.clients.producer.ProducerRecord import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Qualifier import org.springframework.beans.factory.annotation.Value @@ -39,26 +56,9 @@ import spock.lang.Ignore import spock.lang.Narrative import spock.lang.See import spock.lang.Shared -import spock.lang.Unroll -import javax.inject.Provider import java.time.Instant - -import static groovyx.gpars.GParsPool.withPool -import static org.junit.jupiter.api.Assumptions.assumeTrue -import static org.openkilda.functionaltests.extension.tags.Tag.ISL_PROPS_DB_RESET -import static org.openkilda.functionaltests.extension.tags.Tag.ISL_RECOVER_ON_FAIL -import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY -import static org.openkilda.functionaltests.extension.tags.Tag.SWITCH_RECOVER_ON_FAIL -import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT -import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL -import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.RESET_ISLS_COST -import static org.openkilda.messaging.info.event.IslChangeType.DISCOVERED -import static org.openkilda.messaging.info.event.IslChangeType.MOVED -import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID -import static org.openkilda.testing.Constants.WAIT_OFFSET -import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW -import static org.openkilda.testing.tools.KafkaUtils.buildMessage +import javax.inject.Provider @Slf4j @See(["https://github.com/telstra/open-kilda/blob/develop/docs/design/usecase/flow-crud-create-full.png", @@ -149,8 +149,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification { srcDstStr = "src:${topology.find(flow.source.datapath).hwSwString}->dst:${topology.find(flow.destination.datapath).hwSwString}" } - @Unroll("Able to create a second flow if #data.description") - def "Able to create multiple flows on certain combinations of switch-port-vlans"() { + def "Able to create multiple flows with #data.description"() { given: "Two potential flows that should not conflict" Tuple2 flows = data.getNotConflictingFlows() @@ -326,7 +325,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification { } @Tags([TOPOLOGY_DEPENDENT]) - def "Able to create single switch single port flow with different vlan (#flow.source.datapath)"(FlowPayload flow) { + def "Able to create single switch single port flow with different vlan (#flow.source.getSwitchDpId().description)"(FlowPayload flow) { given: "A flow" flowHelper.addFlow(flow) @@ -377,8 +376,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification { ~/It is not allowed to create one-switch flow for the same ports and VLANs/).matches(error) } - @Unroll("Unable to create flow with #data.conflict") - def "Unable to create flow with conflicting vlans or flow IDs"() { + def "Unable to create flow with conflict data (#data.conflict)"() { given: "A potential flow" def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches def flow = flowHelper.randomFlow(srcSwitch, dstSwitch) @@ -412,8 +410,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification { ] } - @Unroll("Unable to update flow (#data.conflict)") - def "Unable to update flow when there are conflicting vlans"() { + def "Unable to update flow when there are conflicting vlans((#data.conflict))"() { given: "Two potential flows" def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches def flow1 = flowHelper.randomFlow(srcSwitch, dstSwitch, false) @@ -866,7 +863,7 @@ are not connected to the controller/).matches(exc) } /** - * Get list of all unique flows without transit switch (neighboring switches), permute by vlan presence. + * Get list of all unique flows without transit switch (neighboring switches), permute by vlan presence. * By unique flows it considers combinations of unique src/dst switch descriptions and OF versions. */ def getFlowsWithoutTransitSwitch() { @@ -894,7 +891,7 @@ are not connected to the controller/).matches(exc) } /** - * Get list of all unique flows with transit switch (not neighboring switches), permute by vlan presence. + * Get list of all unique flows with transit switch (not neighboring switches), permute by vlan presence. * By unique flows it considers combinations of unique src/dst switch descriptions and OF versions. */ def getFlowsWithTransitSwitch() { diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowPingSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowPingSpec.groovy index 03b78cc1fe4..b9d0042dd68 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowPingSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/FlowPingSpec.groovy @@ -1,5 +1,16 @@ package org.openkilda.functionaltests.spec.flows +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs +import static org.junit.jupiter.api.Assumptions.assumeTrue +import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY +import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE +import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT +import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_RULE +import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE +import static org.openkilda.testing.Constants.STATS_LOGGING_TIMEOUT +import static org.openkilda.testing.Constants.WAIT_OFFSET +import static spock.util.matcher.HamcrestSupport.expect + import org.openkilda.functionaltests.HealthCheckSpecification import org.openkilda.functionaltests.error.flow.FlowNotCreatedExpectedError import org.openkilda.functionaltests.extension.tags.IterationTag @@ -18,18 +29,6 @@ import org.springframework.beans.factory.annotation.Value import org.springframework.web.client.HttpClientErrorException import spock.lang.Narrative import spock.lang.See -import spock.lang.Unroll - -import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs -import static org.junit.jupiter.api.Assumptions.assumeTrue -import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY -import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE -import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT -import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_RULE -import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE -import static org.openkilda.testing.Constants.STATS_LOGGING_TIMEOUT -import static org.openkilda.testing.Constants.WAIT_OFFSET -import static spock.util.matcher.HamcrestSupport.expect @See("https://github.com/telstra/open-kilda/tree/develop/docs/design/flow-ping") @Narrative(""" @@ -43,9 +42,8 @@ class FlowPingSpec extends HealthCheckSpecification { @Value('${flow.ping.interval}') int pingInterval - @Unroll("Able to ping a flow with vlan between switches #swPair.toString()") @Tags([TOPOLOGY_DEPENDENT]) - def "Able to ping a flow with vlan"(Switch srcSwitch, Switch dstSwitch) { + def "Able to ping a flow with vlan between #switchPairDescription"(Switch srcSwitch, Switch dstSwitch) { given: "A flow with random vlan" def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch) flow.encapsulationType= FlowEncapsulationType.TRANSIT_VLAN @@ -83,10 +81,9 @@ class FlowPingSpec extends HealthCheckSpecification { where: [srcSwitch, dstSwitch] << ofSwitchCombinations - swPair = new SwitchPair(src: srcSwitch, dst: dstSwitch, paths: []) + switchPairDescription = "src[$srcSwitch.description $srcSwitch.ofVersion]-dst[$dstSwitch.description $dstSwitch.ofVersion]" } - @Unroll("Able to ping a flow with vxlan between switches #swPair.toString()") @Tags([TOPOLOGY_DEPENDENT]) def "Able to ping a flow with vxlan"() { given: "A flow with random vxlan" @@ -121,9 +118,8 @@ class FlowPingSpec extends HealthCheckSpecification { } } - @Unroll("Able to ping a flow with no vlan between switches #swPair.toString()") @Tags([TOPOLOGY_DEPENDENT]) - def "Able to ping a flow with no vlan"(Switch srcSwitch, Switch dstSwitch) { + def "Able to ping a flow with no vlan between #switchPairDescription"(Switch srcSwitch, Switch dstSwitch) { given: "A flow with no vlan" def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch) flow.source.vlanId = 0 @@ -144,12 +140,12 @@ class FlowPingSpec extends HealthCheckSpecification { where: [srcSwitch, dstSwitch] << ofSwitchCombinations - swPair = new SwitchPair(src: srcSwitch, dst: dstSwitch, paths: []) + switchPairDescription = "src[$srcSwitch.description $srcSwitch.ofVersion]-dst[$dstSwitch.description $dstSwitch.ofVersion]" + } - @Unroll("Flow ping can detect a broken #description") @IterationTag(tags = [SMOKE], iterationNameRegex = /forward path/) - def "Flow ping can detect a broken path for a vlan flow"() { + def "Flow ping can detect a broken path(#description) for a vlan flow"() { given: "A flow with at least 1 a-switch link" def switches = topology.activeSwitches.findAll { !it.centec && it.ofVersion != "OF_12" } List> allPaths = [] diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/MirrorEndpointsSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/MirrorEndpointsSpec.groovy index 3211cf26523..539d74fc8c2 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/MirrorEndpointsSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/MirrorEndpointsSpec.groovy @@ -40,7 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.client.HttpClientErrorException import spock.lang.See import spock.lang.Shared -import spock.lang.Unroll import javax.inject.Provider import java.util.regex.Pattern @@ -705,8 +704,7 @@ class MirrorEndpointsSpec extends HealthCheckSpecification { } @Tags([LOW_PRIORITY]) - @Unroll("#testData.testName, #testData.mirrorPoint.mirrorPointDirection") - def "Test possible error scenarios during mirror point creation"(MirrorErrorTestData testData) { + def "Test possible error scenarios during mirror point creation: [#testData.testName, #testData.mirrorPoint.mirrorPointDirection]"(MirrorErrorTestData testData) { given: "A flow" def flow = testData.flow flowHelperV2.addFlow(flow) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/PartialUpdateSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/PartialUpdateSpec.groovy index f25f8340208..0b3c02b25ac 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/PartialUpdateSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/flows/PartialUpdateSpec.groovy @@ -25,7 +25,6 @@ import org.openkilda.testing.model.topology.TopologyDefinition.Isl import org.springframework.web.client.HttpClientErrorException import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs import static org.assertj.core.api.Assertions.assertThat @@ -562,8 +561,7 @@ class PartialUpdateSpec extends HealthCheckSpecification { ] } - @Unroll("Unable to partial update flow (#data.conflict)") - def "Unable to partial update flow when there are conflicting vlans"() { + def "Unable to partial update flow when there are conflicting vlans (#data.conflict)"() { given: "Two potential flows" def swPair = switchPairs.all().random() def flow1 = flowHelperV2.randomFlow(swPair, false) @@ -696,8 +694,7 @@ class PartialUpdateSpec extends HealthCheckSpecification { } } - @Unroll("Unable to partial update flow (maxLatency #maxLatencyAfter and maxLatencyTier2 #maxLatencyT2After)") - def "Unable to partial update flow with maxLatency incorrect value"() { + def "Unable to partial update flow with maxLatency incorrect value(#description)"() { given: "Two potential flows" def flow = flowHelperV2.randomFlow(switchPairs.all().random()).tap { maxLatency = maxLatencyBefore diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/grpc/GrpcCommonSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/grpc/GrpcCommonSpec.groovy index 8017ff993bf..b8d97c8650e 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/grpc/GrpcCommonSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/grpc/GrpcCommonSpec.groovy @@ -28,7 +28,7 @@ class GrpcCommonSpec extends GrpcBaseSpecification { sw << getNoviflowSwitches() } - def "Able to get switch packet in out stats"() { + def "Able to get switch packet in out stats on the #switches.hwSwString (#switches.description) switch"() { when: "Get switch packet in out stats" def response = grpc.getPacketInOutStats(switches.address) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/links/LinkSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/links/LinkSpec.groovy index 80d1586c8a1..38d9cd73dde 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/links/LinkSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/links/LinkSpec.groovy @@ -462,7 +462,7 @@ class LinkSpec extends HealthCheckSpecification { getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null | "dst_port" } - def "Get links with specifying query parameters"() { + def "Get links with specifying query parameters: #description"() { when: "Get links with specifying query parameters" def links = northbound.getLinks(srcSwId, srcSwPort, dstSwId, dstSwPort) @@ -477,12 +477,12 @@ class LinkSpec extends HealthCheckSpecification { } where: - srcSwId | srcSwPort | dstSwId | dstSwPort - null | null | null | null - getIsl().srcSwitch.dpId | null | null | null - getIsl().srcSwitch.dpId | getIsl().srcPort | null | null - getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null - getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | getIsl().dstPort + description | srcSwId | srcSwPort | dstSwId | dstSwPort + "without params" | null | null | null | null + "with src(swId)" | getIsl().srcSwitch.dpId | null | null | null + "with src(swId+port)" | getIsl().srcSwitch.dpId | getIsl().srcPort | null | null + "with src(swId+port) and dst(swId)" | getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null + "with src(swId+port) and dst(swId+port)" | getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | getIsl().dstPort } def "Get links with specifying NOT existing query parameters (#item doesn't exist)"() { diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/network/PathsSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/network/PathsSpec.groovy index 03fb9d7a257..84530f57910 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/network/PathsSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/network/PathsSpec.groovy @@ -10,7 +10,6 @@ import org.openkilda.northbound.dto.v1.switches.SwitchPropertiesDto import org.openkilda.testing.model.topology.TopologyDefinition.Switch import org.openkilda.testing.service.northbound.NorthboundService import org.springframework.web.client.HttpClientErrorException -import spock.lang.Unroll import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE @@ -81,7 +80,6 @@ class PathsSpec extends HealthCheckSpecification { } @Tags(LOW_PRIORITY) - @Unroll def "Unable to get paths for #problemDescription"() { when: "Try to get paths between #problemDescription" switchPair(topology.getSwitches().first(), northbound).getPathsFromApi() @@ -144,7 +142,6 @@ class PathsSpec extends HealthCheckSpecification { } @Tags(LOW_PRIORITY) - @Unroll def "Protected path is #isIncludedString included into path list if #isIncludedString requested"() { given: "Two switches with potential protected path" def switchPair = switchPairs.all() diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/server42/Server42IslRttSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/server42/Server42IslRttSpec.groovy index 94d4408dff1..90dcda9f349 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/server42/Server42IslRttSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/server42/Server42IslRttSpec.groovy @@ -1,27 +1,5 @@ package org.openkilda.functionaltests.spec.server42 -import groovy.util.logging.Slf4j -import org.openkilda.functionaltests.HealthCheckSpecification -import org.openkilda.functionaltests.extension.tags.Tags -import org.openkilda.functionaltests.helpers.SwitchHelper -import org.openkilda.functionaltests.model.cleanup.CleanupManager -import org.openkilda.functionaltests.model.stats.IslStats -import org.openkilda.messaging.model.SwitchPropertiesDto.RttState -import org.openkilda.messaging.model.system.FeatureTogglesDto -import org.openkilda.model.SwitchFeature -import org.openkilda.model.SwitchId -import org.openkilda.model.cookie.Cookie -import org.openkilda.model.cookie.CookieBase.CookieType -import org.openkilda.testing.model.topology.TopologyDefinition.Isl -import org.openkilda.testing.model.topology.TopologyDefinition.Switch -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.beans.factory.annotation.Value -import spock.lang.Ignore -import spock.lang.Isolated -import spock.lang.ResourceLock -import spock.lang.Shared -import spock.lang.Unroll - import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs import static groovyx.gpars.GParsPool.withPool import static org.assertj.core.api.Assertions.assertThat @@ -45,6 +23,28 @@ import static org.openkilda.testing.Constants.WAIT_OFFSET import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW import static spock.util.matcher.HamcrestSupport.expect +import org.openkilda.functionaltests.HealthCheckSpecification +import org.openkilda.functionaltests.extension.tags.Tags +import org.openkilda.functionaltests.helpers.SwitchHelper +import org.openkilda.functionaltests.model.cleanup.CleanupManager +import org.openkilda.functionaltests.model.stats.IslStats +import org.openkilda.messaging.model.SwitchPropertiesDto.RttState +import org.openkilda.messaging.model.system.FeatureTogglesDto +import org.openkilda.model.SwitchFeature +import org.openkilda.model.SwitchId +import org.openkilda.model.cookie.Cookie +import org.openkilda.model.cookie.CookieBase.CookieType +import org.openkilda.testing.model.topology.TopologyDefinition.Isl +import org.openkilda.testing.model.topology.TopologyDefinition.Switch + +import groovy.util.logging.Slf4j +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.beans.factory.annotation.Value +import spock.lang.Ignore +import spock.lang.Isolated +import spock.lang.ResourceLock +import spock.lang.Shared + @Slf4j @ResourceLock(S42_TOGGLE) @Isolated //s42 toggle affects all switches in the system, may lead to excess rules during sw validation in other tests @@ -64,8 +64,7 @@ class Server42IslRttSpec extends HealthCheckSpecification { int statsWaitSeconds = 4 @Tags([LOW_PRIORITY]) - @Unroll - def "ISL RTT stats are available only if both global and switch toggles are 'on'"() { + def "ISL RTT stats are available only if both global and switch toggles are ON (featureToggle: #featureToggle && switchToggle: #switchToggle => statsAvailable: #statsAvailable)"() { given: "An active ISL with both switches having server42" def server42switchesDpIds = topology.getActiveServer42Switches()*.dpId def isl = topology.islsForActiveSwitches.find { diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/HaFlowStatSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/HaFlowStatSpec.groovy index beef83cffaa..0d85752ef72 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/HaFlowStatSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/HaFlowStatSpec.groovy @@ -29,7 +29,6 @@ import org.openkilda.testing.service.traffexam.TraffExamService import org.springframework.beans.factory.annotation.Autowired import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll import javax.inject.Provider @@ -76,7 +75,6 @@ class HaFlowStatSpec extends HealthCheckSpecification { } - @Unroll def "System is able to collect #stat meter stats"() { expect: "#stat stats is available" assert stats.get(stat).hasNonZeroValues() @@ -85,7 +83,6 @@ class HaFlowStatSpec extends HealthCheckSpecification { stat << HaFlowStatsMetric.values().findAll { it.getValue().contains("meter.") } } - @Unroll def "System is able to collect #stat stats and they grow monotonically"() { expect: "#stat stats is available" assert stats.get(stat, direction).isGrowingMonotonically() @@ -95,16 +92,19 @@ class HaFlowStatSpec extends HealthCheckSpecification { [FORWARD, REVERSE]].combinations() } - @Unroll - def "System is able to collect latency stats for subflows"() { - expect: "#stat stats is available" + + def "System is able to collect latency stats for #description in #direction direction"() { + expect: "The appropriate statistics data is available" wait(statsRouterRequestInterval) { assert flowStats.of(subFlow).get(FLOW_RTT, direction).hasNonZeroValues() } where: - [subFlow, direction] << [haFlow.subFlows*.flowId, - [FORWARD, REVERSE]].combinations() + description | direction | subFlow + "sub-flow-a" | FORWARD | haFlow.subFlows.flowId.find { it.contains("haflow-a") } + "sub-flow-a" | REVERSE | haFlow.subFlows.flowId.find { it.contains("haflow-a") } + "sub-flow-b" | FORWARD | haFlow.subFlows.flowId.find { it.contains("haflow-b") } + "sub-flow-b" | REVERSE | haFlow.subFlows.flowId.find { it.contains("haflow-b") } } def cleanupSpec() { diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/SimulateStatsSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/SimulateStatsSpec.groovy index 3a2f276ba43..47aa024a885 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/SimulateStatsSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/SimulateStatsSpec.groovy @@ -19,7 +19,6 @@ import org.springframework.beans.factory.annotation.Qualifier import org.springframework.beans.factory.annotation.Value import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll import spock.util.mop.Use import static org.openkilda.functionaltests.helpers.Wrappers.wait @@ -105,22 +104,21 @@ class SimulateStatsSpec extends HealthCheckSpecification { } - @Unroll def "Flow stats #metric with big values are properly being saved to stats db (noviflow boundaries)"() { expect: "Corresponding entries appear in tsdb" getStats(stats).hasValue(value) where: - metric |getStats | value - FLOW_EGRESS_PACKETS | {FlowStats flStats -> flStats.get(FLOW_EGRESS_PACKETS, REVERSE)} |NOVI_MAX_PACKET_COUNT - FLOW_EGRESS_BYTES | {FlowStats flStats -> flStats.get(FLOW_EGRESS_BYTES, REVERSE)} |NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE - FLOW_EGRESS_BITS | {FlowStats flStats -> flStats.get(FLOW_EGRESS_BITS, REVERSE)} |NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 - FLOW_INGRESS_PACKETS | {FlowStats flStats -> flStats.get(FLOW_INGRESS_PACKETS, FORWARD)} |NOVI_MAX_PACKET_COUNT - FLOW_INGRESS_BYTES | {FlowStats flStats -> flStats.get(FLOW_INGRESS_BYTES, FORWARD)}|NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE - FLOW_INGRESS_BITS | {FlowStats flStats -> flStats.get(FLOW_INGRESS_BITS, FORWARD)}|NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 - FLOW_RAW_PACKETS | {FlowStats flStats -> flStats.get(FLOW_RAW_PACKETS, inPort, outPort)}|NOVI_MAX_PACKET_COUNT - FLOW_RAW_BYTES | {FlowStats flStats -> flStats.get(FLOW_RAW_BYTES, inPort, outPort)}|NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE - FLOW_RAW_BITS | {FlowStats flStats -> flStats.get(FLOW_RAW_BITS, inPort, outPort)}|NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 + metric | getStats | value + FLOW_EGRESS_PACKETS | { FlowStats flStats -> flStats.get(FLOW_EGRESS_PACKETS, REVERSE) } | NOVI_MAX_PACKET_COUNT + FLOW_EGRESS_BYTES | { FlowStats flStats -> flStats.get(FLOW_EGRESS_BYTES, REVERSE) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE + FLOW_EGRESS_BITS | { FlowStats flStats -> flStats.get(FLOW_EGRESS_BITS, REVERSE) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 + FLOW_INGRESS_PACKETS | { FlowStats flStats -> flStats.get(FLOW_INGRESS_PACKETS, FORWARD) } | NOVI_MAX_PACKET_COUNT + FLOW_INGRESS_BYTES | { FlowStats flStats -> flStats.get(FLOW_INGRESS_BYTES, FORWARD) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE + FLOW_INGRESS_BITS | { FlowStats flStats -> flStats.get(FLOW_INGRESS_BITS, FORWARD) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 + FLOW_RAW_PACKETS | { FlowStats flStats -> flStats.get(FLOW_RAW_PACKETS, inPort, outPort) } | NOVI_MAX_PACKET_COUNT + FLOW_RAW_BYTES | { FlowStats flStats -> flStats.get(FLOW_RAW_BYTES, inPort, outPort) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE + FLOW_RAW_BITS | { FlowStats flStats -> flStats.get(FLOW_RAW_BITS, inPort, outPort) } | NOVI_MAX_PACKET_COUNT * MAX_PACKET_SIZE * 8 } @Override diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/TsdbSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/TsdbSpec.groovy index 510f5fbfdd4..5c9b6f4757b 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/TsdbSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/TsdbSpec.groovy @@ -1,19 +1,5 @@ package org.openkilda.functionaltests.spec.stats -import groovy.time.TimeCategory -import groovy.transform.Memoized -import org.openkilda.functionaltests.HealthCheckSpecification -import org.openkilda.functionaltests.extension.tags.Tags -import org.openkilda.functionaltests.model.stats.SwitchStats -import org.openkilda.functionaltests.model.stats.SwitchStatsMetric -import org.openkilda.functionaltests.model.stats.SystemStats -import org.openkilda.model.SwitchId -import org.springframework.beans.factory.annotation.Autowired -import spock.lang.Narrative -import spock.lang.Shared -import spock.lang.Unroll -import spock.util.mop.Use - import static groovyx.gpars.GParsExecutorsPool.withPool import static org.junit.jupiter.api.Assumptions.assumeTrue import static org.openkilda.functionaltests.extension.tags.Tag.HARDWARE @@ -42,6 +28,20 @@ import static org.openkilda.functionaltests.model.stats.SystemStatsMetric.FLOW_S import static org.openkilda.functionaltests.model.stats.SystemStatsMetric.FLOW_SYSTEM_METER_PACKETS import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_BROADCAST_RULE +import org.openkilda.functionaltests.HealthCheckSpecification +import org.openkilda.functionaltests.extension.tags.Tags +import org.openkilda.functionaltests.model.stats.SwitchStats +import org.openkilda.functionaltests.model.stats.SwitchStatsMetric +import org.openkilda.functionaltests.model.stats.SystemStats +import org.openkilda.model.SwitchId + +import groovy.time.TimeCategory +import groovy.transform.Memoized +import org.springframework.beans.factory.annotation.Autowired +import spock.lang.Narrative +import spock.lang.Shared +import spock.util.mop.Use + @Use(TimeCategory) @Narrative("Verify that basic stats logging happens.") @Tags([SMOKE_SWITCHES]) @@ -77,9 +77,8 @@ class TsdbSpec extends HealthCheckSpecification { } } - @Unroll("Stats are being logged for TX/RX metric:#metric") @Tags([TOPOLOGY_DEPENDENT, SMOKE]) - def "Basic stats are being logged"(switchId, metric) { + def "Basic stats are being logged for TX/RX metric:#metric"(switchId, metric) { expect: "At least 1 result in the past 15 minutes" assert !statsMap.get(switchId).get(metric).getDataPoints().isEmpty() @@ -93,9 +92,8 @@ class TsdbSpec extends HealthCheckSpecification { TX_BITS], getUniqueSwitches()].combinations()) } - @Unroll("Stats are being logged for verification broadcast rule metric:#metric") @Tags([TOPOLOGY_DEPENDENT, SMOKE]) - def "Basic stats are being logged"(switchId, metric) { + def "Basic stats are being logged for verification broadcast rule metric:#metric"(switchId, metric) { expect: "At least 1 result in the past 15 minutes" assert !statsMap.get(switchId).get(metric, VERIFICATION_BROADCAST_RULE.toHexString()).getDataPoints().isEmpty() @@ -107,8 +105,7 @@ class TsdbSpec extends HealthCheckSpecification { } @Tags(HARDWARE) - @Unroll("Stats are being logged for metric:#metric") - def "Basic stats are being logged (10min interval)"(metric) { + def "Basic stats are being logged for metric:#metric (10min interval)"(metric) { expect: "At least 1 result in the past 15 minutes" assert !systemStats.of(metric).get(VERIFICATION_BROADCAST_RULE.toHexString()).getDataPoints().isEmpty() @@ -117,9 +114,8 @@ class TsdbSpec extends HealthCheckSpecification { } - @Unroll("GRPC stats are being logged for metric:#metric, sw:#sw.hwSwString") @Tags([HARDWARE]) - def "GRPC stats are being logged"(metric, sw) { + def "GRPC stats are being logged for metric:#metric, sw: #sw.hwSwString"(metric, sw) { assumeTrue(northbound.getFeatureToggles().collectGrpcStats, "This test is skipped because 'collectGrpcStats' is disabled") expect: "At least 1 result in the past 15 minutes" diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/YFlowStatSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/YFlowStatSpec.groovy index 0664d5ca8db..2fa08fecd99 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/YFlowStatSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/stats/YFlowStatSpec.groovy @@ -28,7 +28,6 @@ import org.openkilda.testing.service.traffexam.model.Exam import org.springframework.beans.factory.annotation.Autowired import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll import javax.inject.Provider @@ -81,7 +80,6 @@ class YFlowStatSpec extends HealthCheckSpecification { subflow2Stats = flowStats.of(yFlow.getSubFlows().get(1).getFlowId()) } - @Unroll def "System is able to collect #stat meter stats and they grow monotonically"() { when: "Stats were collected" then: "#stat stats is available" @@ -92,7 +90,6 @@ class YFlowStatSpec extends HealthCheckSpecification { stat << YFlowStatsMetric.getEnumConstants() } - @Unroll def "System is able to collect subflow #stat-#direction stats and they grow monotonically"() { when: "Stats were collected" then: "#stat stats is available" diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/DefaultRulesSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/DefaultRulesSpec.groovy index c9f13ef6c89..67b57d07aec 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/DefaultRulesSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/DefaultRulesSpec.groovy @@ -1,19 +1,5 @@ package org.openkilda.functionaltests.spec.switches -import org.openkilda.functionaltests.HealthCheckSpecification -import org.openkilda.functionaltests.extension.tags.Tags -import org.openkilda.messaging.Message -import org.openkilda.messaging.command.CommandData -import org.openkilda.messaging.command.CommandMessage -import org.openkilda.messaging.command.switches.DeleteRulesAction -import org.openkilda.messaging.command.switches.InstallRulesAction -import org.openkilda.messaging.model.SwitchPropertiesDto.RttState -import org.openkilda.model.SwitchFeature -import org.openkilda.model.cookie.Cookie -import org.openkilda.model.cookie.CookieBase.CookieType -import org.openkilda.testing.model.topology.TopologyDefinition.Switch -import spock.lang.Unroll - import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs import static org.assertj.core.api.Assertions.assertThat import static org.junit.jupiter.api.Assumptions.assumeTrue @@ -31,15 +17,29 @@ import static org.openkilda.testing.Constants.RULES_INSTALLATION_TIME import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW import static spock.util.matcher.HamcrestSupport.expect +import org.openkilda.functionaltests.HealthCheckSpecification +import org.openkilda.functionaltests.extension.tags.Tags +import org.openkilda.messaging.Message +import org.openkilda.messaging.command.CommandData +import org.openkilda.messaging.command.CommandMessage +import org.openkilda.messaging.command.switches.DeleteRulesAction +import org.openkilda.messaging.command.switches.InstallRulesAction +import org.openkilda.messaging.model.SwitchPropertiesDto.RttState +import org.openkilda.model.SwitchFeature +import org.openkilda.model.cookie.Cookie +import org.openkilda.model.cookie.CookieBase.CookieType +import org.openkilda.testing.model.topology.TopologyDefinition.Switch + +import spock.lang.Unroll + class DefaultRulesSpec extends HealthCheckSpecification { def setupSpec() { deleteAnyFlowsLeftoversIssue5480() } - @Unroll("Default rules are installed on #sw.hwSwString") @Tags([TOPOLOGY_DEPENDENT, SMOKE, SMOKE_SWITCHES]) - def "Default rules are installed on switches"() { + def "Default rules are installed on switches #sw.hwSwString"() { expect: "Default rules are installed on the switch" def cookies = northbound.getSwitchRules(sw.dpId).flowEntries*.cookie cookies.sort() == sw.defaultCookies.sort() @@ -132,7 +132,7 @@ class DefaultRulesSpec extends HealthCheckSpecification { } @Tags([TOPOLOGY_DEPENDENT, SMOKE_SWITCHES]) - def "Able to install default rule on #sw.hwSwString [install-action=#data.installRulesAction]"( + def "Able to install default rule on switch: #sw.hwSwString [install-action=#data.installRulesAction]"( Map data, Switch sw) { given: "A switch without rules" def defaultRules = northbound.getSwitchRules(sw.dpId).flowEntries diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/FlowRulesSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/FlowRulesSpec.groovy index 26e800f5eb4..feaa36f4dd5 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/FlowRulesSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/FlowRulesSpec.groovy @@ -22,7 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.web.client.HttpClientErrorException import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll import javax.inject.Provider @@ -183,9 +182,8 @@ class FlowRulesSpec extends HealthCheckSpecification { ] } - @Unroll("Able to delete switch rules by #data.identifier") @Tags([SMOKE, SMOKE_SWITCHES]) - def "Able to delete switch rules by cookie/priority"() { + def "Able to delete switch rules by cookie/priority #data.identifier"() { given: "A switch with some flow rules installed" def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch) flowHelperV2.addFlow(flow) @@ -216,8 +214,7 @@ class FlowRulesSpec extends HealthCheckSpecification { ] } - @Unroll("Attempt to delete switch rules by supplying non-existing #data.description leaves all rules intact") - def "Attempt to delete switch rules by supplying non-existing cookie/priority leaves all rules intact"() { + def "Attempt to delete switch rules by supplying non-existing #data.description leaves all rules intact"() { given: "A switch with some flow rules installed" assumeTrue(data.description != "priority", "https://github.com/telstra/open-kilda/issues/1701") @@ -253,10 +250,9 @@ class FlowRulesSpec extends HealthCheckSpecification { ] } - @Unroll("Able to delete switch rules by #data.description") @Tags(SMOKE_SWITCHES) @IterationTag(tags = [SMOKE], iterationNameRegex = /inPort/) - def "Able to delete switch rules by inPort/inVlan/outPort"() { + def "Able to delete switch rules by #data.description"() { given: "A switch with some flow rules installed" flowHelperV2.addFlow(flow) def cookiesBefore = northbound.getSwitchRules(data.switch.dpId).flowEntries*.cookie.sort() @@ -314,9 +310,8 @@ class FlowRulesSpec extends HealthCheckSpecification { flow = data.flow as FlowRequestV2 } - @Unroll("Attempt to delete switch rules by supplying non-existing #data.description leaves all rules intact") @IterationTag(tags = [SMOKE], iterationNameRegex = /inVlan/) - def "Attempt to delete switch rules by supplying non-existing inPort/inVlan/outPort leaves all rules intact"() { + def "Attempt to delete switch rules by supplying non-existing #data.description keeps all rules intact"() { given: "A switch with some flow rules installed" def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch) flowHelperV2.addFlow(flow) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/MetersSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/MetersSpec.groovy index bbeb4066ee3..b530548e56a 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/MetersSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/MetersSpec.groovy @@ -1,26 +1,5 @@ package org.openkilda.functionaltests.spec.switches -import groovy.transform.Memoized -import org.openkilda.functionaltests.HealthCheckSpecification -import org.openkilda.functionaltests.extension.tags.IterationTag -import org.openkilda.functionaltests.extension.tags.Tags -import org.openkilda.functionaltests.helpers.Wrappers -import org.openkilda.messaging.error.MessageError -import org.openkilda.messaging.info.meter.MeterEntry -import org.openkilda.messaging.info.rule.FlowEntry -import org.openkilda.messaging.info.rule.SwitchFlowEntries -import org.openkilda.model.SwitchId -import org.openkilda.model.cookie.Cookie -import org.openkilda.model.cookie.CookieBase.CookieType -import org.openkilda.testing.Constants -import org.openkilda.testing.model.topology.TopologyDefinition.Switch -import org.springframework.beans.factory.annotation.Value -import org.springframework.web.client.HttpClientErrorException -import spock.lang.Narrative -import spock.lang.Unroll - -import java.math.RoundingMode - import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs import static org.junit.jupiter.api.Assumptions.assumeTrue import static org.openkilda.functionaltests.extension.tags.Tag.HARDWARE @@ -42,6 +21,27 @@ import static org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_VXLAN_COOKIE import static org.openkilda.testing.Constants.WAIT_OFFSET import static spock.util.matcher.HamcrestSupport.expect +import org.openkilda.functionaltests.HealthCheckSpecification +import org.openkilda.functionaltests.extension.tags.IterationTag +import org.openkilda.functionaltests.extension.tags.Tags +import org.openkilda.functionaltests.helpers.Wrappers +import org.openkilda.messaging.error.MessageError +import org.openkilda.messaging.info.meter.MeterEntry +import org.openkilda.messaging.info.rule.FlowEntry +import org.openkilda.messaging.info.rule.SwitchFlowEntries +import org.openkilda.model.SwitchId +import org.openkilda.model.cookie.Cookie +import org.openkilda.model.cookie.CookieBase.CookieType +import org.openkilda.testing.Constants +import org.openkilda.testing.model.topology.TopologyDefinition.Switch + +import groovy.transform.Memoized +import org.springframework.beans.factory.annotation.Value +import org.springframework.web.client.HttpClientErrorException +import spock.lang.Narrative + +import java.math.RoundingMode + @Narrative("""The test suite checks if traffic meters, including default, are set and deleted in a correct way. Note that many tests are bind to meter implementations of certain hardware manufacturers.""") @@ -400,8 +400,7 @@ meters in flow rules at all (#srcSwitch - #dstSwitch flow)"() { } @Tags([HARDWARE, TOPOLOGY_DEPENDENT, SMOKE_SWITCHES]) - @Unroll("Flow burst should be correctly set on Centec switches in case of #flowRate kbps flow bandwidth") - def "Flow burst is correctly set on Centec switches"() { + def "Flow burst should be correctly set on Centec switches in case of #flowRate kbps flow bandwidth"() { setup: "A single-switch flow with #flowRate kbps bandwidth is created on OpenFlow 1.3 compatible Centec switch" def switches = getCentecSwitches() assumeTrue(switches as boolean, "Unable to find required switches in topology") diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPortConfigSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPortConfigSpec.groovy index 27b8f62de0d..7349ae75aa2 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPortConfigSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPortConfigSpec.groovy @@ -26,7 +26,7 @@ class SwitchPortConfigSpec extends HealthCheckSpecification { SwitchStats switchStats; @Tags([TOPOLOGY_DEPENDENT, SMOKE, ISL_RECOVER_ON_FAIL]) - def "Able to bring ISL-busy port down/up on an #isl.srcSwitch.ofVersion switch #isl.srcSwitch.dpId"() { + def "Able to bring ISL-busy port down/up on an #isl.srcSwitch.ofVersion switch #isl.srcSwitch.hwSwString"() { when: "Bring port down on the switch" islHelper.breakIsl(isl) diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPropertiesSpec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPropertiesSpec.groovy index faf23690173..6c1b7eaec5f 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPropertiesSpec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchPropertiesSpec.groovy @@ -84,7 +84,7 @@ class SwitchPropertiesSpec extends HealthCheckSpecification { def exc = thrown(HttpClientErrorException) new SwitchPropertiesNotFoundExpectedError(NON_EXISTENT_SWITCH_ID, ~/Failed to update switch properties./).matches(exc) } - def "Informative error is returned when trying to update switch properties with incorrect information"() { + def "Informative error is returned when trying to update switch properties with incorrect information(#invalidType)"() { given: "A switch" def sw = topology.activeSwitches.first() @@ -98,13 +98,13 @@ class SwitchPropertiesSpec extends HealthCheckSpecification { expectedError.matches(exc) where: - supportedTransitEncapsulation | expectedError - ["test"] | new SwitchPropertiesNotUpdatedExpectedError("Unable to parse request payload", - ~/No enum constant org.openkilda.messaging.payload.flow.FlowEncapsulationType.TEST/) - [] | new SwitchPropertiesNotUpdatedExpectedError( - "Supported transit encapsulations should not be null or empty") - null | new SwitchPropertiesNotUpdatedExpectedError( - "Supported transit encapsulations should not be null or empty") + invalidType | supportedTransitEncapsulation | expectedError + "invalid type" | ["test"] | new SwitchPropertiesNotUpdatedExpectedError("Unable to parse request payload", + ~/No enum constant org.openkilda.messaging.payload.flow.FlowEncapsulationType.TEST/) + "empty list" | [] | new SwitchPropertiesNotUpdatedExpectedError( + "Supported transit encapsulations should not be null or empty") + "null" | null | new SwitchPropertiesNotUpdatedExpectedError( + "Supported transit encapsulations should not be null or empty") } def "Error is returned when trying to #data.desc"() { diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchValidationV2Spec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchValidationV2Spec.groovy index a1832797411..b69fd711481 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchValidationV2Spec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchValidationV2Spec.groovy @@ -1,5 +1,19 @@ package org.openkilda.functionaltests.spec.switches +import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY +import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE +import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE_SWITCHES +import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT +import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL +import static org.openkilda.functionaltests.helpers.SwitchHelper.isDefaultMeter +import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.SYNCHRONIZE_SWITCH +import static org.openkilda.model.MeterId.MAX_SYSTEM_RULE_METER_ID +import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID +import static org.openkilda.testing.Constants.RULES_DELETION_TIME +import static org.openkilda.testing.Constants.RULES_INSTALLATION_TIME +import static org.openkilda.testing.Constants.WAIT_OFFSET +import static org.openkilda.testing.tools.KafkaUtils.buildMessage + import com.google.common.collect.Sets import org.apache.kafka.clients.producer.KafkaProducer import org.apache.kafka.clients.producer.ProducerRecord @@ -34,21 +48,6 @@ import org.springframework.beans.factory.annotation.Value import spock.lang.Narrative import spock.lang.See import spock.lang.Shared -import spock.lang.Unroll - -import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY -import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE -import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE_SWITCHES -import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT -import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL -import static org.openkilda.functionaltests.helpers.SwitchHelper.isDefaultMeter -import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.SYNCHRONIZE_SWITCH -import static org.openkilda.model.MeterId.MAX_SYSTEM_RULE_METER_ID -import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID -import static org.openkilda.testing.Constants.RULES_DELETION_TIME -import static org.openkilda.testing.Constants.RULES_INSTALLATION_TIME -import static org.openkilda.testing.Constants.WAIT_OFFSET -import static org.openkilda.testing.tools.KafkaUtils.buildMessage @See(["https://github.com/telstra/open-kilda/tree/develop/docs/design/hub-and-spoke/switch-validate", "https://github.com/telstra/open-kilda/tree/develop/docs/design/hub-and-spoke/switch-sync"]) @@ -937,7 +936,6 @@ misconfigured" sectionsToVerifyPresence << [["meters"], ["meters", "groups"], ["meters", "groups", "rules"]] } - @Unroll @Tags([VIRTUAL, LOW_PRIORITY]) def "Able to validate switch using #apiVersion API when GRPC is down"() { given: "Random switch without LAG feature enabled" diff --git a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchesFlowsV2Spec.groovy b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchesFlowsV2Spec.groovy index ba22b6e05f4..73532d878c7 100644 --- a/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchesFlowsV2Spec.groovy +++ b/src-java/testing/functional-tests/src/test/groovy/org/openkilda/functionaltests/spec/switches/SwitchesFlowsV2Spec.groovy @@ -22,7 +22,6 @@ import org.openkilda.testing.model.topology.TopologyDefinition.Switch import org.springframework.beans.factory.annotation.Autowired import spock.lang.Narrative import spock.lang.Shared -import spock.lang.Unroll @Narrative("Verifies feature to retrieve list of flows passing the switch grouped by port number. Details: #5015") @@ -94,7 +93,6 @@ class SwitchesFlowsV2Spec extends HealthCheckSpecification { } } - @Unroll def "System allows to get a flow that #switchRole switch"() { given: "Flow that #switchRole switch" when: "Get all flows going through the switch" @@ -111,7 +109,6 @@ class SwitchesFlowsV2Spec extends HealthCheckSpecification { "ends on" | switchPair.getDst() } - @Unroll def "System allows to get a flow which protected path that goes through switch"() { given: "Flow which protected path goes through switch" when: "Get all flows going through the switch"