Commit Graph

5634 Commits

Author SHA1 Message Date
Frank Schroeder 7732347172
test: simplify tests that check for peers 2017-05-05 17:07:04 +02:00
Frank Schroeder 2794db5aac
test: Fix badly formatted retry.Run tests 2017-05-05 17:07:03 +02:00
Frank Schroeder c3d6814149
test: Drop WaitForResult from testutil and testrpc 2017-05-05 17:07:03 +02:00
Frank Schroeder 9c86d5c764
test: convert remaining WaitForResult tests 2017-05-05 17:07:03 +02:00
James Phillips ddfa57765c
retry: Removes the description parameter. 2017-05-05 17:07:03 +02:00
James Phillips 55cf5e1ba0
test: Tweaks ACL replication tests to converge faster w/less spam. 2017-05-05 17:07:03 +02:00
James Phillips 2de1cd5a4a
test: Turns off ACLs for catalog and health WAN translation tests.
Since this was doing registration to a foreign DC, it needs extra time
for the route to the ACL datacenter to be set up. ACLs aren't part of
this test, so by disabling them we make this more reliable and converge
faster than if we had added a retry.
2017-05-05 17:07:03 +02:00
James Phillips 888fa5cad6
test: Moves a variable closer to where it's used. 2017-05-05 17:07:03 +02:00
James Phillips 0daacfe5e5
test: Turns down server health interval for faster convergence.
This fixes the autopilot tests.
2017-05-05 17:07:02 +02:00
Frank Schroeder 21a82a0a16
test: Refactor WaitForResult tests with retry
Refactor tests that use testutil.WaitForResult to use retry.

Since this requires refactoring the test functions in general this patch
also shows the use of the github.com/pascaldekloe/goe/verify library
which provides a good mechanism for comparing nested data structures.
Instead of just converting the tests from testutil.WaitForResult to
retry the tests that performing a nested comparison of data structures
are converted to the verify library at the same time.
2017-05-05 17:07:02 +02:00
Frank Schroeder eb6465551b
retry: add retry package for retriable tests
The current retry framework in testutil/testprc.WaitForResult uses
a func() (bool, error) callback until it succeeds or times out.
It captures the last error and returns it.

    if err := testutil.WaitForResult(t, func() (bool, error) {
	if err := foo(); err != nil {
	    return false, err
	}
	...
	return true, nil
    }); err != nil {
	t.Fatal(err)
    }

This makes the test functions more complex than they need to be since
both the boolean and the error indicate a success or a failure.

The retry.Run framework uses a an approach similar to t.Run()
from the testing framework.

    retry.Run(t, func(r *retry.R) {
	if err := foo(); err != nil {
	    r.Fatal(err)
	}
    })

