mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-11 16:30:12 -04:00
Bootstrapper
This commit is contained in:
parent
916e5d6b55
commit
dea23604fb
19 changed files with 130 additions and 293 deletions
|
@ -11,8 +11,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/edgelesssys/constellation/bootstrapper/core"
|
||||
"github.com/edgelesssys/constellation/bootstrapper/role"
|
||||
"github.com/edgelesssys/constellation/internal/atls"
|
||||
"github.com/edgelesssys/constellation/internal/cloud/metadata"
|
||||
"github.com/edgelesssys/constellation/internal/grpc/atlscredentials"
|
||||
"github.com/edgelesssys/constellation/internal/logger"
|
||||
"github.com/edgelesssys/constellation/internal/oid"
|
||||
|
@ -95,7 +96,7 @@ func TestKeyAPI(t *testing.T) {
|
|||
api := keyservice.New(
|
||||
logger.NewTest(t),
|
||||
atls.NewFakeIssuer(oid.Dummy{}),
|
||||
&core.ProviderMetadataFake{},
|
||||
&fakeMetadataAPI{},
|
||||
20*time.Second,
|
||||
)
|
||||
|
||||
|
@ -122,3 +123,16 @@ func TestKeyAPI(t *testing.T) {
|
|||
assert.NoError(err)
|
||||
assert.Equal(testKey, key)
|
||||
}
|
||||
|
||||
type fakeMetadataAPI struct{}
|
||||
|
||||
func (f *fakeMetadataAPI) List(ctx context.Context) ([]metadata.InstanceMetadata, error) {
|
||||
return []metadata.InstanceMetadata{
|
||||
{
|
||||
Name: "instanceName",
|
||||
ProviderID: "fake://instance-id",
|
||||
Role: role.Unknown,
|
||||
PrivateIPs: []string{"192.0.2.1"},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue