Skip to content

Commit

Permalink
Fix key upgrade and raft tests (#6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
briankassouf authored Jun 21, 2019
1 parent 430d9f9 commit 91b5300
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions vault/external_tests/raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func TestRaft_ShamirUnseal(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -66,6 +68,8 @@ func TestRaft_SnapshotAPI(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -199,6 +203,8 @@ func TestRaft_SnapshotAPI_RekeyRotate_Backward(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -384,6 +390,8 @@ func TestRaft_SnapshotAPI_RekeyRotate_Forward(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down Expand Up @@ -581,6 +589,8 @@ func TestRaft_SnapshotAPI_DifferentCluster(t *testing.T) {
})
coreConfig := &vault.CoreConfig{
Logger: logger,
// TODO: remove this later
DisablePerformanceStandby: true,
}
i := 0
cluster := vault.NewTestCluster(t, coreConfig, &vault.TestClusterOptions{
Expand Down
3 changes: 2 additions & 1 deletion vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,8 @@ func (b *SystemBackend) handleRotate(ctx context.Context, req *logical.Request,

// Schedule the destroy of the upgrade path
time.AfterFunc(KeyRotateGracePeriod, func() {
if err := b.Core.barrier.DestroyUpgrade(ctx, newTerm); err != nil {
b.Backend.Logger().Debug("cleaning up upgrade keys", "waited", KeyRotateGracePeriod)
if err := b.Core.barrier.DestroyUpgrade(b.Core.activeContext, newTerm); err != nil {
b.Backend.Logger().Error("failed to destroy upgrade", "term", newTerm, "error", err)
}
})
Expand Down
1 change: 1 addition & 0 deletions vault/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
coreConfig.DevLicenseDuration = base.DevLicenseDuration
coreConfig.DisableCache = base.DisableCache
coreConfig.LicensingConfig = base.LicensingConfig
coreConfig.DisablePerformanceStandby = base.DisablePerformanceStandby
if base.BuiltinRegistry != nil {
coreConfig.BuiltinRegistry = base.BuiltinRegistry
}
Expand Down

0 comments on commit 91b5300

Please sign in to comment.