#!/bin/bash export DH_VERBOSE=1 export ETCD_TEST_NO_LEAK_DETECTION=1 set -ex # ensure no other etcd server is running invoke-rc.d etcd stop || true pkill -9 etcd || true DH_GOLANG_INSTALL_EXTRA="$(find . -name fixtures-expired) $(find . -name fixtures) $(find . -name go.mod) etcd.conf.yml.sample" \ dh_auto_configure -O--buildsystem=golang -O--builddirectory=_build BINDIR=_build/src/go.etcd.io/etcd/bin mkdir -p $BINDIR ln -sf /usr/bin/etcdctl $BINDIR/etcdctl ln -sf /usr/bin/etcdutl $BINDIR/etcdutl ln -sf /usr/bin/etcd $BINDIR/etcd # Following doesn't work, since it expects the two have same major.minor version. # download old etcd-server for upgrading tests. # the tests are skipped if no etcd-last-release binary. # see tests/e2e/etcd_release_upgrade_test.go # apt-get download etcd-server/"$(lsb_release -sc)" || true # dpkg-deb --fsys-tarfile etcd-server_*.deb | tar -x --transform='s|.*|etcd-last-release|g' \ # -C $BINDIR ./usr/bin/etcd || true # patch out potential port conflicts sed -i 's,localhost:2380,localhost:5380,g; s,localhost:2379,localhost:5378,g;' \ _build/src/go.etcd.io/etcd/etcd.conf.yml.sample mkdir --mode=700 -v "_build/src/go.etcd.io/etcd/tests/e2e/default.etcd" mkdir -vp "_build/src/go.etcd.io/etcd/tests/e2e/default.etcd/member/wal" test=$(basename $0) # the -short option is unfortunate, and placed to avoid the leak detector # which seems to trigger frequently. # TODO: investigate whether this is caused by bad tests or bad code. INTEGRATION_TEST=(tests/$test/...) DH_GOLANG_BUILDPKG="${INTEGRATION_TEST[*]/#/go.etcd.io/etcd/}" \ dh_auto_test -O--buildsystem=golang -O--builddirectory=_build -- -run=Test -timeout=30m -short