32 lines
682 B
Go
32 lines
682 B
Go
package secret
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestAWSKeyManagement(t *testing.T) {
|
|
if !testAWSAvailable(t) {
|
|
return
|
|
}
|
|
}
|
|
|
|
func TestAWSParameterStorage(t *testing.T) {
|
|
if !testAWSAvailable(t) {
|
|
return
|
|
}
|
|
}
|
|
|
|
func testAWSAvailable(t *testing.T) bool {
|
|
t.Helper()
|
|
if os.Getenv("AWS_ACCESS_KEY")+os.Getenv("AWS_ACCESS_KEY_ID") == "" {
|
|
t.Skip("AWS_ACCESS_KEY or AWS_ACCESS_KEY_ID not set, which should contain the access key for testing")
|
|
return false
|
|
}
|
|
if os.Getenv("AWS_SECRET_ACCESS_KEY")+os.Getenv("AWS_SECRET_KEY") == "" {
|
|
t.Skip("AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not set, which should contain the secret key for testing")
|
|
return false
|
|
}
|
|
return true
|
|
}
|