Skip to content

Commit

Permalink
update Tests to include LatestModelApplied
Browse files Browse the repository at this point in the history
  • Loading branch information
primeroz committed Jan 2, 2023
1 parent f8e2686 commit 9437d45
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
17 changes: 10 additions & 7 deletions azure/converters/vmss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func Test_SDKToVMSS(t *testing.T) {
Name: to.StringPtr("vm0"),
Zones: to.StringSlicePtr([]string{"zone0"}),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
LatestModelApplied: to.BoolPtr(true),
OsProfile: &compute.OSProfile{
ComputerName: to.StringPtr("instance-000000"),
},
Expand All @@ -75,7 +76,8 @@ func Test_SDKToVMSS(t *testing.T) {
Name: to.StringPtr("vm1"),
Zones: to.StringSlicePtr([]string{"zone1"}),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
ProvisioningState: to.StringPtr(string(compute.ProvisioningState1Succeeded)),
LatestModelApplied: to.BoolPtr(true),
OsProfile: &compute.OSProfile{
ComputerName: to.StringPtr("instance-000001"),
},
Expand All @@ -99,11 +101,12 @@ func Test_SDKToVMSS(t *testing.T) {

for i := 0; i < 2; i++ {
expected.Instances[i] = azure.VMSSVM{
ID: fmt.Sprintf("vm/%d", i),
InstanceID: fmt.Sprintf("%d", i),
Name: fmt.Sprintf("instance-00000%d", i),
AvailabilityZone: fmt.Sprintf("zone%d", i),
State: "Succeeded",
ID: fmt.Sprintf("vm/%d", i),
InstanceID: fmt.Sprintf("%d", i),
Name: fmt.Sprintf("instance-00000%d", i),
AvailabilityZone: fmt.Sprintf("zone%d", i),
State: "Succeeded",
LatestModelApplied: true,
}
}
g.Expect(actual).To(gomega.Equal(&expected))
Expand Down
18 changes: 11 additions & 7 deletions azure/services/scalesets/scalesets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ func TestGetExistingVMSS(t *testing.T) {
Zones: []string{"1", "3"},
Instances: []azure.VMSSVM{
{
ID: "my-vm-id",
InstanceID: "my-vm-1",
Name: "instance-000001",
State: "Succeeded",
ID: "my-vm-id",
InstanceID: "my-vm-1",
Name: "instance-000001",
State: "Succeeded",
LatestModelApplied: true,
},
},
},
Expand All @@ -109,7 +110,8 @@ func TestGetExistingVMSS(t *testing.T) {
InstanceID: to.StringPtr("my-vm-1"),
Name: to.StringPtr("my-vm"),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr("Succeeded"),
ProvisioningState: to.StringPtr("Succeeded"),
LatestModelApplied: to.BoolPtr(true),
OsProfile: &compute.OSProfile{
ComputerName: to.StringPtr("instance-000001"),
},
Expand Down Expand Up @@ -1266,7 +1268,8 @@ func newDefaultInstances() []compute.VirtualMachineScaleSetVM {
InstanceID: to.StringPtr("my-vm-1"),
Name: to.StringPtr("my-vm"),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr("Succeeded"),
ProvisioningState: to.StringPtr("Succeeded"),
LatestModelApplied: to.BoolPtr(true),
OsProfile: &compute.OSProfile{
ComputerName: to.StringPtr("instance-000001"),
},
Expand All @@ -1285,7 +1288,8 @@ func newDefaultInstances() []compute.VirtualMachineScaleSetVM {
InstanceID: to.StringPtr("my-vm-2"),
Name: to.StringPtr("my-vm"),
VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{
ProvisioningState: to.StringPtr("Succeeded"),
ProvisioningState: to.StringPtr("Succeeded"),
LatestModelApplied: to.BoolPtr(true),
OsProfile: &compute.OSProfile{
ComputerName: to.StringPtr("instance-000002"),
},
Expand Down

0 comments on commit 9437d45

Please sign in to comment.