157 Commits

Author SHA1 Message Date
Yicheng Qin
69adb78433 fix(transporter): CancelRequest doesn't work on HTTPS connections blocked
Currently this is a workaround. And it should be fixed in Go1.3.
2014-02-27 14:31:46 -08:00
Yicheng Qin
e99bc99dcc fix(tests/multi_node_kill_all_and_recovery): wait for cluter to build over 2014-02-27 14:31:46 -08:00
Ben Johnson
fddbf35df2 Add automatic node promotion / demotion. 2014-02-25 10:02:01 -07:00
Ben Johnson
f5698d3566 Proxy promotion. 2014-02-24 17:01:04 -07:00
Ben Johnson
1d961b8e56 Add proxy mode. 2014-02-22 15:02:20 -07:00
Yicheng Qin
04f21b5976 Merge pull request #569 from unihorn/5
Ordering and functionality of `-discovery` `-peers` and data dir to find peers
2014-02-17 14:34:53 -08:00
Yicheng Qin
3a4df1612c feat(discovery): adjust boot order to find peers
The boot order for peers is -discovery, -peers, log data, forming
new cluster itself.

Special rules:
1. If discovery succeeds, it would find peers specified by discover URL
only.
2. Etcd would fail when meeting bad -discovery, no -peers and log data.

Add TestDiscoveryDownNoBackupPeersWithDataDir as the test.
2014-02-17 12:53:39 -08:00
Yicheng Qin
bd56b15b6e fix(tests/discovery): use host as -peers parameter instead of url
Or it cannot test the functionality correctly.
Moreover, add TestDiscoveryNoWithBackupPeers as the test for it.
2014-02-14 18:23:41 -08:00
Brandon Philips
a72f913a60 fix(tests/functional): some squashing mistakes in PR merge
accidental squash mistake in the last PR that was merged caused a
function to be renamed but not it's caller.
2014-02-14 18:17:30 -08:00
Yicheng Qin
efdc741e5c feat(tests/util): wait until server is up when creating cluster
Wait until server is up instead of for some time
2014-02-14 18:06:43 -08:00
Yicheng Qin
e69118ade7 chore(tests/multi_node_kill_one): check function-call result
To stop test in time if error occurs
2014-02-14 17:36:11 -08:00
Yicheng Qin
7ad2dadabf chore(test): remove useless node1.etcd dir
It is a directory checked in from an etcd test run in mistake.
2014-02-13 08:52:16 -08:00
Brandon Philips
21d7d14178 chore(tests/discovery): remove errant debug statement 2014-02-06 22:10:10 -08:00
Brandon Philips
bfbc539321 hack(tests/discovery): don't use go-etcd for watch
go-etcd has a bug in the watcher that holds open a goroutine. Avoid
goetcd for this operation until it is fixed.
2014-02-06 22:10:10 -08:00
Brandon Philips
5f124166eb feat(tests/discovery): use low retry interval
In TestDiscoverySecondPeerFirstNoResponse use a low retryinterval so the
test doesn't take forever.
2014-02-06 22:10:10 -08:00
Brandon Philips
da3fe920cb fix(tests/v1_migration): add a -name flag
The info flag is ignored as of 1c91c167fc98608ef850a7539550bfc15dedbb46
so in order for this test to work we need to add `-name` flag.
2014-02-06 21:23:00 -08:00
Brian Waldon
63fa35c99f refactor(tls): clarify & simplify tls configuration 2014-02-06 21:15:38 -08:00
Brandon Philips
cbdf4a738c fix(discovery): use prevExist instead of prevValue=init
Use PUT /_state?prevExist=true in the protocol instead of PUT
/_state?prevValue=init. This lets people point one vanilla etcd at the
key prefix of another vanilla etcd and have it just work.
2014-02-05 15:14:57 -08:00
Brandon Philips
2822b9c579 tests(tests/functional): add tests for Discovery
This tests a variety of failure cases for the Discovery service
including:

