Skip to content

Commit 5486940

Browse files
authored
Merge pull request #6 from oracle/main
merge oracle:main to gnsuryan:main
2 parents 36a6f0b + c6cfdd0 commit 5486940

File tree

5 files changed

+36
-93
lines changed

5 files changed

+36
-93
lines changed

.github/workflows/testWlsVmAdmin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ jobs:
330330
--destination-port-ranges 443 22
331331
fi
332332
333-
echo "Allow access to 7005"
333+
echo "Allow access to ${adminConsolePort}"
334334
az network nsg rule update \
335335
--resource-group $resourceGroup \
336336
--nsg-name ${nsg} \
@@ -388,7 +388,7 @@ jobs:
388388
run: |
389389
echo "Verifying Weblogic Server Access"
390390
echo ${wlsPublicIP}
391-
bash ${{ env.adminOfferPath }}/test/scripts/verify-wls-access.sh <<< "${wlsPublicIP} 7005"
391+
bash ${{ env.adminOfferPath }}/test/scripts/verify-wls-access.sh <<< "${wlsPublicIP} ${adminConsolePort}"
392392
393393
- name: Deploy DB Template to Connect to Azure Postgresql Database
394394
id: enable-postgresql-db

.github/workflows/testWlsVmCluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ jobs:
635635
id: deploy-webapp
636636
run: |
637637
echo "Deploy WebLogic Cafe to server"
638-
timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${adminVMDNS} 7001
638+
timeout 6m sh -c 'until nc -zv $0 $1; do echo "nc rc: $?"; sleep 5; done' ${adminVMDNS} ${adminConsolePort}
639639
bash ${{ env.offerPath }}/test/scripts/deploy-webapp.sh
640640
641641
- name: Verify WebLogicCafe app is successfully deployed

weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/verify-wls-access.sh

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,21 @@
77
#read arguments from stdin
88
read adminPublicIP adminPort
99

10-
isSuccess=false
11-
maxAttempt=5
12-
attempt=1
10+
CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused"
11+
1312
echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready"
14-
while [ $attempt -le $maxAttempt ]
15-
do
16-
echo "Attempt $attempt :- Checking WebLogic admin server is accessible"
17-
curl http://${adminPublicIP}:${adminPort}/weblogic/ready
18-
if [ $? == 0 ]; then
19-
isSuccess=true
20-
break
21-
fi
22-
attempt=`expr $attempt + 1`
23-
sleep 2m
24-
done
13+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready
2514

26-
if [[ $isSuccess == "false" ]]; then
15+
if [[ $? != 0 ]]; then
2716
echo "Failed : WebLogic admin server is not accessible"
2817
exit 1
2918
else
3019
echo "WebLogic admin server is accessible"
3120
fi
3221

33-
sleep 1m
34-
3522
# Verifying whether admin console is accessible
3623
echo "Checking WebLogic admin console is acessible"
37-
curl http://${adminPublicIP}:${adminPort}/console/
24+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/
3825
if [[ $? != 0 ]]; then
3926
echo "WebLogic admin console is not accessible"
4027
exit 1

weblogic-azure-vm/arm-oraclelinux-wls-cluster/test/scripts/verify-wls-access.sh

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,40 @@
1010
#read arguments from stdin
1111
read adminPublicIP adminPort wlsUserName wlspassword managedServers
1212

13-
isSuccess=false
14-
maxAttempt=5
15-
attempt=1
13+
CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused"
14+
1615
echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready"
17-
while [ $attempt -le $maxAttempt ]
18-
do
19-
echo "Attempt $attempt :- Checking WebLogic admin server is accessible"
20-
curl http://${adminPublicIP}:${adminPort}/weblogic/ready
21-
if [ $? == 0 ]; then
22-
isSuccess=true
23-
break
24-
fi
25-
attempt=`expr $attempt + 1`
26-
sleep 2m
27-
done
16+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready
2817

29-
if [[ $isSuccess == "false" ]]; then
18+
if [[ $? != 0 ]]; then
3019
echo "Failed : WebLogic admin server is not accessible"
3120
exit 1
3221
else
3322
echo "WebLogic admin server is accessible"
3423
fi
3524

36-
sleep 1m
37-
3825
# Verifying whether admin console is accessible
3926
echo "Checking WebLogic admin console is acessible"
40-
curl http://${adminPublicIP}:${adminPort}/console/
27+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/
4128
if [[ $? != 0 ]]; then
4229
echo "WebLogic admin console is not accessible"
4330
exit 1
4431
else
4532
echo "WebLogic admin console is accessible"
33+
exit 0
4634
fi
4735

