@@ -191,6 +191,18 @@ func TestVSphereVM_ValidateUpdate(t *testing.T) {
191
191
vSphereVM : createVSphereVM ("vsphere-vm-1" , "foo.com" , biosUUID , "" , "BB:CC:DD:EE:FF" , []string {"192.168.0.1/32" }, nil , Linux , VirtualMachinePowerOpModeSoft , nil ),
192
192
wantErr : false ,
193
193
},
194
+ {
195
+ name : "biosUUID can be set to a value" ,
196
+ oldVSphereVM : createVSphereVM ("vsphere-vm-1" , "foo.com" , "" , "" , "AA:BB:CC:DD:EE" , []string {"192.168.0.1/32" }, nil , Linux , VirtualMachinePowerOpModeTrySoft , nil ),
197
+ vSphereVM : createVSphereVM ("vsphere-vm-1" , "foo.com" , biosUUID , "" , "AA:BB:CC:DD:EE" , []string {"192.168.0.1/32" }, nil , Linux , VirtualMachinePowerOpModeTrySoft , nil ),
198
+ wantErr : false ,
199
+ },
200
+ {
201
+ name : "biosUUID cannot be updated to a different value" ,
202
+ oldVSphereVM : createVSphereVM ("vsphere-vm-1" , "foo.com" , "old-uuid" , "" , "AA:BB:CC:DD:EE" , []string {"192.168.0.1/32" }, nil , Linux , VirtualMachinePowerOpModeTrySoft , nil ),
203
+ vSphereVM : createVSphereVM ("vsphere-vm-1" , "foo.com" , biosUUID , "" , "AA:BB:CC:DD:EE" , []string {"192.168.0.1/32" }, nil , Linux , VirtualMachinePowerOpModeTrySoft , nil ),
204
+ wantErr : true ,
205
+ },
194
206
}
195
207
for _ , tc := range tests {
196
208
t .Run (tc .name , func (t * testing.T ) {
0 commit comments