Skip to content

Commit 15dd2db

Browse files
committed
Merge branch 'develop' into sitconfigtests2
2 parents 0cc2cc5 + 029faf1 commit 15dd2db

File tree

53 files changed

+2781
-1211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2781
-1211
lines changed

docs/domains/Domain.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
"items": {
5252
"$ref": "#/definitions/Channel"
5353
}
54+
},
55+
"annotations": {
56+
"description": "Annotations to associate with the external channel service",
57+
"$ref": "#/definitions/Map"
58+
},
59+
"labels": {
60+
"description": "Labels to associate with the external channel service",
61+
"$ref": "#/definitions/Map"
5462
}
5563
}
5664
},

docs/domains/Domain.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ ServerPod describes the configuration for a Kubernetes pod for a server.
144144

145145
| Name | Type | Description |
146146
| --- | --- | --- |
147+
| annotations | Map | Annotations to associate with the external channel service |
147148
| channels | array of [Channel](#channel) | Specifies which of the admin server's WebLogic channels should be exposed outside the Kubernetes cluster via a node port service, along with the node port for each channel. If not specified, the admin server's node port service will not be created. |
149+
| labels | Map | Labels to associate with the external channel service |
148150

149151
### Probe Tuning
150152

docs/domains/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,14 @@
971971
"items": {
972972
"$ref": "#/definitions/Channel"
973973
}
974+
},
975+
"annotations": {
976+
"description": "Annotations to associate with the external channel service",
977+
"$ref": "#/definitions/Map"
978+
},
979+
"labels": {
980+
"description": "Labels to associate with the external channel service",
981+
"$ref": "#/definitions/Map"
974982
}
975983
}
976984
},

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

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
4-
54
package oracle.kubernetes.operator;
65

