Skip to content

Commit

Permalink
add integration tests for etcdv3; update etcdv2 integration's port
Browse files Browse the repository at this point in the history
  • Loading branch information
crandles committed Jul 28, 2016
1 parent dbab44a commit cd5c771
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ before_install:
- sudo mv consul /bin/
- consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul &
# install etcd
- wget https://github.com/coreos/etcd/releases/download/v2.2.5/etcd-v2.2.5-linux-amd64.tar.gz
- tar xzf etcd-v2.2.5-linux-amd64.tar.gz
- sudo mv etcd-v2.2.5-linux-amd64/etcd /bin/
- wget https://github.com/coreos/etcd/releases/download/v3.0.4/etcd-v3.0.4-linux-amd64.tar.gz
- tar xzf etcd-v3.0.4-linux-amd64.tar.gz
- sudo mv etcd-v3.0.4-linux-amd64/etcd /bin/
- sudo mv etcd-v3.0.4-linux-amd64/etcdctl /bin/
- etcd &
# install DynamoDB
- mkdir /tmp/dynamodb
Expand Down Expand Up @@ -45,6 +46,7 @@ script:
- ./test
- bash integration/consul/test.sh
- bash integration/etcd/test.sh
- bash integration/etcdv3/test.sh
- bash integration/redis/test.sh
- bash integration/rancher/test.sh
- bash integration/vault/test.sh
Expand Down
28 changes: 14 additions & 14 deletions integration/etcd/test.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

curl -L -X PUT http://127.0.0.1:4001/v2/keys/key -d value=foobar
curl -L -X PUT http://127.0.0.1:4001/v2/keys/database/host -d value=127.0.0.1
curl -L -X PUT http://127.0.0.1:4001/v2/keys/database/password -d value=p@sSw0rd
curl -L -X PUT http://127.0.0.1:4001/v2/keys/database/port -d value=3306
curl -L -X PUT http://127.0.0.1:4001/v2/keys/database/username -d value=confd
curl -L -X PUT http://127.0.0.1:4001/v2/keys/upstream/app1 -d value=10.0.1.10:8080
curl -L -X PUT http://127.0.0.1:4001/v2/keys/upstream/app2 -d value=10.0.1.11:8080
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/database/host -d value=127.0.0.1
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/database/password -d value=p@sSw0rd
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/database/port -d value=3306
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/database/username -d value=confd
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/upstream/app1 -d value=10.0.1.10:8080
curl -L -X PUT http://127.0.0.1:4001/v2/keys/prefix/upstream/app2 -d value=10.0.1.11:8080
curl -L -X PUT http://127.0.0.1:2379/v2/keys/key -d value=foobar
curl -L -X PUT http://127.0.0.1:2379/v2/keys/database/host -d value=127.0.0.1
curl -L -X PUT http://127.0.0.1:2379/v2/keys/database/password -d value=p@sSw0rd
curl -L -X PUT http://127.0.0.1:2379/v2/keys/database/port -d value=3306
curl -L -X PUT http://127.0.0.1:2379/v2/keys/database/username -d value=confd
curl -L -X PUT http://127.0.0.1:2379/v2/keys/upstream/app1 -d value=10.0.1.10:8080
curl -L -X PUT http://127.0.0.1:2379/v2/keys/upstream/app2 -d value=10.0.1.11:8080
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/database/host -d value=127.0.0.1
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/database/password -d value=p@sSw0rd
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/database/port -d value=3306
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/database/username -d value=confd
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/upstream/app1 -d value=10.0.1.10:8080
curl -L -X PUT http://127.0.0.1:2379/v2/keys/prefix/upstream/app2 -d value=10.0.1.11:8080


# Run confd
confd --onetime --log-level debug --confdir ./integration/confdir --backend etcd --node http://127.0.0.1:4001 --watch
confd --onetime --log-level debug --confdir ./integration/confdir --backend etcd --node http://127.0.0.1:2379 --watch
19 changes: 19 additions & 0 deletions integration/etcdv3/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

ETCDCTL_API=3 etcdctl put /key foobar
ETCDCTL_API=3 etcdctl put /database/host 127.0.0.1
ETCDCTL_API=3 etcdctl put /database/password p@sSw0rd
ETCDCTL_API=3 etcdctl put /database/port 3306
ETCDCTL_API=3 etcdctl put /database/username confd
ETCDCTL_API=3 etcdctl put /upstream/app1 10.0.1.10:8080
ETCDCTL_API=3 etcdctl put /upstream/app2 10.0.1.11:8080
ETCDCTL_API=3 etcdctl put /prefix/database/host 127.0.0.1
ETCDCTL_API=3 etcdctl put /prefix/database/password p@sSw0rd
ETCDCTL_API=3 etcdctl put /prefix/database/port 3306
ETCDCTL_API=3 etcdctl put /prefix/database/username confd
ETCDCTL_API=3 etcdctl put /prefix/upstream/app1 10.0.1.10:8080
ETCDCTL_API=3 etcdctl put /prefix/upstream/app2 10.0.1.11:8080


# Run confd
confd --onetime --log-level debug --confdir ./integration/confdir --backend etcdv3 --node http://127.0.0.1:2379 --watch

0 comments on commit cd5c771

Please sign in to comment.