- Initial leader failures
- Discovery service failures
- Positive tests for discovery working flawlessly
2014-02-05 09:27:39 -08:00
Brandon Philips
72b393ca53 Merge pull request #519 from philips/fixup-server-tls-client-config
fix(server): fix client certificate verification
2014-02-03 17:33:45 -08:00
Brian Waldon
226c20c097 test(TLS): Add test coverage for etcd TLS 2014-02-03 17:32:24 -08:00
Brandon Philips
d7d20d1c3d bump(github.com/stretchr/testify): 9cc77fa25329013ce07362c7742952ff887361f2 2014-02-02 16:57:36 -08:00
Brandon Philips
13b6c1e684 chore(*): make everything use goven
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven  -copy -rewrite $i; done
2014-02-01 23:44:18 -08:00
Brandon Philips
ea8a353545 chore(*): gofmt everything 2014-02-01 23:44:10 -08:00
Xiang Li
715b4d7bfc Merge pull request #408 from xiangli-cmu/compareAndDelete
Compare and delete
2013-12-25 13:16:27 -08:00
Chris Shoemaker
d89fa131ab feat(v2/errors): Use more appropriate HTTP status codes for error cases.
This commits adds test coverage for all the error and non-error cases
described below, but only the behavior of the 403, 404 and 412 cases
are changing in this commit.

When setting a key results in a new resource, we asset an HTTP status
code of 201 (aka "Created").

When attempting to get a resource that doesn't exist, we assert an
HTTP status code of 404 (aka "Not Found").

When attempting to delete a directory without dir=true, or a non-empty
directory without recursive=true, but the request is otherwise valid,
we assert an HTTP status code of 403 (aka "Forbidden").

When a precondition (e.g. specified by prevIndex, or prevValue) is not
met, but the request is otherwise syntactically valid, we assert an
HTTP status code of 412 (aka "Precondition Failed").  However,
prevExist is handled slightly differently.  If prevExist=false fails,
then this is treated like a failed precondition, so it should use
PreconditionFailed.  But, if prevExist=true fails, then this is
treated like other requests that require the existence of the
resource, and uses NotFound if the resource doesn't exist.

We continue to assert an HTTP status code of 400 when the request is
syntactically invalid (e.g. when prevIndex=bad_index).
2013-12-21 21:39:19 -05:00
Xiang Li
c4179829d6 tests(get_handler) loosen the time assumption for the un 2013-12-20 08:23:50 +08:00
Xiang Li
dd354c9e22 Merge pull request #376 from xiangli-cmu/dir_flag
feat add dir_flag
2013-12-09 08:34:57 -08:00
Brian Waldon
0fb8fc0b8d fix(v2): Drop prevValue from exported fields 2013-12-06 11:46:23 -08:00
Xiang Li
e00296960c test fix tests 2013-12-05 18:16:01 -05:00
Xiang Li
fc562bd625 fix tests bump deps 2013-12-01 17:24:30 -05:00
Xiang Li
a607c9eace fix dep issue 2013-11-22 13:27:04 -08:00
Xiang Li
40a574a8ca wip commit 2013-11-22 11:32:24 -08:00
Ben Johnson
15eee885d7 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config 2013-11-19 10:13:39 -07:00
Ben Johnson
8952c1bd42 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config
Conflicts:
	etcd.go
2013-11-19 08:28:46 -07:00
Ben Johnson
cba2611c68 Renamed configuration parameters. 2013-11-15 00:13:32 -05:00
Xiang Li
4f45de6953 test fix wrong assumption should be previous index + 501 + 6 2013-11-14 20:22:25 -08:00
Xiang Li
e90937a2b4 tests loosen the ttl checking 2013-11-14 20:09:12 -08:00
Ben Johnson
954217fb73 Fix v1 cluster migration test. 2013-11-12 19:27:29 -05:00
Ben Johnson
ccc27a61f5 Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-12 17:29:58 -05:00
Xiang Li
5abbaf59e3 Merge pull request #292 from xiangli-cmu/fix-ttl
WIP: fix ttl
2013-11-11 21:30:32 -08:00
Ben Johnson
d8157472fe Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-11 18:12:24 -05:00
Xiang Li
e427c85f03 refactor add debug info to remove_node test 2013-11-09 21:31:17 -08:00
Xiang Li
27157e5e78 fix tests 2013-11-09 21:17:32 -08:00
Brandon Philips
6a074d4f6f chore(*.go): add copyright notice 2013-11-08 14:04:15 -08:00
Ben Johnson
8c6606ed12 Fix TTL migration issue. 2013-11-05 15:57:53 -07:00
Ben Johnson
d3bfc49b7c Remove leading slash from handlers. 2013-11-04 14:36:20 -07:00
Ben Johnson
6b5d6ecd8b Cluster migration test. 2013-11-04 13:46:43 -07:00
Ben Johnson
bf76af8fd1 Update migration. 2013-11-04 13:16:45 -07:00
Xiang Li
235ffc234d refactor change cmd argument snapCount to snapshotCount 2013-11-03 21:06:51 -08:00