diff --git a/misc/make-deps.sh b/misc/make-deps.sh index 6815ed41..69bd01e6 100755 --- a/misc/make-deps.sh +++ b/misc/make-deps.sh @@ -32,19 +32,6 @@ if [ $travis -eq 0 ]; then 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 [ -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 diff --git a/test/omv/helloworld.yaml b/test/omv/helloworld.yaml index bbfb1d3d..49126de7 100644 --- a/test/omv/helloworld.yaml +++ b/test/omv/helloworld.yaml @@ -27,12 +27,11 @@ :ansible_extras: {} :cachier: false :vms: -- :name: etcd +- :name: mgmt0 :shell: - iptables -F - cd /vagrant/mgmt/ && make path - cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/ - - etcd -bind-addr "`hostname --ip-address`:2379" & - cd && mgmt --help :namespace: omv :count: 0 @@ -45,8 +44,7 @@ :unsafe: false :nested: false :tests: -- omv up etcd -- vssh root@etcd -c pidof etcd +- omv up mgmt0 - omv destroy :comment: simple hello world test case for mgmt :reallyrm: false diff --git a/test/omv/pkg1a.yaml b/test/omv/pkg1a.yaml index 17d739ce..30445ad7 100644 --- a/test/omv/pkg1a.yaml +++ b/test/omv/pkg1a.yaml @@ -32,7 +32,6 @@ - iptables -F - cd /vagrant/mgmt/ && make path - 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 :namespace: omv :count: 0 diff --git a/test/omv/pkg1b.yaml b/test/omv/pkg1b.yaml index 7c886c79..6fe595d7 100644 --- a/test/omv/pkg1b.yaml +++ b/test/omv/pkg1b.yaml @@ -33,7 +33,6 @@ - iptables -F - cd /vagrant/mgmt/ && make path - 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 :namespace: omv :count: 0 diff --git a/test/shell/etcd.sh b/test/shell/etcd.sh deleted file mode 100644 index de55e29c..00000000 --- a/test/shell/etcd.sh +++ /dev/null @@ -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 diff --git a/test/shell/t1.sh b/test/shell/t1.sh index 34e5376f..bffe2e72 100755 --- a/test/shell/t1.sh +++ b/test/shell/t1.sh @@ -5,7 +5,6 @@ # * it is recommended that you run mgmt with --no-watch # * it is recommended that you run mgmt --converged-timeout= # * you can run mgmt with --max-runtime= in special scenarios -# * you can get a separate etcd going by sourcing etcd.sh: . etcd.sh set -o errexit set -o nounset diff --git a/test/shell/t2.sh b/test/shell/t2.sh index 19c4ef27..a17c6f41 100755 --- a/test/shell/t2.sh +++ b/test/shell/t2.sh @@ -6,12 +6,10 @@ if env | grep -q -e '^TRAVIS=true$'; then exit fi -. etcd.sh # start etcd as job # 1 - # run till completion 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/f2 diff --git a/test/shell/t3.sh b/test/shell/t3.sh index 6e524236..d71ea270 100755 --- a/test/shell/t3.sh +++ b/test/shell/t3.sh @@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then exit fi -. etcd.sh # start etcd as job # 1 - # setup 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-c.yaml --converged-timeout=5 --no-watch & -. wait.sh # wait for everything except etcd +. wait.sh # wait for mgmt # A: collected test -e "${MGMT_TMPDIR}"mgmtA/f3b diff --git a/test/shell/t4.sh b/test/shell/t4.sh index 302a51ad..34231c24 100755 --- a/test/shell/t4.sh +++ b/test/shell/t4.sh @@ -1,10 +1,6 @@ #!/bin/bash -e -. etcd.sh # start etcd as job # 1 - # 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 & -#jobs # etcd is 1 -#wait -n 2 # wait for mgmt to exit -. wait.sh # wait for everything except etcd +. wait.sh # wait for mgmt diff --git a/test/shell/t5.sh b/test/shell/t5.sh index 57399d13..a3a8d656 100755 --- a/test/shell/t5.sh +++ b/test/shell/t5.sh @@ -1,10 +1,6 @@ #!/bin/bash -e -. etcd.sh # start etcd as job # 1 - # 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 & -#jobs # etcd is 1 -#wait -n 2 # wait for mgmt to exit -. wait.sh # wait for everything except etcd +. wait.sh # wait for mgmt diff --git a/test/shell/t6.sh b/test/shell/t6.sh index 779beee1..64e7674c 100755 --- a/test/shell/t6.sh +++ b/test/shell/t6.sh @@ -6,8 +6,6 @@ if env | grep -q -e '^TRAVIS=true$'; then exit fi -. etcd.sh # start etcd as job # 1 - # run till completion timeout --kill-after=20s 15s ./mgmt run --file t6.yaml --no-watch & sleep 1s # let it converge @@ -30,4 +28,4 @@ test -e /tmp/mgmt/f2 killall -SIGINT mgmt # send ^C to exit mgmt -. wait.sh # wait for everything except etcd +. wait.sh # wait for mgmt diff --git a/test/shell/wait.sh b/test/shell/wait.sh index fa47d76c..86aab21d 100644 --- a/test/shell/wait.sh +++ b/test/shell/wait.sh @@ -1,9 +1,8 @@ # 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 for j in `jobs -p` do - [ "$j" = "`pidof etcd`" ] && continue # don't wait for etcd wait $j || continue # wait for mgmt job $j done done