Commit Graph

1498 Commits

Author SHA1 Message Date
Frank Schroeder 375825f34c Do not recurse when the service address is a local cname
Fixes #2795
2017-06-01 18:20:31 +02:00
Frank Schroeder 9956bc9b47 agent: LastContact cannot be negative (#3067)
The X-Consul-LastContact header cannot be negative.

Fixes #3067
2017-06-01 18:20:12 +02:00
Frank Schroeder db15cd847a
test: replace one more BoolFalse with agent.Bool() 2017-05-31 11:41:17 +02:00
Frank Schroeder dcc68f0f85
test: we will not use dev mode for testing for now 2017-05-31 11:34:00 +02:00
Frank Schroeder f89ae9f7e7
test: stagger retry attempts of TestAgent.Start 2017-05-31 11:33:25 +02:00
Frank Schroeder bdfed817ee
test: make TestAgent setup reusable
Pick the random ports only once and try starting with them
a number of times so that the configuration can be re-used.
This is because the ports are written into the data files
and a subsequent agent reading the files needs to have the
same ports.

For the same reason we do not remove the data directory on
every attempt since this makes it impossible to re-read the
data files.
2017-05-31 11:32:31 +02:00
Frank Schroeder 4034d0ac0b
agent: use agent logger for consul client and deps 2017-05-31 11:05:02 +02:00
Frank Schroeder c1e6a77c75
test: start secondary agents also via TestAgent 2017-05-31 10:56:19 +02:00
Frank Schroeder a9451d596f
agent: set tcpKeepAliveListener when there is no error 2017-05-31 10:24:32 +02:00
Frank Schroeder 345666bdb6
test: use test name as log prefix 2017-05-31 09:54:09 +02:00
Frank Schroeder d6c7404b34
agent: simplify shutdown timeout logging
Note that we are currently timing out every time. This still
needs to be investigated.
2017-05-31 09:41:58 +02:00
Frank Schroeder 30ba712857
agent: set proto to http since we are logging it now 2017-05-31 09:41:16 +02:00
Frank Schroeder ceda18366f
test: Use Bool() instead of &BoolTrue/False since 2017-05-31 09:21:01 +02:00
Frank Schroeder ec729693d7
Address review comments 2017-05-31 01:05:21 +02:00
Frank Schroeder 26200929c1
agent: start HTTPS only if there is a cert and key 2017-05-31 00:29:29 +02:00
Frank Schroeder b6c69ebf5d
agent: refactor DNS and HTTP server
* refactor DNS server to be ready for multiple bind addresses
* drop tcpKeepAliveListener since it is default for the HTTP servers
* add startup timeout watcher for HTTP servers identical to DNS server
2017-05-31 00:29:29 +02:00
Frank Schroeder aa92adcdd5
test: increase sleep time for test 2017-05-31 00:29:28 +02:00
Frank Schroeder f498f24032
test: allow tests to control anti-entropy syncs 2017-05-31 00:29:28 +02:00
Frank Schroeder eea16e1640
test: run mock dns recursors on random ports 2017-05-31 00:29:28 +02:00
Frank Schroeder 6148910399
test: skip tests that use cmd.Run until signal handling is fixed 2017-05-31 00:29:28 +02:00
Frank Schroeder 56cf015117
test: add test for starting/stopping lots of agents 2017-05-31 00:29:28 +02:00
Frank Schroeder 7c5892a196
test: use UniqueID prefix for check tests to unify log output 2017-05-31 00:29:28 +02:00
Frank Schroeder 0a31094e06
test: improve TestAgent
* don't use retry to try restarting the agent
  this caused some issues when the startup would fail in
  a separate go routine

* clear out the data directory on every retry since the ports
  are stored in the raft data files

* set a unique id for every agent to allow for tracking of
  concurrent output
2017-05-31 00:29:28 +02:00
Frank Schroeder 10540f8d5f
agent: fix logging
* use agent logger for consul/serf/raft/dns/agent/...
* support optional id for concurrent tests
2017-05-31 00:29:27 +02:00
Frank Schroeder fe777852cd
test: call t.Fatal() from main go routine 2017-05-31 00:29:27 +02:00
Frank Schroeder 3e39f04527
dns: do not log socket close during shutdown 2017-05-31 00:29:27 +02:00
Frank Schroeder 1df74e36bd
agent: print more useful shutdown message 2017-05-31 00:29:27 +02:00
Frank Schroeder 2e14c09447
test: start sync after agent start 2017-05-31 00:29:27 +02:00
Frank Schroeder 5b5566d916
test: add test name to output 2017-05-31 00:29:27 +02:00
Frank Schroeder 28ed8f1847
test: perform blocking query on agent 2017-05-31 00:29:27 +02:00
Frank Schroeder ebc0c80f08
test: parallelize dns test 2017-05-31 00:29:26 +02:00
Frank Schroeder 72c214b908
test: fix failing test 2017-05-31 00:29:26 +02:00
Frank Schroeder c5f565ee1a
test: remove output to stdout 2017-05-31 00:29:26 +02:00
Frank Schroeder 8f943542b0
test: use cli.NewMockUi instead of new(cli.MockUi)
Use the constructor function to prevent a nil panic
if there was no write to the output buffers.
2017-05-31 00:29:26 +02:00
Frank Schroeder 0325a42089
test: fix data race with endpoints 2017-05-31 00:29:26 +02:00
Frank Schroeder e16589c079
agent: shutdown delegate if created
When the TestAgent shuts down a half-started agent
the delegate may not have been created at this point.
2017-05-31 00:29:26 +02:00
Frank Schroeder 632f837c98
agent: shutdown dns servers on error 2017-05-31 00:29:26 +02:00
Frank Schroeder 8c1a668481
test: Shutdown half-started agent before retrying 2017-05-31 00:29:25 +02:00
Frank Schroeder 584693482d
test: fix data race in MockNotify
42 -> 32 data races
2017-05-31 00:29:25 +02:00
Frank Schroeder 9509ab463c
test: run command tests in parallel 2017-05-31 00:29:25 +02:00
Frank Schroeder 3658d4d428
test: address pull request comments 2017-05-31 00:29:25 +02:00
Frank Schroeder 0f912c8aad
test: remove ACL options from default test config 2017-05-31 00:29:25 +02:00
Frank Schroeder bc47972696
test: allocate ports in blocks of 10 2017-05-31 00:29:24 +02:00
Frank Schroeder 53c1c86ab3
test: refactor command tests to use TestAgent 2017-05-31 00:29:24 +02:00
Frank Schroeder 24eec373de
test: retry a bit more often 2017-05-31 00:29:24 +02:00
Frank Schroeder 659d7dbbde
agent: rename *Config vars to 'cfg' 2017-05-31 00:29:24 +02:00
Frank Schroeder e86d34685f
agent: rename *Command vars to 'cmd'
'c' is ambigious and it conflicts with 'config'.
2017-05-31 00:29:24 +02:00
Frank Schroeder 141efd9588
test: rename *Config vars to 'cfg'
'c' is ambigous since Command also uses this
and we want to use 'config' as a package name.
2017-05-31 00:29:24 +02:00
Frank Schroeder 06677708cf
test: use less aggressive retry for agent startup 2017-05-31 00:29:24 +02:00
Frank Schroeder 47501309ae
test: use system temp dir for TestAgent 2017-05-31 00:29:24 +02:00