Add unit test
make sure that if we set vmi.Spec.Domain.Features.Hyperv.EVMCS.Enabled
to be false than all dependencies features are not enabled.
@@ -945,6 +945,13 @@ var _ = Describe("VirtualMachineInstance Mutator", func() {
},
}, nil),
+ Entry("if EVMCS is explicitly false ", api.NewMinimalVMI("testvmi"),
+ &v1.FeatureHyperv{
+ EVMCS: &v1.FeatureState{Enabled: pointer.BoolPtr(false)},
+ },
+ nil,
+ ),
+
Entry("if hyperV does contain EVMCS", api.NewMinimalVMI("testvmi"),
&v1.FeatureHyperv{
EVMCS: &v1.FeatureState{},
@@ -952,6 +959,13 @@ var _ = Describe("VirtualMachineInstance Mutator", func() {
Features: cpuFeatures,
}),
+ Entry("if EVMCS is explicitly true ", api.NewMinimalVMI("testvmi"),
+ &v1.FeatureHyperv{
+ EVMCS: &v1.FeatureState{Enabled: pointer.BoolPtr(true)},
+ }, &v1.CPU{
+ Features: cpuFeatures,
+ }),
+
Entry("if hyperV does contain EVMCS and cpu sockets ", &v1.VirtualMachineInstance{
Spec: v1.VirtualMachineInstanceSpec{
Domain: v1.DomainSpec{
