2022-06-15 10:00:48 -04:00
|
|
|
package resources
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-08-29 08:30:20 -04:00
|
|
|
"github.com/edgelesssys/constellation/internal/kubernetes"
|
2022-06-15 10:00:48 -04:00
|
|
|
"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-29 10:41:09 -04:00
|
|
|
deployment := NewJoinServiceDaemonset("csp", "measurementsJSON", "enforcedPCRsJSON", "deadbeef", "true", []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-08-29 08:30:20 -04:00
|
|
|
require.NoError(t, kubernetes.UnmarshalK8SResources(deploymentYAML, &recreated))
|
2022-06-15 10:00:48 -04:00
|
|
|
assert.Equal(t, deployment, &recreated)
|
|
|
|
}
|