forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduction of health checks + tests bug fix (oracle#621)
* Add return code description * Introduce healthcheck * Remove cleanup call * Make runImageBuildTests prereq for runContainerTests * Change tests order to have newest release first * Add XE test
- Loading branch information
1 parent
66b9b5e
commit 2c75e6a
Showing
11 changed files
with
112 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# LICENSE UPL 1.0 | ||
# | ||
# Copyright (c) 1982-2017 Oracle and/or its affiliates. All rights reserved. | ||
# | ||
# Since: May, 2017 | ||
# Author: [email protected] | ||
# Description: Checks the status of Oracle Database. | ||
# Return codes: 0 = Database is open and ready to use | ||
# 1 = Database is not open | ||
# 2 = Sql Plus execution failed | ||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
# | ||
|
||
ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" | ||
ORAENV_ASK=NO | ||
source oraenv | ||
|
||
# Check Oracle DB status and store it in status | ||
status=`sqlplus -s / as sysdba << EOF | ||
set heading off; | ||
set pagesize 0; | ||
select status from v\\$instance; | ||
exit; | ||
EOF` | ||
# Store return code from SQL*Plus | ||
ret=$? | ||
# SQL Plus execution was successful and database is open | ||
if [ $ret -eq 0 ] && [ "$status" = "OPEN" ]; then | ||
exit 0; | ||
# Database is not open | ||
elif [ "$status" != "OPEN" ]; then | ||
exit 1; | ||
# SQL Plus execution failed | ||
else | ||
exit 2; | ||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,24 +6,16 @@ | |
# Since: May, 2017 | ||
# Author: [email protected] | ||
# Description: Checks the status of Oracle Database. | ||
# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. | ||
# | ||
# Return codes: 0 = Database is open and ready to use | ||
# 1 = Database is not open | ||
# 2 = Sql Plus execution failed | ||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
# | ||
|
||
# Check that ORACLE_HOME is set | ||
if [ "$ORACLE_HOME" == "" ]; then | ||
script_name=`basename "$0"` | ||
echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." | ||
exit 3; | ||
fi; | ||
|
||
# Check that ORACLE_SID is set | ||
if [ "$ORACLE_SID" == "" ]; then | ||
script_name=`basename "$0"` | ||
echo "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." | ||
exit 3; | ||
fi; | ||
ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" | ||
ORACLE_PDB="`ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" | ||
ORAENV_ASK=NO | ||
source oraenv | ||
|
||
# Check Oracle DB status and store it in status | ||
status=`sqlplus -s / as sysdba << EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,24 +6,16 @@ | |
# Since: May, 2017 | ||
# Author: [email protected] | ||
# Description: Checks the status of Oracle Database. | ||
# The ORACLE_HOME, ORACLE_SID and the PATH has to be set. | ||
# | ||
# Return codes: 0 = Database is open and ready to use | ||
# 1 = Database is not open | ||
# 2 = Sql Plus execution failed | ||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
# | ||
|
||
# Check that ORACLE_HOME is set | ||
if [ "$ORACLE_HOME" == "" ]; then | ||
script_name=`basename "$0"` | ||
echo "$script_name: ERROR - ORACLE_HOME is not set. Please set ORACLE_HOME and PATH before invoking this script." | ||
exit 3; | ||
fi; | ||
|
||
# Check that ORACLE_SID is set | ||
if [ "$ORACLE_SID" == "" ]; then | ||
script_name=`basename "$0"` | ||
echo "$script_name: ERROR - ORACLE_SID is not set. Please set ORACLE_SID before invoking this script." | ||
exit 3; | ||
fi; | ||
ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" | ||
ORACLE_PDB="`ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`" | ||
ORAENV_ASK=NO | ||
source oraenv | ||
|
||
# Check Oracle DB status and store it in status | ||
status=`sqlplus -s / as sysdba << EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ | |
# | ||
|
||
# Run image build tests | ||
./runImageBuildTests.sh | ||
./runImageBuildTests.sh && \ | ||
./runContainerTests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters