Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflows for managing AddressGroup subnets.
Change-Id: I6bb6a494d2f1e5097aa3eb27e7f520ff50b7e1c9 Partial-Bug: #1772594
- Loading branch information
1 parent
e149102
commit 84f4434
Showing
56 changed files
with
565 additions
and
238 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
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
4 changes: 4 additions & 0 deletions
4
o11nplugin-contrail-custom/src/main/kotlin/net/juniper/contrail/vro/CustomCodeGenerator.kt
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
113 changes: 0 additions & 113 deletions
113
...in-contrail-tests/src/test/groovy/net/juniper/contrail/vro/tests/SpringContextSpec.groovy
This file was deleted.
Oops, something went wrong.
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
65 changes: 65 additions & 0 deletions
65
...sts/src/test/groovy/net/juniper/contrail/vro/tests/actions/AddressGroupSubnetsSpec.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,65 @@ | ||
package net.juniper.contrail.vro.tests.actions | ||
|
||
import net.juniper.contrail.api.types.AddressGroup | ||
import net.juniper.contrail.api.types.SubnetListType | ||
import net.juniper.contrail.api.types.SubnetType | ||
import static net.juniper.contrail.vro.model.UtilsKt.utils | ||
import static net.juniper.contrail.vro.config.Actions.addressGroupSubnets | ||
|
||
class AddressGroupSubnetsSpec extends ActionSpec { | ||
def action = actionFromScript(addressGroupSubnets) | ||
|
||
def "null address group results in null" () { | ||
given: "null address group" | ||
def addressGroup = null | ||
|
||
when: "retrieved subnet list" | ||
def result = invokeAction(action, addressGroup) | ||
|
||
then: "resulting list is null" | ||
result == null | ||
} | ||
|
||
def "empty address group results in null" () { | ||
given: "empty address group" | ||
def addressGroup = new AddressGroup() | ||
|
||
when: "retrieved subnet list" | ||
def result = invokeAction(action, addressGroup) | ||
|
||
then: "resulting list is null" | ||
result == null | ||
} | ||
|
||
def "address group with empty subnet list results in empty list" () { | ||
given: "empty address group" | ||
def addressGroup = new AddressGroup() | ||
def subnetListType = new SubnetListType() | ||
addressGroup.prefix = subnetListType | ||
subnetListType.subnet = new ArrayList<>() | ||
|
||
when: "retrieved subnet list" | ||
def result = invokeAction(action, addressGroup) as List<String> | ||
|
||
then: "resulting list is empty" | ||
result.isEmpty() | ||
} | ||
|
||
def "address group with single subnet results in list with single formatted subnet" () { | ||
given: "address group with single subnet" | ||
def addressGroup = new AddressGroup() | ||
def subnetListType = new SubnetListType() | ||
addressGroup.prefix = subnetListType | ||
def somePrefix = "1.2.3.4" | ||
def somePrefixLen = 16 | ||
def subnet = new SubnetType(somePrefix, somePrefixLen) | ||
subnetListType.addSubnet(subnet) | ||
|
||
when: "retrieved subnet list" | ||
def result = invokeAction(action, addressGroup) as List<String> | ||
|
||
then: "resulting list has one formatted element" | ||
result.size() == 1 | ||
result[0] == utils.subnetToString(subnet) | ||
} | ||
} |
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
Oops, something went wrong.