Skip to content

Commit 7f9d770

Browse files
committed
Merge remote-tracking branch 'origin/jrftest4' into release/2.2
2 parents e6b0a85 + 4959989 commit 7f9d770

File tree

5 files changed

+116
-52
lines changed

5 files changed

+116
-52
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ public void testJRFDomainClusterRestartVersion() throws Exception {
159159
+ ", got: "
160160
+ getMSPodsCount(domain1));
161161
}
162+
163+
testCompletedSuccessfully = true;
164+
162165
} finally {
163166
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
164167
domain1.destroy();
@@ -204,6 +207,8 @@ public void testJRFDomainMSPodCreated() throws Exception {
204207
domain1 = new JRFDomain(domain1Map);
205208
domain1.verifyDomainCreated();
206209

210+
testCompletedSuccessfully = true;
211+
207212
} finally {
208213
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
209214
domain1.destroy();
@@ -249,6 +254,8 @@ public void testJRFDomainCreateDomainScriptsMountPath() throws Exception {
249254
domain1 = new JRFDomain(domain1Map);
250255
domain1.verifyDomainCreated();
251256

257+
testCompletedSuccessfully = true;
258+
252259
} finally {
253260
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
254261
domain1.destroy();
@@ -302,6 +309,8 @@ public void testJRFDomainAdminPortEnabled() throws Exception {
302309
domain1 = new JRFDomain(domain1Map, true);
303310
domain1.verifyDomainCreated();
304311

312+
testCompletedSuccessfully = true;
313+
305314
} finally {
306315
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
307316
domain1.destroy();
@@ -346,6 +355,9 @@ public void testJRFDomainAdminT3Channel() throws Exception {
346355

347356
// verify the Admin T3Channel is exposed
348357
testAdminT3Channel(domain1);
358+
359+
testCompletedSuccessfully = true;
360+
349361
} finally {
350362
if (domain1 != null && (JENKINS || testCompletedSuccessfully)) {
351363
domain1.destroy();
@@ -407,12 +419,13 @@ private void verifyMSPodsNotReadyCountNotExceedMaxUnAvailable(
407419
*/
408420
private int getMSPodsNotReadyCount(JRFDomain domain) throws Exception {
409421

422+
String domainuid = (String) domain.getDomainMap().get("domainUID");
410423
String managedServerNameBase = (String) domain.getDomainMap().get("managedServerNameBase");
411424
StringBuffer cmd = new StringBuffer();
412425
cmd.append("kubectl get pods -n ")
413426
.append(domain.getDomainNS())
414427
.append(" | grep ")
415-
.append(managedServerNameBase)
428+
.append(domainuid + "-" + managedServerNameBase)
416429
.append(" | grep 0/1 | wc -l");
417430
ExecResult result = TestUtils.exec(cmd.toString());
418431

@@ -428,12 +441,13 @@ private int getMSPodsNotReadyCount(JRFDomain domain) throws Exception {
428441
*/
429442
private int getMSPodsRunningAndReadyCount(JRFDomain domain) throws Exception {
430443

444+
String domainuid = (String) domain.getDomainMap().get("domainUID");
431445
String managedServerNameBase = (String) domain.getDomainMap().get("managedServerNameBase");
432446
StringBuffer cmd = new StringBuffer();
433447
cmd.append("kubectl get pods -n ")
434448
.append(domain.getDomainNS())
435449
.append(" | grep ")
436-
.append(managedServerNameBase)
450+
.append(domainuid + "-" + managedServerNameBase)
437451
.append(" | grep 1/1 | grep Running | wc -l");
438452
ExecResult result = TestUtils.exec(cmd.toString());
439453

@@ -448,12 +462,13 @@ private int getMSPodsRunningAndReadyCount(JRFDomain domain) throws Exception {
448462
* @throws Exception - if any error occurs
449463
*/
450464
private int getMSPodsCount(JRFDomain domain) throws Exception {
465+
String domainuid = (String) domain.getDomainMap().get("domainUID");
451466
String managedServerNameBase = (String) domain.getDomainMap().get("managedServerNameBase");
452467
StringBuffer cmd = new StringBuffer();
453468
cmd.append("kubectl get pods -n ")
454469
.append(domain.getDomainNS())
455470
.append(" | grep ")
456-
.append(managedServerNameBase)
471+
.append(domainuid + "-" + managedServerNameBase)
457472
.append(" | wc -l");
458473
ExecResult result = TestUtils.exec(cmd.toString());
459474

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,10 @@ public void testAutoAndCustomSitConfigOverrides() throws Exception {
573573

574574
domain11 = new JRFDomain(domainMap);
575575
domain11.verifyDomainCreated();
576-
testBasicUseCases(domain11);
577-
// Bug 29591809
578-
// TODO: re-enable the test once the bug is fixed
579-
// testAdminT3ChannelWithJMS(domain11);
576+
577+
testAdminT3Channel(domain11);
578+
testAdminServerExternalService(domain11);
579+
580580
testCompletedSuccessfully = true;
581581

582582
} finally {

integration-tests/src/test/resources/domain-home-on-pv/create-jrfdomain-admin-port-enabled.py

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, admin
3434
self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
3535
return
3636

37-
def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
38-
domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
39-
self.extendDomain(domainHome, db, dbPrefix, dbPassword)
37+
def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName, adminPortEnabled, administrationPort,
38+
managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
39+
exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
40+
domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase,
41+
managedServerPort, prodMode, managedCount, clusterName
42+
)
43+
self.extendDomain(domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
44+
t3ChannelPort)
4045

4146
def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
4247
baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
@@ -72,7 +77,6 @@ def createBaseDomain(self, domainName, user, password, adminListenPort, adminNam
7277
cd('SSL/AdminServer')
7378
set('Enabled', 'True')
7479

75-
7680
# Define the user password for weblogic
7781
# =====================================
7882
cd('/Security/' + domainName + '/User/weblogic')
@@ -127,12 +131,17 @@ def createBaseDomain(self, domainName, user, password, adminListenPort, adminNam
127131
return domainHome
128132

129133

130-
def extendDomain(self, domainHome, db, dbPrefix, dbPassword):
134+
def extendDomain(self, domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
135+
t3ChannelPort):
131136
print 'Extending domain at ' + domainHome
132137
print 'Database ' + db
133138
readDomain(domainHome)
134139
setOption('AppDir', self.domainParentDir + '/applications')
135140

141+
print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
142+
if 'true' == exposeAdminT3Channel:
143+
self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
144+
136145
print 'Applying JRF templates...'
137146
for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
138147
addTemplate(self.replaceTokens(extensionTemplate))
@@ -212,6 +221,18 @@ def replaceTokens(self, path):
212221
result = path.replace('@@ORACLE_HOME@@', oracleHome)
213222
return result
214223

224+
def enable_admin_channel(self, admin_channel_address, admin_channel_port):
225+
if admin_channel_address == None or admin_channel_port == 'None':
226+
return
227+
cd('/')
228+
admin_server_name = get('AdminServerName')
229+
print('setting admin server t3channel for ' + admin_server_name)
230+
cd('/Servers/' + admin_server_name)
231+
create('T3Channel', 'NetworkAccessPoint')
232+
cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
233+
set('ListenPort', int(admin_channel_port))
234+
set('PublicPort', int(admin_channel_port))
235+
set('PublicAddress', admin_channel_address)
215236

216237
#############################
217238
# Entry point to the script #
@@ -223,15 +244,17 @@ def usage():
223244
'-rcuDb <rcu-database> -rcuPrefix <rcu-prefix> -rcuSchemaPwd <rcu-schema-password> ' \
224245
'-adminListenPort <adminListenPort> -adminName <adminName> -adminPortEnabled <admin-port-enabled> -administrationPort <admin-port> ' \
225246
'-managedNameBase <managedNameBase> -managedServerPort <managedServerPort> -prodMode <prodMode> ' \
226-
'-managedServerCount <managedCount> -clusterName <clusterName>'
247+
'-managedServerCount <managedCount> -clusterName <clusterName> ' \
248+
'-exposeAdminT3Channel <quoted true or false> -t3ChannelPublicAddress <address of the cluster> ' \
249+
'-t3ChannelPort <t3 channel port> '
227250
sys.exit(0)
228251

229252
# Uncomment for Debug only
230253
#print str(sys.argv[0]) + " called with the following sys.argv array:"
231254
#for index, arg in enumerate(sys.argv):
232255
# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
233256

234-
if len(sys.argv) < 18:
257+
if len(sys.argv) < 21:
235258
usage()
236259

237260
#oracleHome will be passed by command line parameter -oh.
@@ -250,7 +273,9 @@ def usage():
250273
rcuSchemaPrefix = 'DEV12'
251274
#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
252275
rcuSchemaPassword = None
253-
276+
exposeAdminT3Channel = None
277+
t3ChannelPort = None
278+
t3ChannelPublicAddress = None
254279
i = 1
255280
while i < len(sys.argv):
256281
if sys.argv[i] == '-oh':
@@ -307,10 +332,21 @@ def usage():
307332
elif sys.argv[i] == '-clusterName':
308333
clusterName = sys.argv[i + 1]
309334
i += 2
335+
elif sys.argv[i] == '-t3ChannelPublicAddress':
336+
t3ChannelPublicAddress = sys.argv[i + 1]
337+
i += 2
338+
elif sys.argv[i] == '-t3ChannelPort':
339+
t3ChannelPort = sys.argv[i + 1]
340+
i += 2
341+
elif sys.argv[i] == '-exposeAdminT3Channel':
342+
exposeAdminT3Channel = sys.argv[i + 1]
343+
i += 2
310344
else:
311345
print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
312346
usage()
313347
sys.exit(1)
314348

315349
provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
316-
provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword, adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
350+
provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,
351+
adminListenPort, adminName, adminPortEnabled, administrationPort, managedNameBase, managedServerPort, prodMode, managedCount,
352+
clusterName, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)

integration-tests/src/test/resources/domain-home-on-pv/create-jrfdomain-auto-custom-sit-config.py

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.oracle.cie.domain.script.jython.WLSTException as WLSTException
88

9-
109
class Infra12213Provisioner:
1110

1211
MACHINES = {
@@ -29,17 +28,22 @@ class Infra12213Provisioner:
2928
'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ]
3029
}
3130

32-
def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port):
31+
def __init__(self, oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
3332
self.oracleHome = self.validateDirectory(oracleHome)
3433
self.javaHome = self.validateDirectory(javaHome)
3534
self.domainParentDir = self.validateDirectory(domainParentDir, create=True)
3635
return
3736

38-
def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port):
39-
domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port)
40-
self.extendDomain(domainHome, db, dbPrefix, dbPassword)
37+
def createInfraDomain(self, domainName, user, password, db, dbPrefix, dbPassword, adminListenPort, adminName,
38+
managedNameBase, managedServerPort, prodMode, managedCount, clusterName,
39+
exposeAdminT3Channel=None, t3ChannelPublicAddress=None, t3ChannelPort=None):
40+
domainHome = self.createBaseDomain(domainName, user, password, adminListenPort, adminName, managedNameBase,
41+
managedServerPort, prodMode, managedCount, clusterName
42+
)
43+
self.extendDomain(domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
44+
t3ChannelPort)
4145

42-
def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port):
46+
def createBaseDomain(self, domainName, user, password, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName):
4347
baseTemplate = self.replaceTokens(self.JRF_12213_TEMPLATES['baseTemplate'])
4448

4549
readTemplate(baseTemplate)
@@ -63,20 +67,6 @@ def createBaseDomain(self, domainName, user, password, adminListenPort, adminNam
6367
set('ListenPort', admin_port)
6468
set('Name', adminName)
6569

66-
create('T3Channel', 'NetworkAccessPoint')
67-
cd('/Servers/%s/NetworkAccessPoints/T3Channel' % adminName)
68-
set('PublicPort', t3_channel_port)
69-
set('PublicAddress', 'junkvalue')
70-
# Dont set listenaddress, introspector overrides automatically with sit-config
71-
#set('ListenAddress', '%s-%s' % (domain_uid, admin_server_name_svc))
72-
set('ListenPort', t3_channel_port)
73-
74-
cd('/Servers/%s' % adminName)
75-
create(adminName,'Log')
76-
cd('/Servers/%s/Log/%s' % (adminName, adminName))
77-
# Give incorrect filelog, introspector overrides with sit-config
78-
set('FileName', 'dirdoesnotexist')
79-
8070
# Define the user password for weblogic
8171
# =====================================
8272
cd('/Security/' + domainName + '/User/weblogic')
@@ -127,12 +117,17 @@ def createBaseDomain(self, domainName, user, password, adminListenPort, adminNam
127117
return domainHome
128118

129119

130-
def extendDomain(self, domainHome, db, dbPrefix, dbPassword):
120+
def extendDomain(self, domainHome, db, dbPrefix, dbPassword, exposeAdminT3Channel, t3ChannelPublicAddress,
121+
t3ChannelPort):
131122
print 'Extending domain at ' + domainHome
132123
print 'Database ' + db
133124
readDomain(domainHome)
134125
setOption('AppDir', self.domainParentDir + '/applications')
135126

127+
print 'ExposeAdminT3Channel %s with %s:%s ' % (exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)
128+
if 'true' == exposeAdminT3Channel:
129+
self.enable_admin_channel(t3ChannelPublicAddress, t3ChannelPort)
130+
136131
print 'Applying JRF templates...'
137132
for extensionTemplate in self.JRF_12213_TEMPLATES['extensionTemplates']:
138133
addTemplate(self.replaceTokens(extensionTemplate))
@@ -212,6 +207,18 @@ def replaceTokens(self, path):
212207
result = path.replace('@@ORACLE_HOME@@', oracleHome)
213208
return result
214209

210+
def enable_admin_channel(self, admin_channel_address, admin_channel_port):
211+
if admin_channel_address == None or admin_channel_port == 'None':
212+
return
213+
cd('/')
214+
admin_server_name = get('AdminServerName')
215+
print('setting admin server t3channel for ' + admin_server_name)
216+
cd('/Servers/' + admin_server_name)
217+
create('T3Channel', 'NetworkAccessPoint')
218+
cd('/Servers/' + admin_server_name + '/NetworkAccessPoint/T3Channel')
219+
set('ListenPort', int(admin_channel_port))
220+
set('PublicPort', int(admin_channel_port))
221+
set('PublicAddress', 'junkvalue')
215222

216223
#############################
217224
# Entry point to the script #
@@ -223,24 +230,17 @@ def usage():
223230
'-rcuDb <rcu-database> -rcuPrefix <rcu-prefix> -rcuSchemaPwd <rcu-schema-password> ' \
224231
'-adminListenPort <adminListenPort> -adminName <adminName> ' \
225232
'-managedNameBase <managedNameBase> -managedServerPort <managedServerPort> -prodMode <prodMode> ' \
226-
'-managedServerCount <managedCount> -clusterName <clusterName>'
233+
'-managedServerCount <managedCount> -clusterName <clusterName> ' \
234+
'-exposeAdminT3Channel <quoted true or false> -t3ChannelPublicAddress <address of the cluster> ' \
235+
'-t3ChannelPort <t3 channel port> '
227236
sys.exit(0)
228237

229-
def getEnvVar(var):
230-
val=os.environ.get(var)
231-
if val==None:
232-
print "ERROR: Env var ",var, " not set."
233-
sys.exit(1)
234-
return val
235-
236-
t3_channel_port = int(getEnvVar("T3_CHANNEL_PORT"))
237-
238238
# Uncomment for Debug only
239239
#print str(sys.argv[0]) + " called with the following sys.argv array:"
240240
#for index, arg in enumerate(sys.argv):
241241
# print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
242242

243-
if len(sys.argv) < 16:
243+
if len(sys.argv) < 19:
244244
usage()
245245

246246
#oracleHome will be passed by command line parameter -oh.
@@ -259,7 +259,9 @@ def getEnvVar(var):
259259
rcuSchemaPrefix = 'DEV12'
260260
#change rcuSchemaPassword to your infra schema password. Command line parameter -rcuSchemaPwd.
261261
rcuSchemaPassword = None
262-
262+
exposeAdminT3Channel = None
263+
t3ChannelPort = None
264+
t3ChannelPublicAddress = None
263265
i = 1
264266
while i < len(sys.argv):
265267
if sys.argv[i] == '-oh':
@@ -310,10 +312,21 @@ def getEnvVar(var):
310312
elif sys.argv[i] == '-clusterName':
311313
clusterName = sys.argv[i + 1]
312314
i += 2
315+
elif sys.argv[i] == '-t3ChannelPublicAddress':
316+
t3ChannelPublicAddress = sys.argv[i + 1]
317+
i += 2
318+
elif sys.argv[i] == '-t3ChannelPort':
319+
t3ChannelPort = sys.argv[i + 1]
320+
i += 2
321+
elif sys.argv[i] == '-exposeAdminT3Channel':
322+
exposeAdminT3Channel = sys.argv[i + 1]
323+
i += 2
313324
else:
314325
print 'Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])
315326
usage()
316327
sys.exit(1)
317328

318-
provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port)
319-
provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName, t3_channel_port)
329+
provisioner = Infra12213Provisioner(oracleHome, javaHome, domainParentDir, adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount, clusterName)
330+
provisioner.createInfraDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,
331+
adminListenPort, adminName, managedNameBase, managedServerPort, prodMode, managedCount,
332+
clusterName, exposeAdminT3Channel, t3ChannelPublicAddress, t3ChannelPort)

integration-tests/src/test/resources/jrfdomainonpvwlst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# This domain inputs file is used to create domain on pv using wlst option and traefik load balancer.
55

6-
adminServerName: adminserver
6+
adminServerName: admin-server
77
domainUID: jrfdomain
88
clusterName: infra-cluster
99
configuredManagedServerCount: 4

0 commit comments

Comments
 (0)