diff --git a/install.23.sh b/install.23.sh index 993ad41..73abcb6 100755 --- a/install.23.sh +++ b/install.23.sh @@ -1917,14 +1917,17 @@ if [ "${BUILD_MODE}" == "REGULAR" ] || [ "${BUILD_MODE}" == "SLIM" ]; then rm "${ORACLE_HOME}"/lib/*.jar # Remove unnecessary timezone information - rm "${ORACLE_HOME}"/oracore/zoneinfo/readme.txt - rm "${ORACLE_HOME}"/oracore/zoneinfo/timezdif.csv - rm -r "${ORACLE_HOME}"/oracore/zoneinfo/big - rm -r "${ORACLE_HOME}"/oracore/zoneinfo/little - rm "${ORACLE_HOME}"/oracore/zoneinfo/timezone* - mv "${ORACLE_HOME}"/oracore/zoneinfo/timezlrg_40.dat "${ORACLE_HOME}"/oracore/zoneinfo/current.dat - rm "${ORACLE_HOME}"/oracore/zoneinfo/timezlrg* - mv "${ORACLE_HOME}"/oracore/zoneinfo/current.dat "${ORACLE_HOME}"/oracore/zoneinfo/timezlrg_40.dat + # Create temporary folder + mkdir "${ORACLE_HOME}"/oracore/tmp_current_tz + # Move timelrg*.dat with the highest number to temporary folder + mv $(ls -v "${ORACLE_HOME}"/oracore/zoneinfo/timezlrg* | tail -n 1) \ + "${ORACLE_HOME}"/oracore/tmp_current_tz/ + # Delete all remaining folders and files in "zoneinfo" + rm -r "${ORACLE_HOME}"/oracore/zoneinfo/* + # Move current timelrg*.dat file back into place + mv "${ORACLE_HOME}"/oracore/tmp_current_tz/* "${ORACLE_HOME}"/oracore/zoneinfo/ + # Remove temporary folder + rm -r "${ORACLE_HOME}"/oracore/tmp_current_tz # Remove Multimedia rm -r "${ORACLE_HOME}"/ord/im diff --git a/tests/test_container_23.sh b/tests/test_container_23.sh index 1b0addb..2ad8dfe 100755 --- a/tests/test_container_23.sh +++ b/tests/test_container_23.sh @@ -302,3 +302,65 @@ unset EXPECTED_RESULT unset APP_USER unset APP_USER_PASSWORD unset ORACLE_DATABASE + +################################################ +##### Test for timezone file failure (#23) ##### +################################################ + +# Tell test method not to tear down container +NO_TEAR_DOWN="true" +# Let's keep the container name in a var to keep it simple +CONTAINER_NAME="timezone-test" +# Let's keep the test name in a var to keep it simple too +TEST_NAME="TIMEZONE TEST" +# This is what we want to have back from the SQL statement +EXPECTED_RESULT="Hi from your Oracle PDB" +# App user +APP_USER="my_test_user" +# App user password +APP_USER_PASSWORD="ThatAppUserPassword1" +# Oracle PDB +ORACLE_DATABASE="timezone_pdb" + +# Spin up container +runContainerTest "${TEST_NAME}" "${CONTAINER_NAME}" "gvenzl/oracle-free:23.3-slim-faststart" + +# Test the random password, if it works we will get "OK" back from the SQL statement +result=$(podman exec -i ${CONTAINER_NAME} sqlplus -s "${APP_USER}"/"${APP_USER_PASSWORD}"@//localhost/"${ORACLE_DATABASE}" <