-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename testing_util.go to testing_util_stubs_oss.go and move init Bui…
…ldDate to new shared testing_util.go
- Loading branch information
Showing
2 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
//go:build !enterprise | ||
|
||
package vault | ||
|
||
import ( | ||
"crypto/ed25519" | ||
"testing" | ||
"time" | ||
|
||
"github.com/hashicorp/vault/version" | ||
) | ||
|
||
func init() { | ||
// The BuildDate is set as part of the build process in CI so we need to | ||
// initialize it for testing. | ||
// initialize it for testing. By setting it to now minus one year we | ||
// provide some headroom to ensure that test license expiration (for enterprise) | ||
// does not exceed the BuildDate as that is invalid. | ||
if version.BuildDate == "" { | ||
version.BuildDate = time.Now().UTC().AddDate(-1, 0, 0).Format(time.RFC3339) | ||
} | ||
} | ||
|
||
func GenerateTestLicenseKeys() (ed25519.PublicKey, ed25519.PrivateKey, error) { return nil, nil, nil } | ||
func testGetLicensingConfig(key ed25519.PublicKey) *LicensingConfig { return &LicensingConfig{} } | ||
func testExtraTestCoreSetup(testing.TB, ed25519.PrivateKey, *TestClusterCore) {} | ||
func testAdjustUnderlyingStorage(tcc *TestClusterCore) { | ||
tcc.UnderlyingStorage = tcc.physical | ||
} | ||
func testApplyEntBaseConfig(coreConfig, base *CoreConfig) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
|
||
//go:build !enterprise | ||
|
||
package vault | ||
|
||
import ( | ||
"crypto/ed25519" | ||
"testing" | ||
) | ||
|
||
func GenerateTestLicenseKeys() (ed25519.PublicKey, ed25519.PrivateKey, error) { return nil, nil, nil } | ||
func testGetLicensingConfig(key ed25519.PublicKey) *LicensingConfig { return &LicensingConfig{} } | ||
func testExtraTestCoreSetup(testing.TB, ed25519.PrivateKey, *TestClusterCore) {} | ||
func testAdjustUnderlyingStorage(tcc *TestClusterCore) { | ||
tcc.UnderlyingStorage = tcc.physical | ||
} | ||
func testApplyEntBaseConfig(coreConfig, base *CoreConfig) {} |