36+
4837
#Verifying whether managed servers are up/running
4938
for managedServer in $managedServers
5039
do
5140
echo "Verifying managed server : $managedServer"
52-
isSuccess=false
53-
maxAttempt=3
54-
attempt=1
55-
while [ $attempt -le $maxAttempt ]
56-
do
57-
curl --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\""
58-
if [ $? == 0 ]; then
59-
isSuccess=true
60-
break
61-
fi
62-
attempt=`expr $attempt + 1 `
63-
sleep 30s
64-
done
65-
if [[ $isSuccess == "false" ]]; then
66-
echo "$managedServer managed server is not in RUNNING state"
67-
exit 1
41+
curl ${CURL_PARMS} --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\""
42+
if [ $? == 0 ]; then
43+
echo "$managedServer managed server is in RUNNING state"
6844
else
69-
echo "$managedServer managed server is in RUNNING state"
45+
echo "$managedServer managed server is not in RUNNING state"
46+
exit 1
7047
fi
7148
done
7249
exit 0
Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,49 @@
11
#!/bin/bash
2+
23
# Copyright (c) 2021, Oracle and/or its affiliates.
34
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4-
#
5+
# Description
6+
# This script is to test WebLogic admin, console and managed servers access.
7+
58
# Verifying admin server is accessible
69

10+
#read arguments from stdin
711
read adminPublicIP adminPort wlsUserName wlspassword managedServers
812

13+
CURL_PARMS="--connect-timeout 60 --max-time 180 --retry 10 --retry-delay 30 --retry-max-time 180 --retry-connrefused"
914

10-
isSuccess=false
11-
maxAttempt=5
12-
attempt=1
1315
echo "Verifying http://${adminPublicIP}:${adminPort}/weblogic/ready"
14-
while [ $attempt -le $maxAttempt ]
15-
do
16-
echo "Attempt $attempt :- Checking WebLogic admin server is accessible"
17-
curl http://${adminPublicIP}:${adminPort}/weblogic/ready
18-
if [ $? == 0 ]; then
19-
isSuccess=true
20-
break
21-
fi
22-
attempt=`expr $attempt + 1`
23-
sleep 2m
24-
done
16+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/weblogic/ready
2517

26-
if [[ $isSuccess == "false" ]]; then
18+
if [[ $? != 0 ]]; then
2719
echo "Failed : WebLogic admin server is not accessible"
2820
exit 1
2921
else
3022
echo "WebLogic admin server is accessible"
3123
fi
3224

33-
sleep 1m
34-
3525
# Verifying whether admin console is accessible
3626
echo "Checking WebLogic admin console is acessible"
37-
curl http://${adminPublicIP}:${adminPort}/console/
27+
curl ${CURL_PARMS} http://${adminPublicIP}:${adminPort}/console/
3828
if [[ $? != 0 ]]; then
3929
echo "WebLogic admin console is not accessible"
4030
exit 1
4131
else
4232
echo "WebLogic admin console is accessible"
33+
exit 0
4334
fi
4435

36+
4537
#Verifying whether managed servers are up/running
4638
for managedServer in $managedServers
4739
do
4840
echo "Verifying managed server : $managedServer"
49-
isSuccess=false
50-
maxAttempt=3
51-
attempt=1
52-
while [ $attempt -le $maxAttempt ]
53-
do
54-
curl --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\""
55-
if [ $? == 0 ]; then
56-
isSuccess=true
57-
break
58-
fi
59-
attempt=`expr $attempt + 1 `
60-
sleep 30s
61-
done
62-
if [[ $isSuccess == "false" ]]; then
63-
echo "$managedServer managed server is not in RUNNING state"
64-
exit 1
41+
curl ${CURL_PARMS} --user $wlsUserName:$wlspassword -X GET -H 'X-Requested-By: MyClient' -H 'Content-Type: application/json' -H 'Accept: application/json' -i "http://${adminPublicIP}:${adminPort}/management/weblogic/latest/domainRuntime/serverRuntimes/$managedServer" | grep "\"state\": \"RUNNING\""
42+
if [ $? == 0 ]; then
43+
echo "$managedServer managed server is in RUNNING state"
6544
else
66-
echo "$managedServer managed server is in RUNNING state"
45+
echo "$managedServer managed server is not in RUNNING state"
46+
exit 1
6747
fi
6848
done
6949
exit 0
70-

0 commit comments

Comments
 (0)