mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
3fde118b33
* fetch latest version when older than 2 weeks
* extend hack upload tool to pass an upload date
* Revert "config: disable user-facing version Azure SEV SNP fetch for v2.8 (#1882)"
This reverts commit c7b22d314a
.
* fix tests
* use NewAzureSEVSNPVersionList for type guarantees
* Revert "use NewAzureSEVSNPVersionList for type guarantees"
This reverts commit 942566453f4b4a2b6dc16f8689248abf1dc47db4.
* assure list is sorted
* improve root.go style
* daniel feedback
47 lines
759 B
Go
47 lines
759 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
func TestVersionMarshalYAML(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
sut AttestationVersion
|
|
want string
|
|
}{
|
|
{
|
|
name: "isLatest resolves to latest",
|
|
sut: AttestationVersion{
|
|
Value: 1,
|
|
IsLatest: true,
|
|
},
|
|
want: "latest\n",
|
|
},
|
|
{
|
|
name: "value 5 resolves to 5",
|
|
sut: AttestationVersion{
|
|
Value: 5,
|
|
IsLatest: false,
|
|
},
|
|
want: "5\n",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
bt, err := yaml.Marshal(tt.sut)
|
|
require.NoError(t, err)
|
|
require.Equal(t, tt.want, string(bt))
|
|
})
|
|
}
|
|
}
|