mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-03 20:44:14 -04:00
attestation: add MachineState to ValidateCVM
This commit is contained in:
parent
3471d73c6c
commit
2535073df8
10 changed files with 16 additions and 33 deletions
|
@ -307,28 +307,7 @@ func int32ToByte(val uint32) []byte {
|
|||
}
|
||||
|
||||
func TestValidateAzureCVM(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
attDoc vtpm.AttestationDocument
|
||||
wantErr bool
|
||||
}{
|
||||
"success": {
|
||||
attDoc: vtpm.AttestationDocument{},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
err := validateCVM(tc.attDoc)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
} else {
|
||||
assert.NoError(err)
|
||||
}
|
||||
})
|
||||
}
|
||||
assert.NoError(t, validateCVM(vtpm.AttestationDocument{}, nil))
|
||||
}
|
||||
|
||||
func TestNewSNPReportFromBytes(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue