mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 08:15:48 -04:00
measurements: refactor validation option (#1462)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
1ab40b7ca6
commit
02fc3dc635
17 changed files with 290 additions and 281 deletions
|
@ -130,7 +130,7 @@ func TestNewWithDefaultOptions(t *testing.T) {
|
|||
c.Provider.Azure.ResourceGroup = "test"
|
||||
c.Provider.Azure.UserAssignedIdentity = "/subscriptions/8b8bd01f-efd9-4113-9bd1-c82137c32da7/resourcegroups/constellation-identity/providers/Microsoft.ManagedIdentity/userAssignedIdentities/constellation-identity"
|
||||
c.Provider.Azure.AppClientID = "3ea4bdc1-1cc1-4237-ae78-0831eff3491e"
|
||||
c.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, false)}
|
||||
c.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, measurements.Enforce)}
|
||||
return c
|
||||
}(),
|
||||
envToSet: map[string]string{
|
||||
|
@ -151,7 +151,7 @@ func TestNewWithDefaultOptions(t *testing.T) {
|
|||
c.Provider.Azure.ClientSecretValue = "other-value" // < Note secret set in config, as well.
|
||||
c.Provider.Azure.UserAssignedIdentity = "/subscriptions/8b8bd01f-efd9-4113-9bd1-c82137c32da7/resourcegroups/constellation-identity/providers/Microsoft.ManagedIdentity/userAssignedIdentities/constellation-identity"
|
||||
c.Provider.Azure.AppClientID = "3ea4bdc1-1cc1-4237-ae78-0831eff3491e"
|
||||
c.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, false)}
|
||||
c.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, measurements.Enforce)}
|
||||
return c
|
||||
}(),
|
||||
envToSet: map[string]string{
|
||||
|
@ -246,7 +246,7 @@ func TestValidate(t *testing.T) {
|
|||
az.ClientSecretValue = "test-client-secret"
|
||||
cnf.Provider = ProviderConfig{}
|
||||
cnf.Provider.Azure = az
|
||||
cnf.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, false)}
|
||||
cnf.Provider.Azure.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, measurements.Enforce)}
|
||||
return cnf
|
||||
}(),
|
||||
},
|
||||
|
@ -273,7 +273,7 @@ func TestValidate(t *testing.T) {
|
|||
gcp.ServiceAccountKeyPath = "test-key-path"
|
||||
cnf.Provider = ProviderConfig{}
|
||||
cnf.Provider.GCP = gcp
|
||||
cnf.Provider.GCP.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, false)}
|
||||
cnf.Provider.GCP.Measurements = measurements.M{15: measurements.WithAllBytes(0x00, measurements.Enforce)}
|
||||
return cnf
|
||||
}(),
|
||||
},
|
||||
|
@ -397,9 +397,9 @@ func TestConfigGeneratedDocsFresh(t *testing.T) {
|
|||
func TestConfig_UpdateMeasurements(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
newMeasurements := measurements.M{
|
||||
1: measurements.WithAllBytes(0x00, false),
|
||||
2: measurements.WithAllBytes(0x01, false),
|
||||
3: measurements.WithAllBytes(0x02, false),
|
||||
1: measurements.WithAllBytes(0x00, measurements.Enforce),
|
||||
2: measurements.WithAllBytes(0x01, measurements.Enforce),
|
||||
3: measurements.WithAllBytes(0x02, measurements.Enforce),
|
||||
}
|
||||
|
||||
{ // AWS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue