mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-19 22:44:18 +00:00
support building with GOFIPS140
Signed-off-by: Ryan Richard <richardry@vmware.com>
This commit is contained in:
+21
-2
@@ -1,9 +1,12 @@
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2026 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package testlib
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"crypto/fips140"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// SkipUnlessIntegration skips the current test if `-short` has been passed to `go test`.
|
||||
func SkipUnlessIntegration(t *testing.T) {
|
||||
@@ -14,6 +17,22 @@ func SkipUnlessIntegration(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func SkipTestWhenUsingGOFIPS140(t *testing.T) {
|
||||
t.Helper()
|
||||
|
||||
if fips140.Enabled() {
|
||||
t.Skip("this test is skipped when using GOFIPS140")
|
||||
}
|
||||
}
|
||||
|
||||
func SkipTestUnlessUsingGOFIPS140(t *testing.T) {
|
||||
t.Helper()
|
||||
|
||||
if !fips140.Enabled() {
|
||||
t.Skip("this test requires GOFIPS140")
|
||||
}
|
||||
}
|
||||
|
||||
func SkipTestWhenLDAPIsUnavailable(t *testing.T, env *TestEnv) {
|
||||
t.Helper()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user