76
import java.nio.file.Files;
@@ -25,9 +24,28 @@
2524
* extend this class.
2625
*/
2726
public class BaseTest {
27+
2828
public static final Logger logger = Logger.getLogger("OperatorIT", "OperatorIT");
2929
public static final String TESTWEBAPP = "testwebapp";
3030

31+
// property file used to customize operator properties for operator inputs yaml
32+
public static final String OPERATOR1_YAML = "operator1.yaml";
33+
public static final String OPERATOR2_YAML = "operator2.yaml";
34+
public static final String OPERATORBC_YAML = "operator_bc.yaml";
35+
public static final String OPERATOR_CHAIN_YAML = "operator_chain.yaml";
36+
37+
// file used to customize domain properties for domain, PV and LB inputs yaml
38+
public static final String DOMAINONPV_WLST_YAML = "domainonpvwlst.yaml";
39+
public static final String DOMAINONPV_WDT_YAML = "domainonpvwdt.yaml";
40+
public static final String DOMAIN_ADMINONLY_YAML = "domainadminonly.yaml";
41+
public static final String DOMAIN_RECYCLEPOLICY_YAML = "domainrecyclepolicy.yaml";
42+
public static final String DOMAIN_SAMPLE_DEFAULTS_YAML = "domainsampledefaults.yaml";
43+
public static final String DOMAININIMAGE_WLST_YAML = "domaininimagewlst.yaml";
44+
public static final String DOMAININIMAGE_WDT_YAML = "domaininimagewdt.yaml";
45+
46+
// property file used to configure constants for integration tests
47+
public static final String APP_PROPS_FILE = "OperatorIT.properties";
48+
3149
private static String resultRoot = "";
3250
private static String pvRoot = "";
3351
private static String resultDir = "";
@@ -42,6 +60,30 @@ public class BaseTest {
4260
private static String appLocationInPod = "/u01/oracle/apps";
4361
private static Properties appProps;
4462

63+
public static boolean QUICKTEST;
64+
public static boolean SMOKETEST;
65+
public static boolean JENKINS;
66+
public static boolean INGRESSPERDOMAIN = true;
67+
68+
// Set QUICKTEST env var to true to run a small subset of tests.
69+
// Set SMOKETEST env var to true to run an even smaller subset of tests
70+
// set INGRESSPERDOMAIN to false to create LB's ingress by kubectl yaml file
71+
static {
72+
QUICKTEST =
73+
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true");
74+
SMOKETEST =
75+
System.getenv("SMOKETEST") != null && System.getenv("SMOKETEST").equalsIgnoreCase("true");
76+
if (SMOKETEST) {
77+
QUICKTEST = true;
78+
}
79+
if (System.getenv("JENKINS") != null) {
80+
JENKINS = new Boolean(System.getenv("JENKINS")).booleanValue();
81+
}
82+
if (System.getenv("INGRESSPERDOMAIN") != null) {
83+
INGRESSPERDOMAIN = new Boolean(System.getenv("INGRESSPERDOMAIN")).booleanValue();
84+
}
85+
}
86+
4587
public static void initialize(String appPropsFile) throws Exception {
4688

4789
// load app props defined
@@ -96,6 +138,28 @@ public static void initialize(String appPropsFile) throws Exception {
96138
+ "\n"
97139
+ clnResult.stderr());
98140
}
141+
142+
if (System.getenv("JENKINS") != null) {
143+
logger.info("Creating " + resultRoot + "/acceptance_test_tmp");
144+
TestUtils.exec(
145+
"/usr/local/packages/aime/ias/run_as_root \"mkdir -p "
146+
+ resultRoot
147+
+ "/acceptance_test_tmp\"");
148+
TestUtils.exec(
149+
"/usr/local/packages/aime/ias/run_as_root \"chmod 777 "
150+
+ resultRoot
151+
+ "/acceptance_test_tmp\"");
152+
logger.info("Creating " + pvRoot + "/acceptance_test_pv");
153+
TestUtils.exec(
154+
"/usr/local/packages/aime/ias/run_as_root \"mkdir -p "
155+
+ pvRoot
156+
+ "/acceptance_test_pv\"");
157+
TestUtils.exec(
158+
"/usr/local/packages/aime/ias/run_as_root \"chmod 777 "
159+
+ pvRoot
160+
+ "/acceptance_test_pv\"");
161+
}
162+
99163
// create resultRoot, PVRoot, etc
100164
Files.createDirectories(Paths.get(resultRoot));
101165
Files.createDirectories(Paths.get(resultDir));
@@ -543,23 +607,37 @@ private void callWebAppAndVerifyScaling(Domain domain, int replicas) throws Exce
543607
}
544608

545609
public static void tearDown() throws Exception {
610+
logger.log(
611+
Level.INFO,
612+
"TEARDOWN: Starting Test Run TearDown (cleanup and state-dump)."
613+
+ " Note that if the test failed previous to tearDown, "
614+
+ " the error that caused the test failure may be reported "
615+
+ "after the tearDown completes. Note that tearDown itself may report errors,"
616+
+ " but this won't affect the outcome of the test results.");
546617
StringBuffer cmd =
547618
new StringBuffer("export RESULT_ROOT=$RESULT_ROOT && export PV_ROOT=$PV_ROOT && ");
548619
cmd.append(BaseTest.getProjectRoot())
549620
.append("/integration-tests/src/test/resources/statedump.sh");
550621
logger.info("Running " + cmd);
551622

623+
// renew lease before callin statedump.sh
624+
TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
625+
552626
ExecResult result = ExecCommand.exec(cmd.toString());
553627
if (result.exitValue() == 0) {
554-
logger.info("Executed statedump.sh " + result.stdout());
628+
// logger.info("Executed statedump.sh " + result.stdout());
555629
} else {
556630
logger.info("Execution of statedump.sh failed, " + result.stderr() + "\n" + result.stdout());
557631
}
558632

559-
// if (JENKINS) {
560-
result = cleanup();
561-
logger.info("cleanup result =" + result.stdout() + "\n " + result.stderr());
562-
// }
633+
TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
634+
635+
if (JENKINS) {
636+
result = cleanup();
637+
if (result.exitValue() != 0) {
638+
logger.info("cleanup result =" + result.stdout() + "\n " + result.stderr());
639+
}
640+
}
563641

564642
if (getLeaseId() != "") {
565643
logger.info("Release the k8s cluster lease");

0 commit comments

Comments
 (0)