@@ -40,11 +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
43
+ specName = "invalid-resource"
44
+ input CommonSpecInput
45
+ namespace * corev1.Namespace
46
+ cancelWatches context.CancelFunc
47
+ clusterResources * clusterctl.ApplyClusterTemplateAndWaitResult
48
+ instanceStateError = "\" instanceState\" :\" Error\" "
48
49
)
49
50
50
51
// InvalidResourceSpec implements a test that verifies that creating a new cluster fails when the specified resource does not exist
@@ -89,7 +90,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
89
90
})
90
91
91
92
It ("Should fail due to the compute resources are not sufficient for the specified offering [TC8]" , func () {
92
- testInvalidResource (ctx , input , "insufficient-compute-resources" , "Unable to create a deployment for VM" )
93
+ testInvalidResource (ctx , input , "insufficient-compute-resources" , instanceStateError )
93
94
})
94
95
95
96
It ("Should fail due to the specified disk offer is not customized but the disk size is specified" , func () {
@@ -134,8 +135,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
134
135
135
136
It ("Should fail to upgrade worker machine due to insufficient compute resources" , func () {
136
137
By ("Making sure the expected error didn't occur yet" )
137
- expectedError := "Unable to create a deployment for VM"
138
- Expect (errorExistsInLog (logFolder , expectedError )).To (BeFalse ())
138
+ Expect (errorExistsInLog (logFolder , instanceStateError )).To (BeFalse ())
139
139
140
140
By ("Increasing the machine deployment instance size" )
141
141
deployment := clusterResources .MachineDeployments [0 ]
@@ -144,13 +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 , expectedError )
147
+ waitForErrorInLog (logFolder , instanceStateError )
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
- expectedError := "Unable to create a deployment for VM"
153
- Expect (errorExistsInLog (logFolder , expectedError )).To (BeFalse ())
152
+ Expect (errorExistsInLog (logFolder , instanceStateError )).To (BeFalse ())
154
153
155
154
By ("Increasing the machine deployment instance size" )
156
155
cp := clusterResources .ControlPlane
@@ -159,7 +158,7 @@ func InvalidResourceSpec(ctx context.Context, inputGetter func() CommonSpecInput
159
158
upgradeControlPlaneInfrastructureRef (ctx , cp )
160
159
161
160
By ("Checking for the expected error" )
162
- waitForErrorInLog (logFolder , expectedError )
161
+ waitForErrorInLog (logFolder , instanceStateError )
163
162
})
164
163
})
165
164
0 commit comments