mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-29 19:41:15 +02:00
* Regenerate .pb with protoc-gen-go v1.36.11 * Support running host processes alongside VMs * Replace existing host processes when starting a set
34 lines
885 B
Go
34 lines
885 B
Go
package v1_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
|
|
"github.com/google/go-cmp/cmp"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// TestVM ensures that v1.VM and its embedded structs can be compared
|
|
// using github.com/google/go-cmp/cmp without causing panics.
|
|
func TestVM(t *testing.T) {
|
|
cmp.Equal(v1.VM{}, v1.VM{})
|
|
}
|
|
|
|
func TestSemanticallyEqualEquatesEmptySlices(t *testing.T) {
|
|
nilSlicesSpec := v1.VMSpec{}
|
|
emptySlicesSpec := v1.VMSpec{
|
|
NetSoftnetAllow: []string{},
|
|
NetSoftnetBlock: []string{},
|
|
}
|
|
require.True(t, v1.SemanticallyEqual(nilSlicesSpec, emptySlicesSpec))
|
|
}
|
|
|
|
func TestVMSpecHostProcessesEqualEquatesEmptySlices(t *testing.T) {
|
|
nilHostProcessesSpec := v1.VMSpec{}
|
|
emptyHostProcessesSpec := v1.VMSpec{
|
|
HostProcesses: []v1.HostProcess{},
|
|
}
|
|
|
|
require.True(t, nilHostProcessesSpec.HostProcessesEqual(emptyHostProcessesSpec))
|
|
}
|