-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from ralonsoh/OSPRH-3124
Handle the physical network changes "ovn-bridge-mappings"
- Loading branch information
Showing
13 changed files
with
162 additions
and
13 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,17 @@ | ||
apiVersion: k8s.cni.cncf.io/v1 | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
annotations: | ||
labels: | ||
osp/net: datacentre2 | ||
service: ovn-controller | ||
name: datacentre2 | ||
spec: | ||
config: | | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "datacentre2", | ||
"type": "bridge", | ||
"bridge": "ospbr2", | ||
"ipam": {} | ||
} |
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,17 @@ | ||
apiVersion: k8s.cni.cncf.io/v1 | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
annotations: | ||
labels: | ||
osp/net: datacentre3 | ||
service: ovn-controller | ||
name: datacentre3 | ||
spec: | ||
config: | | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "datacentre3", | ||
"type": "bridge", | ||
"bridge": "ospbr3", | ||
"ipam": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common/assert_sample_deployment.yaml |
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 @@ | ||
../../common/deploy_ovn.yaml |
6 changes: 6 additions & 0 deletions
6
tests/kuttl/tests/ovn_nicmappings/02-new-network-attachment-definition.yaml
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,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
oc apply -n $NAMESPACE -f ../../../../config/samples/nad_datacentre2.yaml | ||
oc apply -n $NAMESPACE -f ../../../../config/samples/nad_datacentre3.yaml |
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,18 @@ | ||
# | ||
# Check for: | ||
# | ||
# - The interface "datacentre2" exists in the ovn-controller container | ||
# - The OVS Open vSwitch external_ids:ovn-bridge-mappings is configured correctly | ||
|
||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 300 | ||
commands: | ||
- script: | | ||
controller_pod=$(oc get pod -n $NAMESPACE -l service=ovn-controller-ovs -o name|head -1) | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev datacentre2 || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev br-datacentre2 || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev datacentre3 2>&1 | grep "does not exist" || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev br-datacentre3 2>&1 | grep "does not exist" || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ovs-vsctl --if-exists get open . external_ids:ovn-bridge-mappings | grep -q "datacentre2:br-datacentre2" || exit 1 | ||
exit 0 |
10 changes: 10 additions & 0 deletions
10
tests/kuttl/tests/ovn_nicmappings/03-nicmappings-patch-datacentre2.yaml
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,10 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
timeout: 60 | ||
commands: | ||
- script: | | ||
oc patch OVNController -n $NAMESPACE ovncontroller-sample --type='json' -p='[{ | ||
"op": "replace", | ||
"path": "/spec/nicMappings", | ||
"value":{"datacentre2":"ospbr2"} | ||
}]' |
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,19 @@ | ||
# | ||
# Check for: | ||
# | ||
# - The interface "datacentre3" exists in the ovn-controller container | ||
# - The interface "datacentre2" no longer exists in the ovn-controller container | ||
# - The OVS Open vSwitch external_ids:ovn-bridge-mappings is configured correctly | ||
|
||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 300 | ||
commands: | ||
- script: | | ||
controller_pod=$(oc get pod -n $NAMESPACE -l service=ovn-controller-ovs -o name|head -1) | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev datacentre3 || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev br-datacentre3 || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev datacentre2 2>&1 | grep "does not exist" || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ip link show dev br-datacentre2 2>&1 | grep "does not exist" || exit 1 | ||
oc rsh -n $NAMESPACE ${controller_pod} ovs-vsctl --if-exists get open . external_ids:ovn-bridge-mappings | grep "datacentre2:br-datacentre2" && exit 1 | ||
exit 0 |
10 changes: 10 additions & 0 deletions
10
tests/kuttl/tests/ovn_nicmappings/04-nicmappings-patch-datacentre3.yaml
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,10 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
timeout: 60 | ||
commands: | ||
- script: | | ||
oc patch OVNController -n $NAMESPACE ovncontroller-sample --type='json' -p='[{ | ||
"op": "replace", | ||
"path": "/spec/nicMappings", | ||
"value":{"datacentre3":"ospbr3"} | ||
}]' |
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 @@ | ||
../../common/cleanup-ovn.yaml |
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 @@ | ||
../../common/errors_cleanup_ovn.yaml |