The behavior of the Run function is configurable so that different
timeouts can be used for different tests.
2017-05-05 17:07:02 +02:00
Frank Schroeder f0d847572d
Fix imports on website 2017-05-05 17:07:02 +02:00
Frank Schroeder f39c604cd7
Fix imports 2017-05-05 17:07:00 +02:00
James Phillips 24efdb74fb Update CHANGELOG.md 2017-05-04 14:37:49 -07:00
James Phillips af62e2bc77 Merge pull request #3007 from hashicorp/config-json
Adds support for peers.json recover with Raft protocol version 3.
2017-05-04 14:31:21 -07:00
James Phillips 5d37086506
Adds support for new-style peers.json recovery for newer Raft protocol versions. 2017-05-04 14:15:59 -07:00
James Phillips 3d43031fbf
Updates vendored Raft library.
This pulls in https://github.com/hashicorp/raft/pull/207 to get
support for the new-style peers.json recovery file.
2017-05-04 13:27:33 -07:00
James Phillips ae4dfb1e9e Merge pull request #3006 from hashicorp/issue-2980-redux
Adds timeout and waits for feedback when asking the leader loop to reassert.
2017-05-04 12:02:52 -07:00
James Phillips eff282762d
Adds timeout and waits for feedback when asking the leader loop to reassert.
This adds on to the fix in #3004 for issue #2980.
2017-05-04 11:52:22 -07:00
James Phillips bc508f5666 Update CHANGELOG.md 2017-05-04 10:36:08 -07:00
James Phillips 693f35e038 Merge pull request #3004 from hashicorp/issue-2980
Fixes panic in leader loop on step down w/o step up
2017-05-04 10:34:38 -07:00
Frank Schroeder b33c4a16c1
Do not block on reassertLeader during shutdown 2017-05-04 16:48:54 +02:00
Frank Schroeder cfd584a784
Straighten control flow in leader.go 2017-05-04 16:17:02 +02:00
James Phillips 2a652b440a
Kick the leader loop on the proper thread after a snapshot restore, and
only if leadership is already established.
2017-05-04 16:17:01 +02:00
James Phillips 56fe6b65d1
Runs revoke leadership actions only if we've established leadership. 2017-05-04 16:17:01 +02:00
Frank Schroeder 57622c518a
Add make target for linux binary 2017-05-04 13:31:56 +02:00
Frank Schroeder 367d4760d3
Update CHANGELOG.md 2017-05-04 01:50:59 +02:00
Frank Schroeder 8c2b261c61 Use bind address as source for outgoing connections (#2822)
This patch configures consul to use the bind address as the
source address for outgoing connections.

Fixes #2822
2017-05-04 01:41:47 +02:00
Frank Schroeder fb83790cb9 Do not modify config after creation II
Move code for finding the advertise address via a
template into consulConfig() so that the config
object is not modified after creation.
2017-05-04 01:41:47 +02:00
Frank Schroeder a235986a28 Do not modify config after creation
Make sure the RPCAdvertise address is always set
so that the configuration does not have to be modified
after creation.
2017-05-04 01:41:47 +02:00
Frank Schroeder a226edd4a9 Move GCE discovery code to command/agent/config_gce.go 2017-05-04 01:41:47 +02:00
Frank Schroeder 7f73f14260 Move AWS discovery code to command/agent/config_aws.go 2017-05-04 01:41:47 +02:00
Frank Schroeder 78fc19c48c Move verifyUniqueListeners to command/agent/config.go 2017-05-04 01:41:47 +02:00
Frank Schroeder d34ba3e823 Cleanup agent config 2017-05-04 01:41:47 +02:00
Frank Schroeder 42c4265901 Cleanup consul/config 2017-05-04 01:41:47 +02:00
Kostis Kapelonis 10acfb7682 Added Spring Consul SDK for Spring applications 2017-05-03 09:22:41 +02:00
James Phillips ba7c322ee2 Merge pull request #2996 from cryptomeme/patch-1
Itty bitty typo in consul watch help
2017-05-02 16:25:39 -07:00
Damon Buckwalter 98407322a6 Itty bitty typo 2017-05-02 16:08:07 -07:00
James Phillips bdbabc8bf7 Merge pull request #2995 from hashicorp/revert-2517-feature/ui-remove-acl-id-from-list
Revert "UI: remove ACL ID from the left list"
2017-05-02 14:29:09 -07:00
James Phillips c5cc1fdba6 Revert "UI: remove ACL ID from the left list" 2017-05-02 14:28:56 -07:00
Seth Vargo 0639e7c018 Merge pull request #2517 from bhuisgen/feature/ui-remove-acl-id-from-list
UI: remove ACL ID from the left list
2017-05-02 13:12:57 -07:00
James Phillips 6382f95898
Updates static assets to pick up #2712. 2017-05-02 10:52:06 -07:00
James Phillips 1fbb6f9b6f Update CHANGELOG.md 2017-05-02 10:47:36 -07:00
James Phillips 416126d0fa Merge pull request #2712 from hebeworks/add-json-validation-to-ui
Add JSON validation to UI
2017-05-02 10:46:45 -07:00
Jack efb905c707 Add JSON validation to update view
JSON validation has now been added to the update view following the same format
as create. Since 'valueDecoded' does not have the ability to check if the value
is base64 before decoding then this must be checked first; if it is base64 then
use the decoded one, if not just get the value.

Change incorrect trailing span close to label.
2017-05-02 17:20:36 +09:00
Jack a7d65fd3a2 Add JSON validation to UI
JSON validation added to UI. This has been implemented through the use of a flag
to enable/disable the functionality with a watcher on the value to set the
success/error class on the textarea itself.

No hard validation added to the field.
2017-05-02 17:20:35 +09:00
Seth Vargo aad6ecdc5f Merge pull request #2976 from jk563/master
Rearranged into alphabetical order
2017-05-01 14:55:35 -07:00
Seth Vargo 2ca69bf15f Merge pull request #2993 from hashicorp/sethvargo/pr-2375
Add `AddAccessibleService` to testutil
2017-05-01 14:03:31 -07:00
Ethan Chu 90fe8b3418
Add `AddAccessibleService` to testutil
`AddAccessibleService` works just like `AddService` but also passing
"address" and "port". It is helpfu when you need to prepare a
fakeService that will be accessed later in target source code.
2017-05-01 13:56:48 -07:00
James Phillips 731ed95b84 Update CHANGELOG.md 2017-04-28 18:49:38 -07:00