@@ -40,12 +40,12 @@ import (
40
40
)
41
41
42
42
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 "
49
49
)
50
50
51
51
// 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
90
90
})
91
91
92
92
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 )
94
94
})
95
95
96
96
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
135
135
136
136
It ("Should fail to upgrade worker machine due to insufficient compute resources" , func () {
137
137
By ("Making sure the expected error didn't occur yet" )
138
- Expect (errorExistsInLog (logFolder , instanceStateError )).To (BeFalse ())
138
+ Expect (errorExistsInLog (logFolder , MachineInErrorMessage )).To (BeFalse ())
139
139
140
140
By ("Increasing the machine deployment instance size" )
141
141
deployment := clusterResources .MachineDeployments [0 ]
@@ -144,12 +144,12 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
144
144
upgradeMachineDeploymentInfrastructureRef (ctx , deployment )
145
145
146
146
By ("Checking for the expected error" )
147
- waitForErrorInLog (logFolder , instanceStateError )
147
+ waitForErrorInLog (logFolder , MachineInErrorMessage )
148
148
})
149
149
150
150
It ("Should fail to upgrade control plane machine due to insufficient compute resources" , func () {
151
151
By ("Making sure the expected error didn't occur yet" )
152
- Expect (errorExistsInLog (logFolder , instanceStateError )).To (BeFalse ())
152
+ Expect (errorExistsInLog (logFolder , MachineInErrorMessage )).To (BeFalse ())
153
153
154
154
By ("Increasing the machine deployment instance size" )
155
155
cp := clusterResources .ControlPlane
@@ -158,7 +158,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
158
158
upgradeControlPlaneInfrastructureRef (ctx , cp )
159
159
160
160
By ("Checking for the expected error" )
161
- waitForErrorInLog (logFolder , instanceStateError )
161
+ waitForErrorInLog (logFolder , MachineInErrorMessage )
162
162
})
163
163
})
164
164
0 commit comments