Skip to content

Commit

Permalink
Improve kuttl tests
Browse files Browse the repository at this point in the history
Create the NAD for the octavia amphora controllers
Ensure that the HM addresses and routes are set
  • Loading branch information
gthiemonge committed Oct 18, 2024
1 parent b54fc8d commit 73db500
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
25 changes: 25 additions & 0 deletions config/samples/octavia_v1beta1_octavia.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: octavia
spec:
config: |
{
"cniVersion": "0.3.1",
"name": "octavia",
"type": "bridge",
"bridge": "octbr",
"ipam": {
"type": "whereabouts",
"range": "172.23.0.0/24",
"range_start": "172.23.0.30",
"range_end": "172.23.0.70",
"routes": [
{
"dst": "172.24.0.0/16",
"gw" : "172.23.0.150"
}
]
}
}
---
apiVersion: octavia.openstack.org/v1beta1
kind: Octavia
metadata:
Expand Down
15 changes: 15 additions & 0 deletions tests/kuttl/common/assert_sample_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,18 @@ commands:
fi
done
exit 0
- script: |
pod=$(oc get pods -n $NAMESPACE -l service=octavia-healthmanager --field-selector=status.phase=Running -o name | head -1)
if [ "$pod" = "" ]; then
exit 1
fi
# Check that the octavia-healthmanager pods has 2 IP addresses on the octavia interface
n_addresses=$(oc logs -n $NAMESPACE -c init "$pod" | grep "addr 172\.23\..* dev octavia" | wc -l)
if [ "$n_addresses" != "2" ]; then
exit 1
fi
# and a route to the lb-mgmt-subnet
if ! oc logs -n $NAMESPACE -c init "$pod" | grep 'route 172.24.0.0/16 via 172.23.0.150 dev octavia'; then
exit 1
fi
exit 0

0 comments on commit 73db500

Please sign in to comment.