mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-11 08:54:21 -05:00
5eb73706f5
* Move storage clients to separate packages * Allow setting of client credentials for AWS S3 * Use managed identity client secret or default credentials for Azure Blob Storage * Use credentials file to authorize GCS client --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
37 lines
844 B
Go
37 lines
844 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package setup
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/kms/uri"
|
|
"github.com/stretchr/testify/assert"
|
|
"go.uber.org/goleak"
|
|
)
|
|
|
|
func TestMain(m *testing.M) {
|
|
goleak.VerifyTestMain(m,
|
|
// https://github.com/census-instrumentation/opencensus-go/issues/1262
|
|
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"),
|
|
)
|
|
}
|
|
|
|
func TestSetUpKMS(t *testing.T) {
|
|
assert := assert.New(t)
|
|
|
|
kms, err := KMS(context.Background(), "storage://unknown", "kms://unknown")
|
|
assert.Error(err)
|
|
assert.Nil(kms)
|
|
|
|
masterSecret := uri.MasterSecret{Key: []byte("key"), Salt: []byte("salt")}
|
|
kms, err = KMS(context.Background(), "storage://no-store", masterSecret.EncodeToURI())
|
|
assert.NoError(err)
|
|
assert.NotNil(kms)
|
|
}
|