Skip to content

Commit 7fb9755

Browse files
committed
fix invalid resource test
1 parent 5d77e88 commit 7fb9755

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/e2e/invalid_resource.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ import (
4040
)
4141

4242
var (
43-
specName = "invalid-resource"
44-
input CommonSpecInput
45-
namespace *corev1.Namespace
46-
cancelWatches context.CancelFunc
47-
clusterResources *clusterctl.ApplyClusterTemplateAndWaitResult
48-
instanceStateError = "\"instanceState\":\"Error\""
43+
specName = "invalid-resource"
44+
input CommonSpecInput
45+
namespace *corev1.Namespace
46+
cancelWatches context.CancelFunc
47+
clusterResources *clusterctl.ApplyClusterTemplateAndWaitResult
48+
MachineInErrorMessage = "CloudStackMachine VM in error state. Deleting associated Machine"
4949
)
5050

5151
// InvalidResourceSpec implements a test that verifies that creating a new cluster fails when the specified resource does not exist
@@ -90,7 +90,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
9090
})
9191

9292
It("Should fail due to the compute resources are not sufficient for the specified offering [TC8]", func() {
93-
testInvalidResource(ctx, input, "insufficient-compute-resources", instanceStateError)
93+
testInvalidResource(ctx, input, "insufficient-compute-resources", MachineInErrorMessage)
9494
})
9595

9696
It("Should fail due to the specified disk offer is not customized but the disk size is specified", func() {
@@ -135,7 +135,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
135135

136136
It("Should fail to upgrade worker machine due to insufficient compute resources", func() {
137137
By("Making sure the expected error didn't occur yet")
138-
Expect(errorExistsInLog(logFolder, instanceStateError)).To(BeFalse())
138+
Expect(errorExistsInLog(logFolder, MachineInErrorMessage)).To(BeFalse())
139139

140140
By("Increasing the machine deployment instance size")
141141
deployment := clusterResources.MachineDeployments[0]
@@ -144,12 +144,12 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
144144
upgradeMachineDeploymentInfrastructureRef(ctx, deployment)
145145

146146
By("Checking for the expected error")
147-
waitForErrorInLog(logFolder, instanceStateError)
147+
waitForErrorInLog(logFolder, MachineInErrorMessage)
148148
})
149149

150150
It("Should fail to upgrade control plane machine due to insufficient compute resources", func() {
151151
By("Making sure the expected error didn't occur yet")
152-
Expect(errorExistsInLog(logFolder, instanceStateError)).To(BeFalse())
152+
Expect(errorExistsInLog(logFolder, MachineInErrorMessage)).To(BeFalse())
153153

154154
By("Increasing the machine deployment instance size")
155155
cp := clusterResources.ControlPlane
@@ -158,7 +158,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
158158
upgradeControlPlaneInfrastructureRef(ctx, cp)
159159

160160
By("Checking for the expected error")
161-
waitForErrorInLog(logFolder, instanceStateError)
161+
waitForErrorInLog(logFolder, MachineInErrorMessage)
162162
})
163163
})
164164

0 commit comments

Comments
 (0)