Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
test: update UT expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Jan 14, 2021
1 parent ba28d3f commit 06d6109
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions pkg/operations/kubernetesupgrade/upgradecluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should succeed when cluster VMs are missing expected tags during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -87,7 +87,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to list VMs during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -113,7 +113,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete VMs during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -136,7 +136,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to deploy template during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 1, 1, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -159,7 +159,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to get a virtual machine during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 1, 6, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 1, 6, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -182,7 +182,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to get storage client during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 5, 1, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 5, 1, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -205,7 +205,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete network interface during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand All @@ -228,7 +228,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should return error message when failing to delete role assignment during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
uc := UpgradeCluster{
Expand Down Expand Up @@ -262,7 +262,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {

BeforeEach(func() {
mockClient = armhelpers.MockAKSEngineClient{MockKubernetesClient: &armhelpers.MockKubernetesClient{}}
cs = api.CreateMockContainerService("testcluster", "1.18.13", 3, 3, false)
cs = api.CreateMockContainerService("testcluster", "1.18.15", 3, 3, false)
uc = UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down Expand Up @@ -291,10 +291,10 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should skip VMs that are already on desired version", func() {
mockClient.FakeListVirtualMachineScaleSetVMsResult = func() []compute.VirtualMachineScaleSetVM {
return []compute.VirtualMachineScaleSetVM{
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.13"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.15"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.10"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.9"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.13"),
mockClient.MakeFakeVirtualMachineScaleSetVM("Kubernetes:1.18.15"),
}
}
uc.Force = false
Expand Down Expand Up @@ -362,9 +362,9 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
It("Should use kubernetes api to get node versions for VMSS when latest model is not applied", func() {
trueVar := true
falseVar := false
vmWithoutLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.13", "vmWithoutLatestModelApplied!")
vmWithoutLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.15", "vmWithoutLatestModelApplied!")
vmWithoutLatestModelApplied.VirtualMachineScaleSetVMProperties.LatestModelApplied = &falseVar
vmWithLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.13", "vmWithLatestModelApplied")
vmWithLatestModelApplied := mockClient.MakeFakeVirtualMachineScaleSetVMWithGivenName("Kubernetes:1.18.15", "vmWithLatestModelApplied")
vmWithLatestModelApplied.VirtualMachineScaleSetVMProperties.LatestModelApplied = &trueVar

mockClient.MockKubernetesClient.GetNodeFunc = func(name string) (*v1.Node, error) {
Expand Down Expand Up @@ -622,7 +622,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
Expect(*uc.UpgradedMasterVMs).To(HaveLen(0))
})
It("Should leave platform fault domain count nil", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
cs.Properties.MasterProfile.AvailabilityProfile = "AvailabilitySet"
Expand Down Expand Up @@ -715,7 +715,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should not fail if no managed identity is returned by azure during upgrade operation", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &api.KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true)
uc := UpgradeCluster{
Expand All @@ -738,7 +738,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should not fail if a Kubernetes client cannot be created", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
uc := UpgradeCluster{
Translator: &i18n.Translator{},
Logger: log.NewEntry(log.New()),
Expand Down Expand Up @@ -772,7 +772,7 @@ var _ = Describe("Upgrade Kubernetes cluster tests", func() {
})

It("Should fail if cluster-autoscaler cannot be paused unless --force is specified", func() {
cs := api.CreateMockContainerService("testcluster", "1.18.13", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "1.18.15", 3, 2, false)
enabled := true
addon := api.KubernetesAddon{
Name: "cluster-autoscaler",
Expand Down

0 comments on commit 06d6109

Please sign in to comment.