Skip to content

Commit

Permalink
Merge pull request #876 from mkumatag/fix_e2e
Browse files Browse the repository at this point in the history
Fix e2e tests for non-amd64 archs
  • Loading branch information
tomdee committed Nov 16, 2017
2 parents 1e0f20e + 9d1a572 commit a61dbb4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
dist/*.tar.gz
dist/flanneld*
dist/*.docker
dist/here.txt
cover.out
.editorconfig
.idea/
bash_unit
dist/qemu-*
dist/qemu-*
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/%)
Expand Down Expand Up @@ -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) \
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions dist/functional-test-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions dist/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a61dbb4

Please sign in to comment.