Skip to content

Commit

Permalink
add e2e testing for dual stack underlay
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Oct 16, 2021
1 parent ecf4e01 commit 9364d2a
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,54 @@ jobs:
sudo chmod 666 /home/runner/.kube/config
make e2e
dual-stack-underlay-e2e-single-nic:
needs: build
name: dual-stack-underlay-e2e-single-nic
runs-on: ubuntu-18.04
timeout-minutes: 30
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Init Kind
run: |
pip install j2cli --user
pip install "j2cli[yaml]" --user
sudo PATH=~/.local/bin:$PATH make kind-init-dual
- name: Download image
uses: actions/download-artifact@v2
with:
name: image

- name: Load Image
run: |
docker load --input image.tar
- name: Install Kube-OVN
run: |
docker load --input image.tar
sudo make kind-install-underlay-dual
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go

- name: Run E2E
run: |
go install github.com/onsi/ginkgo/ginkgo@latest
sudo kubectl cluster-info
sudo chmod 666 /home/runner/.kube/config
make e2e-underlay-single-nic
no-lb-e2e:
needs: build
name: disable-loadbalancer-e2e
Expand Down Expand Up @@ -662,6 +710,7 @@ jobs:
- ipv6-vlan-e2e
- ipv6-underlay-e2e-single-nic
- dual-stack-e2e
- dual-stack-underlay-e2e-single-nic
- no-lb-e2e
- no-lb-iptables-e2e
- no-np-e2e
Expand Down
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ kind-install-ipv6:
.PHONY: kind-install-underlay-ipv6
kind-install-underlay-ipv6:
$(eval SUBNET = $(shell docker network inspect kind -f "{{(index .IPAM.Config 1).Subnet}}"))
$(eval GATEWAY = $(shell docker exec kube-ovn-control-plane ip -6 route show default | awk '{print $$3}'))
$(eval EXCLUDE_IPS = $(shell docker network inspect kind -f '{{range .Containers}},{{index (split .IPv6Address "/") 0}}{{end}}' | sed 's/^,//'))
$(eval GATEWAY = $(shell docker exec kube-ovn-worker ip -6 route show default | awk '{print $$3}'))
@sed -e 's@^[[:space:]]*POD_CIDR=.*@POD_CIDR="$(SUBNET)"@' \
-e 's@^[[:space:]]*POD_GATEWAY=.*@POD_GATEWAY="$(GATEWAY)"@' \
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(EXCLUDE_IPS)"@' \
Expand All @@ -178,6 +178,24 @@ kind-install-dual:
ENABLE_SSL=true DUAL_STACK=true dist/images/install.sh
kubectl describe no

.PHONY: kind-install-underlay-dual
kind-install-underlay-dual:
$(eval IPV4_SUBNET = $(shell docker network inspect kind -f "{{(index .IPAM.Config 0).Subnet}}"))
$(eval IPV6_SUBNET = $(shell docker network inspect kind -f "{{(index .IPAM.Config 1).Subnet}}"))
$(eval IPV4_GATEWAY = $(shell docker network inspect kind -f "{{(index .IPAM.Config 0).Gateway}}"))
$(eval IPV6_GATEWAY = $(shell docker exec kube-ovn-control-plane ip -6 route show default | awk '{print $$3}'))
$(eval IPV4_EXCLUDE_IPS = $(shell docker network inspect kind -f '{{range .Containers}},{{index (split .IPv4Address "/") 0}}{{end}}' | sed 's/^,//'))
$(eval IPV6_EXCLUDE_IPS = $(shell docker network inspect kind -f '{{range .Containers}},{{index (split .IPv6Address "/") 0}}{{end}}' | sed 's/^,//'))
@sed -e 's@^[[:space:]]*POD_CIDR=.*@POD_CIDR="$(IPV4_SUBNET),$(IPV6_SUBNET)"@' \
-e 's@^[[:space:]]*POD_GATEWAY=.*@POD_GATEWAY="$(IPV4_GATEWAY),$(IPV6_GATEWAY)"@' \
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(IPV4_EXCLUDE_IPS),$(IPV6_EXCLUDE_IPS)"@' \
-e 's@^VLAN_ID=.*@VLAN_ID="0"@' \
dist/images/install.sh > install-underlay.sh
@chmod +x install-underlay.sh
kind load docker-image --name kube-ovn $(REGISTRY)/kube-ovn:$(RELEASE_TAG)
kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule-
ENABLE_SSL=true DUAL_STACK=true ENABLE_VLAN=true VLAN_NIC=eth0 ./install-underlay.sh

.PHONY: kind-reload
kind-reload:
kind load docker-image --name kube-ovn $(REGISTRY)/kube-ovn:$(RELEASE_TAG)
Expand Down

0 comments on commit 9364d2a

Please sign in to comment.