11
11
import java .nio .file .StandardCopyOption ;
12
12
import java .util .Map ;
13
13
import oracle .kubernetes .operator .utils .Domain ;
14
- import oracle .kubernetes .operator .utils .ExecCommand ;
15
- import oracle .kubernetes .operator .utils .ExecResult ;
16
14
import oracle .kubernetes .operator .utils .Operator ;
17
15
import oracle .kubernetes .operator .utils .TestUtils ;
18
16
import org .junit .AfterClass ;
@@ -101,8 +99,8 @@ public static void staticUnPrepare() throws Exception {
101
99
}
102
100
103
101
/**
104
- * Stop Operator. Start a managed server by applying a modified domain.yaml. Restart Operator and
105
- * verify that it connects to this newly started managed server .
102
+ * Stop operator and apply the modified domain.yaml with replicas count increated. Restart
103
+ * operator and make sure the cluster is scaled up accordingly .
106
104
*
107
105
* @throws Exception
108
106
*/
@@ -117,25 +115,25 @@ public void testOPConnToNewMS() throws Exception {
117
115
118
116
String cmd = "kubectl apply -f " + testDomainYamlFile ;
119
117
logger .info ("Start a new managed server, managed-server3 using command:\n " + cmd );
120
- ExecResult result = ExecCommand .exec (cmd );
118
+ TestUtils .exec (cmd );
121
119
122
120
logger .info ("Start the Operator" );
123
121
operator .startUsingReplicas ();
124
122
125
123
logger .info ("Check the newly created managed-server3 is running" );
126
124
int replicas = 3 ;
127
- varifyPodReady (replicas );
125
+ verifyPodReady (replicas );
128
126
129
127
// restore the test env
130
128
int msDecrNum = 1 ;
131
- scaleDownAndVarify (msDecrNum );
129
+ scaleDownAndverify (msDecrNum );
132
130
133
131
logger .info ("SUCCESS - " + testMethodName );
134
132
}
135
133
136
134
/**
137
135
* Stop and restart Operator and verify that it discovers running servers and a newly started
138
- * server by scaling up cluster. Verify that the cluster scale up is noy impacted.
136
+ * server by scaling up cluster. Verify that the cluster scale up is not impacted.
139
137
*
140
138
* @throws Exception
141
139
*/
@@ -149,11 +147,11 @@ public void testOPReconnToRunningMSAndScaleUp() throws Exception {
149
147
operator .restartUsingReplicas ();
150
148
151
149
int msIncrNum = 1 ;
152
- scaleUpAndVarify (msIncrNum );
150
+ scaleUpAndverify (msIncrNum );
153
151
154
152
// restore the test env
155
153
int msDecrNum = 1 ;
156
- scaleDownAndVarify (msDecrNum );
154
+ scaleDownAndverify (msDecrNum );
157
155
158
156
logger .info ("SUCCESS - " + testMethodName );
159
157
}
@@ -181,7 +179,7 @@ public void testOPAdminReconnToDomain() throws Exception {
181
179
182
180
String cmd = "kubectl delete po/" + adminServerPodName + " -n " + domainNS ;
183
181
logger .info ("Stop admin server <" + adminServerPodName + "> using command:\n " + cmd );
184
- ExecResult result = ExecCommand .exec (cmd );
182
+ TestUtils .exec (cmd );
185
183
186
184
logger .info ("Checking if admin pod <" + adminServerPodName + "> is deleted" );
187
185
TestUtils .checkPodDeleted (adminServerPodName , domainNS );
@@ -193,11 +191,11 @@ public void testOPAdminReconnToDomain() throws Exception {
193
191
TestUtils .checkPodReady (adminServerPodName , domainNS );
194
192
195
193
int msIncrNum = 1 ;
196
- scaleUpAndVarify (msIncrNum );
194
+ scaleUpAndverify (msIncrNum );
197
195
198
196
// restore the test env
199
197
int msDecrNum = 1 ;
200
- scaleDownAndVarify (msDecrNum );
198
+ scaleDownAndverify (msDecrNum );
201
199
202
200
logger .info ("SUCCESS - " + testMethodName );
203
201
}
@@ -228,7 +226,7 @@ public void testOPMSReconnToDomain() throws Exception {
228
226
String msPodName = domainUid + "-" + managedServerNameBase + i ;
229
227
String cmd = "kubectl delete po/" + msPodName + " -n " + domainNS ;
230
228
logger .info ("Stop managed server <" + msPodName + "> using command:\n " + cmd );
231
- ExecResult result = ExecCommand .exec (cmd );
229
+ TestUtils .exec (cmd );
232
230
233
231
logger .info ("Checking if ms pod <" + msPodName + "> is deleted" );
234
232
TestUtils .checkPodDeleted (msPodName , domainNS );
@@ -267,7 +265,7 @@ public void testOPRestartDeadMS() throws Exception {
267
265
String msPodName = domainUid + "-" + managedServerNameBase + "1" ;
268
266
String cmd = "kubectl delete po/" + msPodName + " -n " + domainNS ;
269
267
logger .info ("Stop managed server <" + msPodName + "> using command:\n " + cmd );
270
- ExecResult result = ExecCommand .exec (cmd );
268
+ TestUtils .exec (cmd );
271
269
272
270
logger .info ("Wait 10 seconds for ms to be restarted" );
273
271
Thread .sleep (10 );
@@ -278,7 +276,7 @@ public void testOPRestartDeadMS() throws Exception {
278
276
logger .info ("SUCCESS - " + testMethodName );
279
277
}
280
278
281
- private void scaleDownAndVarify (int decrNum ) throws Exception {
279
+ private void scaleDownAndverify (int decrNum ) throws Exception {
282
280
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
283
281
logTestBegin (testMethodName );
284
282
@@ -308,7 +306,7 @@ private void scaleDownAndVarify(int decrNum) throws Exception {
308
306
}
309
307
}
310
308
311
- private void scaleUpAndVarify (int incrNum ) throws Exception {
309
+ private void scaleUpAndverify (int incrNum ) throws Exception {
312
310
Map <String , Object > domainMap = domain .getDomainMap ();
313
311
String domainUid = domain .getDomainUid ();
314
312
String domainNS = domainMap .get ("namespace" ).toString ();
@@ -322,10 +320,10 @@ private void scaleUpAndVarify(int incrNum) throws Exception {
322
320
logger .info ("Scale domain " + domainUid + " up to " + replicas + " managed servers" );
323
321
operator .scale (domainUid , clusterName , replicas );
324
322
325
- varifyPodReady (replicas );
323
+ verifyPodReady (replicas );
326
324
}
327
325
328
- private void varifyPodReady (int replicas ) throws Exception {
326
+ private void verifyPodReady (int replicas ) throws Exception {
329
327
Map <String , Object > domainMap = domain .getDomainMap ();
330
328
String domainUid = domain .getDomainUid ();
331
329
String domainNS = domainMap .get ("namespace" ).toString ();
0 commit comments