Quellcode durchsuchen

Fix e2e tests for non-amd64 archs

Manjunath A Kumatagi vor 7 Jahren
Ursprung
Commit
9d1a5720c4
4 geänderte Dateien mit 13 neuen und 19 gelöschten Zeilen
  1. 2 1
      .gitignore
  2. 5 18
      Makefile
  3. 2 0
      dist/functional-test-k8s.sh
  4. 4 0
      dist/functional-test.sh

+ 2 - 1
.gitignore

@@ -1,8 +1,9 @@
 dist/*.tar.gz
 dist/flanneld*
 dist/*.docker
+dist/here.txt
 cover.out
 .editorconfig
 .idea/
 bash_unit
-dist/qemu-*
+dist/qemu-*

+ 5 - 18
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

+ 2 - 0
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

+ 4 - 0
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