Skip to content

Commit 289b645

Browse files
committed
fix
1 parent 05bf0ba commit 289b645

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ITOperatorUpgrade.java

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public class ITOperatorUpgrade extends BaseTest {
3535
private static final String OP_BASE_REL = "2.0";
3636
private static final String OP_TARGET_RELEASE = "weblogic-kubernetes-operator:latest";
3737
private static final String DOM_TARGET_RELEASE_VERSION = "weblogic.oracle/v4";
38-
private static final String OP_NS = "weblogic-operator";
39-
private static final String OP_DEP_NAME = "operator-upgrade";
40-
private static final String OP_SA = "operator-sa";
41-
private static final String DOM_NS = "weblogic-domain";
42-
private static final String DUID = "operator20domain";
38+
private static String OP_NS = "weblogic-operator";
39+
private static String OP_DEP_NAME = "operator-upgrade";
40+
private static String OP_SA = "operator-sa";
41+
private static String DOM_NS = "weblogic-domain";
42+
private static String DUID = "operator20domain";
4343
private static String opUpgradeTmpDir;
4444
private Domain domain = null;
4545
private static Operator operator20;
@@ -88,17 +88,14 @@ private void setupOperatorAndDomain(String operatorGitRelease, String operatorRe
8888
@After
8989
public void cleanupOperatorAndDomain() throws Exception {
9090
logger.log(Level.INFO, "+++++++++++++++Beginning AfterTest cleanup+++++++++++++++++++++");
91-
TestUtils.ExecAndPrintLog("docker images");
9291
if (domain != null) {
9392
domain.destroy();
9493
}
9594
if (operator20 != null) {
9695
operator20.destroy();
9796
}
9897
ExecResult result = cleanup();
99-
logger.log(Level.INFO, "cleanup stdout\n" + result.stdout());
100-
logger.log(Level.INFO, "cleanup stderr\n" + result.stderr());
101-
TestUtils.ExecAndPrintLog("helm del --purge operator-upgrade");
98+
TestUtils.ExecAndPrintLog("helm del --purge " + OP_DEP_NAME);
10299
TestUtils.ExecAndPrintLog(
103100
"kubectl delete pods,services,deployments,replicasets,configmaps,services --all --grace-period=0 --force --ignore-not-found -n "
104101
+ OP_NS);
@@ -107,8 +104,8 @@ public void cleanupOperatorAndDomain() throws Exception {
107104
+ DOM_NS);
108105
TestUtils.ExecAndPrintLog(
109106
"kubectl delete crd --all --grace-period=0 --ignore-not-found --force");
110-
TestUtils.ExecAndPrintLog("kubectl delete ns weblogic-operator --ignore-not-found --force");
111-
TestUtils.ExecAndPrintLog("kubectl delete ns weblogic-domain --ignore-not-found --force");
107+
TestUtils.ExecAndPrintLog("kubectl delete ns " + OP_NS + " --ignore-not-found --force");
108+
TestUtils.ExecAndPrintLog("kubectl delete ns " + DOM_NS + " --ignore-not-found --force");
112109
TestUtils.ExecAndPrintLog("kubectl get all --all-namespaces");
113110
logger.log(Level.INFO, "+++++++++++++++Done AfterTest cleanup+++++++++++++++++++++");
114111
}
@@ -133,6 +130,11 @@ public static void staticUnPrepare() throws Exception {
133130
public void test1OperatorUpgradeFrom2_0() throws Exception {
134131
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
135132
logTestBegin(testMethod);
133+
OP_NS = "weblogic-operator20";
134+
OP_DEP_NAME = "operator-upgrade20";
135+
OP_SA = "operator-sa20";
136+
DOM_NS = "weblogic-domain20";
137+
DUID = "operatordomain20";
136138
setupOperatorAndDomain("2.0", "2.0");
137139
upgradeOperator(true);
138140
logger.info("SUCCESS - " + testMethod);
@@ -142,6 +144,11 @@ public void test1OperatorUpgradeFrom2_0() throws Exception {
142144
public void test5OperatorUpgradeFrom2_0_1() throws Exception {
143145
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
144146
logTestBegin(testMethod);
147+
OP_NS = "weblogic-operator201";
148+
OP_DEP_NAME = "operator-upgrade201";
149+
OP_SA = "operator-sa201";
150+
DOM_NS = "weblogic-domain201";
151+
DUID = "operatordomain201";
145152
setupOperatorAndDomain("release/2.0.1", "2.0.1");
146153
upgradeOperator(true);
147154
logger.info("SUCCESS - " + testMethod);
@@ -151,6 +158,11 @@ public void test5OperatorUpgradeFrom2_0_1() throws Exception {
151158
public void test3OperatorUpgradeFrom2_1() throws Exception {
152159
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
153160
logTestBegin(testMethod);
161+
OP_NS = "weblogic-operator21";
162+
OP_DEP_NAME = "operator-upgrade21";
163+
OP_SA = "operator-sa21";
164+
DOM_NS = "weblogic-domain21";
165+
DUID = "operatordomain21";
154166
setupOperatorAndDomain("release/2.1", "2.1");
155167
upgradeOperator(false);
156168
logger.info("SUCCESS - " + testMethod);
@@ -160,6 +172,11 @@ public void test3OperatorUpgradeFrom2_1() throws Exception {
160172
public void test4OperatorUpgradeFrom2_2_0() throws Exception {
161173
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
162174
logTestBegin(testMethod);
175+
OP_NS = "weblogic-operator220";
176+
OP_DEP_NAME = "operator-upgrade220";
177+
OP_SA = "operator-sa220";
178+
DOM_NS = "weblogic-domain220";
179+
DUID = "operatordomain220";
163180
setupOperatorAndDomain("release/2.2", "2.2.0");
164181
upgradeOperator(false);
165182
logger.info("SUCCESS - " + testMethod);
@@ -169,6 +186,11 @@ public void test4OperatorUpgradeFrom2_2_0() throws Exception {
169186
public void test2OperatorUpgradeFrom2_2_1() throws Exception {
170187
String testMethod = new Object() {}.getClass().getEnclosingMethod().getName();
171188
logTestBegin(testMethod);
189+
OP_NS = "weblogic-operator221";
190+
OP_DEP_NAME = "operator-upgrade221";
191+
OP_SA = "operator-sa221";
192+
DOM_NS = "weblogic-domain221";
193+
DUID = "operatordomain221";
172194
setupOperatorAndDomain("release/2.2.1", "2.2.1");
173195
upgradeOperator(false);
174196
logger.info("SUCCESS - " + testMethod);

0 commit comments

Comments
 (0)