2022-06-15 10:00:48 -04:00
|
|
|
package resources
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2022-07-05 08:13:19 -04:00
|
|
|
func TestNewJoinServiceDaemonset(t *testing.T) {
|
2022-08-12 09:59:45 -04:00
|
|
|
deployment := NewJoinServiceDaemonset("csp", "measurementsJSON", "enforcedPCRsJSON", []byte{0x0, 0x1, 0x2})
|
2022-06-15 10:00:48 -04:00
|
|
|
deploymentYAML, err := deployment.Marshal()
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2022-07-05 08:13:19 -04:00
|
|
|
var recreated joinServiceDaemonset
|
2022-06-15 10:00:48 -04:00
|
|
|
require.NoError(t, UnmarshalK8SResources(deploymentYAML, &recreated))
|
|
|
|
assert.Equal(t, deployment, &recreated)
|
|
|
|
}
|