-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
130 changed files
with
3,046 additions
and
3,625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
LC_ALL=C | ||
|
||
local_branch="$(git rev-parse --abbrev-ref HEAD)" | ||
|
||
valid_branch_regex="^(docs|feature|fix|test|release|improvement|hotfix|chore)\/[a-z0-9._-]+$" | ||
|
||
message="There branch name is wrong. Branch names in this project must adhere to this contract: $valid_branch_regex. You should rename your branch to a valid name and try again." | ||
|
||
if [[ ! $local_branch =~ $valid_branch_regex ]] | ||
then | ||
echo "$message" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...nctional-tests/src/main/groovy/org/openkilda/functionaltests/helpers/HaFlowFactory.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.openkilda.functionaltests.helpers | ||
|
||
|
||
import static org.openkilda.testing.Constants.FLOW_CRUD_TIMEOUT | ||
import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_PROTOTYPE | ||
|
||
import org.openkilda.functionaltests.helpers.builder.HaFlowBuilder | ||
import org.openkilda.functionaltests.helpers.model.HaFlowExtended | ||
import org.openkilda.functionaltests.helpers.model.SwitchPortVlan | ||
import org.openkilda.functionaltests.helpers.model.SwitchTriplet | ||
import org.openkilda.messaging.payload.flow.FlowState | ||
import org.openkilda.northbound.dto.v2.haflows.HaFlow | ||
import org.openkilda.testing.model.topology.TopologyDefinition | ||
import org.openkilda.testing.service.northbound.NorthboundServiceV2 | ||
|
||
import groovy.util.logging.Slf4j | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.beans.factory.annotation.Qualifier | ||
import org.springframework.context.annotation.Scope | ||
import org.springframework.stereotype.Component | ||
|
||
@Slf4j | ||
@Component | ||
@Scope(SCOPE_PROTOTYPE) | ||
class HaFlowFactory { | ||
|
||
@Autowired | ||
TopologyDefinition topology | ||
|
||
@Autowired @Qualifier("islandNbV2") | ||
NorthboundServiceV2 northboundV2 | ||
|
||
/* | ||
This method allows customization of the HA-Flow with desired parameters for further creation | ||
*/ | ||
HaFlowBuilder getBuilder(SwitchTriplet swT, boolean useTraffgenPorts = true, List<SwitchPortVlan> busyEndpoints = []) { | ||
return new HaFlowBuilder(swT, northboundV2, topology, useTraffgenPorts, busyEndpoints) | ||
} | ||
|
||
/* | ||
This method allows random HA-Flow creation on specified switches | ||
and waits for it to become UP. | ||
*/ | ||
|
||
HaFlowExtended getRandom(SwitchTriplet swT, boolean useTraffgenPorts = true, List<SwitchPortVlan> busyEndpoints = []) { | ||
HaFlowBuilder haFlowBuilder = getBuilder(swT, useTraffgenPorts, busyEndpoints) | ||
def response = haFlowBuilder.build() | ||
assert response.haFlowId | ||
HaFlow haFlow = null | ||
Wrappers.wait(FLOW_CRUD_TIMEOUT) { | ||
haFlow = northboundV2.getHaFlow(response.haFlowId) | ||
assert haFlow.status == FlowState.UP.toString() | ||
&& haFlow.getSubFlows().status.unique() == [FlowState.UP.toString()], "Flow: ${haFlow}" | ||
} | ||
return new HaFlowExtended(haFlow, northboundV2, topology) | ||
} | ||
} |
Oops, something went wrong.