Remove manual etcd usage. No longer needed.
This commit is contained in:
@@ -32,19 +32,6 @@ if [ $travis -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build etcd
|
|
||||||
git clone --recursive https://github.com/coreos/etcd/ && cd etcd
|
|
||||||
goversion=$(go version)
|
|
||||||
# if 'go version' contains string 'devel', then use git master of etcd...
|
|
||||||
if [ "${goversion#*devel}" == "$goversion" ]; then
|
|
||||||
git checkout v2.2.4 # TODO: update to newer versions as needed
|
|
||||||
fi
|
|
||||||
[ -x build ] && ./build
|
|
||||||
mkdir -p ~/bin/
|
|
||||||
cp bin/etcd ~/bin/
|
|
||||||
cd - >/dev/null
|
|
||||||
rm -rf etcd # clean up to avoid failing on upstream gofmt errors
|
|
||||||
|
|
||||||
go get ./... # get all the go dependencies
|
go get ./... # get all the go dependencies
|
||||||
[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X
|
[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X
|
||||||
# vet is built-in in go 1.6 - we check for go vet command
|
# vet is built-in in go 1.6 - we check for go vet command
|
||||||
|
|||||||
@@ -27,12 +27,11 @@
|
|||||||
:ansible_extras: {}
|
:ansible_extras: {}
|
||||||
:cachier: false
|
:cachier: false
|
||||||
:vms:
|
:vms:
|
||||||
- :name: etcd
|
- :name: mgmt0
|
||||||
:shell:
|
:shell:
|
||||||
- iptables -F
|
- iptables -F
|
||||||
- cd /vagrant/mgmt/ && make path
|
- cd /vagrant/mgmt/ && make path
|
||||||
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
||||||
- etcd -bind-addr "`hostname --ip-address`:2379" &
|
|
||||||
- cd && mgmt --help
|
- cd && mgmt --help
|
||||||
:namespace: omv
|
:namespace: omv
|
||||||
:count: 0
|
:count: 0
|
||||||
@@ -45,8 +44,7 @@
|
|||||||
:unsafe: false
|
:unsafe: false
|
||||||
:nested: false
|
:nested: false
|
||||||
:tests:
|
:tests:
|
||||||
- omv up etcd
|
- omv up mgmt0
|
||||||
- vssh root@etcd -c pidof etcd
|
|
||||||
- omv destroy
|
- omv destroy
|
||||||
:comment: simple hello world test case for mgmt
|
:comment: simple hello world test case for mgmt
|
||||||
:reallyrm: false
|
:reallyrm: false
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
- iptables -F
|
- iptables -F
|
||||||
- cd /vagrant/mgmt/ && make path
|
- cd /vagrant/mgmt/ && make path
|
||||||
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
||||||
- etcd -bind-addr "`hostname --ip-address`:2379" &
|
|
||||||
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
|
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
|
||||||
:namespace: omv
|
:namespace: omv
|
||||||
:count: 0
|
:count: 0
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
- iptables -F
|
- iptables -F
|
||||||
- cd /vagrant/mgmt/ && make path
|
- cd /vagrant/mgmt/ && make path
|
||||||
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
- cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/
|
||||||
- etcd -bind-addr "`hostname --ip-address`:2379" &
|
|
||||||
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
|
- cd && mgmt run --file /vagrant/mgmt/examples/pkg1.yaml --converged-timeout=5
|
||||||
:namespace: omv
|
:namespace: omv
|
||||||
:count: 0
|
:count: 0
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# NOTE: boiler plate to run etcd; source with: . etcd.sh; should NOT be +x
|
|
||||||
cleanup ()
|
|
||||||
{
|
|
||||||
echo "cleanup: $1"
|
|
||||||
killall etcd || killall -9 etcd || true # kill etcd
|
|
||||||
rm -rf /tmp/etcd/
|
|
||||||
}
|
|
||||||
|
|
||||||
trap_with_arg() {
|
|
||||||
func="$1"
|
|
||||||
shift
|
|
||||||
for sig in "$@"
|
|
||||||
do
|
|
||||||
trap "$func $sig" "$sig"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
trap_with_arg cleanup INT QUIT TERM EXIT # ERR
|
|
||||||
mkdir -p /tmp/etcd/
|
|
||||||
cd /tmp/etcd/ >/dev/null # shush the cd operation
|
|
||||||
etcd & # start etcd as job # 1
|
|
||||||
sleep 1s # let etcd startup
|
|
||||||
cd - >/dev/null
|
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
# * it is recommended that you run mgmt with --no-watch
|
# * it is recommended that you run mgmt with --no-watch
|
||||||
# * it is recommended that you run mgmt --converged-timeout=<seconds>
|
# * it is recommended that you run mgmt --converged-timeout=<seconds>
|
||||||
# * you can run mgmt with --max-runtime=<seconds> in special scenarios
|
# * you can run mgmt with --max-runtime=<seconds> in special scenarios
|
||||||
# * you can get a separate etcd going by sourcing etcd.sh: . etcd.sh
|
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ if env | grep -q -e '^TRAVIS=true$'; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. etcd.sh # start etcd as job # 1
|
|
||||||
|
|
||||||
# run till completion
|
# run till completion
|
||||||
timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=15s 10s ./mgmt run --file t2.yaml --converged-timeout=5 --no-watch &
|
||||||
|
|
||||||
. wait.sh # wait for everything except etcd
|
. wait.sh # wait for mgmt
|
||||||
|
|
||||||
test -e /tmp/mgmt/f1
|
test -e /tmp/mgmt/f1
|
||||||
test -e /tmp/mgmt/f2
|
test -e /tmp/mgmt/f2
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. etcd.sh # start etcd as job # 1
|
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
mkdir -p "${MGMT_TMPDIR}"mgmt{A..C}
|
mkdir -p "${MGMT_TMPDIR}"mgmt{A..C}
|
||||||
|
|
||||||
@@ -16,7 +14,7 @@ timeout --kill-after=15s 10s ./mgmt run --file t3-a.yaml --converged-timeout=5 -
|
|||||||
timeout --kill-after=15s 10s ./mgmt run --file t3-b.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=15s 10s ./mgmt run --file t3-b.yaml --converged-timeout=5 --no-watch &
|
||||||
timeout --kill-after=15s 10s ./mgmt run --file t3-c.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=15s 10s ./mgmt run --file t3-c.yaml --converged-timeout=5 --no-watch &
|
||||||
|
|
||||||
. wait.sh # wait for everything except etcd
|
. wait.sh # wait for mgmt
|
||||||
|
|
||||||
# A: collected
|
# A: collected
|
||||||
test -e "${MGMT_TMPDIR}"mgmtA/f3b
|
test -e "${MGMT_TMPDIR}"mgmtA/f3b
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
. etcd.sh # start etcd as job # 1
|
|
||||||
|
|
||||||
# should take slightly more than 25s, but fail if we take 35s)
|
# should take slightly more than 25s, but fail if we take 35s)
|
||||||
timeout --kill-after=35s 30s ./mgmt run --file t4.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=35s 30s ./mgmt run --file t4.yaml --converged-timeout=5 --no-watch &
|
||||||
|
|
||||||
#jobs # etcd is 1
|
. wait.sh # wait for mgmt
|
||||||
#wait -n 2 # wait for mgmt to exit
|
|
||||||
. wait.sh # wait for everything except etcd
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
. etcd.sh # start etcd as job # 1
|
|
||||||
|
|
||||||
# should take slightly more than 35s, but fail if we take 45s)
|
# should take slightly more than 35s, but fail if we take 45s)
|
||||||
timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch &
|
timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch &
|
||||||
|
|
||||||
#jobs # etcd is 1
|
. wait.sh # wait for mgmt
|
||||||
#wait -n 2 # wait for mgmt to exit
|
|
||||||
. wait.sh # wait for everything except etcd
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. etcd.sh # start etcd as job # 1
|
|
||||||
|
|
||||||
# run till completion
|
# run till completion
|
||||||
timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch &
|
timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch &
|
||||||
sleep 1s # let it converge
|
sleep 1s # let it converge
|
||||||
@@ -30,4 +28,4 @@ test -e /tmp/mgmt/f2
|
|||||||
|
|
||||||
killall -SIGINT mgmt # send ^C to exit mgmt
|
killall -SIGINT mgmt # send ^C to exit mgmt
|
||||||
|
|
||||||
. wait.sh # wait for everything except etcd
|
. wait.sh # wait for mgmt
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
# NOTE: boiler plate to wait on mgmt; source with: . wait.sh; should NOT be +x
|
# NOTE: boiler plate to wait on mgmt; source with: . wait.sh; should NOT be +x
|
||||||
while test "`jobs -p`" != "" && test "`jobs -p`" != "`pidof etcd`"
|
while test "`jobs -p`" != ""
|
||||||
do
|
do
|
||||||
for j in `jobs -p`
|
for j in `jobs -p`
|
||||||
do
|
do
|
||||||
[ "$j" = "`pidof etcd`" ] && continue # don't wait for etcd
|
|
||||||
wait $j || continue # wait for mgmt job $j
|
wait $j || continue # wait for mgmt job $j
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user