From 9d1a5720c40662b495e4122ecc422fc354683274 Mon Sep 17 00:00:00 2001 From: Manjunath A Kumatagi Date: Mon, 13 Nov 2017 11:19:24 -0500 Subject: [PATCH] Fix e2e tests for non-amd64 archs --- .gitignore | 3 ++- Makefile | 23 +++++------------------ dist/functional-test-k8s.sh | 2 ++ dist/functional-test.sh | 4 ++++ 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 4c94a974f..fa2328576 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ dist/*.tar.gz dist/flanneld* dist/*.docker +dist/here.txt cover.out .editorconfig .idea/ bash_unit -dist/qemu-* \ No newline at end of file +dist/qemu-* diff --git a/Makefile b/Makefile index 09a7ae3d0..a40a6a4e8 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ GO_VERSION=1.8.3 # K8s version used for Makefile helpers K8S_VERSION=v1.6.6 +GOARM=7 + # These variables can be overridden by setting an environment variable. TEST_PACKAGES?=pkg/ip subnet subnet/etcdv2 network backend/hostgw TEST_PACKAGES_EXPANDED=$(TEST_PACKAGES:%=github.com/coreos/flannel/%) @@ -96,23 +98,11 @@ bash_unit: wget https://raw.githubusercontent.com/pgrange/bash_unit/v1.6.0/bash_unit chmod +x bash_unit -clean: - rm -f dist/flanneld* - rm -f dist/*.docker - rm -f dist/*.tar.gz - -## Create a docker image on disk for a specific arch and tag -dist/flanneld-$(TAG)-$(ARCH).docker: dist/flanneld-$(ARCH) dist/iptables-$(ARCH) - docker build -f Dockerfile.$(ARCH) -t $(REGISTRY):$(TAG)-$(ARCH) . - docker save -o dist/flanneld-$(TAG)-$(ARCH).docker $(REGISTRY):$(TAG)-$(ARCH) - -# amd64 gets an image with the suffix too (i.e. it's the default) -ifeq ($(ARCH),amd64) - docker build -f Dockerfile.$(ARCH) -t $(REGISTRY):$(TAG) . -endif - # This will build flannel natively using golang image dist/flanneld-e2e-$(TAG)-$(ARCH).docker: +ifneq ($(ARCH),amd64) + $(MAKE) dist/qemu-$(ARCH)-static +endif # valid values for ARCH are [amd64 arm arm64 ppc64le s390x] docker run -e GOARM=$(GOARM) \ -u $(shell id -u):$(shell id -g) \ @@ -124,9 +114,6 @@ dist/flanneld-e2e-$(TAG)-$(ARCH).docker: mv dist/flanneld dist/flanneld-$(ARCH)' docker build -f Dockerfile.$(ARCH) -t $(REGISTRY):$(TAG)-$(ARCH) . -docker-push: dist/flanneld-$(TAG)-$(ARCH).docker - docker push $(REGISTRY):$(TAG)-$(ARCH) - # Make a release after creating a tag # To build cross platform Docker images, the qemu-static binaries are needed. On ubuntu "apt-get install qemu-user-static" release: tar.gz dist/qemu-s390x-static dist/qemu-ppc64le-static dist/qemu-aarch64-static dist/qemu-arm-static #release-tests diff --git a/dist/functional-test-k8s.sh b/dist/functional-test-k8s.sh index 0ee7ebeee..977994a9b 100755 --- a/dist/functional-test-k8s.sh +++ b/dist/functional-test-k8s.sh @@ -107,11 +107,13 @@ test_vxlan() { pings } +if [[ ${ARCH} == "amd64" ]]; then test_udp() { start_flannel udp create_ping_dest # creates ping_dest1 and ping_dest2 variables pings } +fi test_host-gw() { start_flannel host-gw diff --git a/dist/functional-test.sh b/dist/functional-test.sh index eacbebfe7..50d6bd53a 100755 --- a/dist/functional-test.sh +++ b/dist/functional-test.sh @@ -84,11 +84,13 @@ test_vxlan_ping() { pings } +if [[ ${ARCH} == "amd64" ]]; then test_udp_ping() { write_config_etcd udp create_ping_dest # creates ping_dest1 and ping_dest2 variables pings } +fi test_host-gw_ping() { write_config_etcd host-gw @@ -115,11 +117,13 @@ test_vxlan_perf() { perf } +if [[ ${ARCH} == "amd64" ]]; then test_udp_perf() { write_config_etcd udp create_ping_dest perf } +fi perf() { # Perf test - run iperf server on flannel1 and client on flannel2