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