Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 1 | #!/bin/bash -ex |
| 2 | # |
| 3 | # Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. |
| 4 | # |
| 5 | # This program and the accompanying materials are made available under the |
| 6 | # terms of the Eclipse Public License v. 2.0, which is available at |
| 7 | # http://www.eclipse.org/legal/epl-2.0. |
| 8 | # |
| 9 | # This Source Code may also be made available under the following Secondary |
| 10 | # Licenses when the conditions for such availability set forth in the |
| 11 | # Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
| 12 | # version 2 with the GNU Classpath Exception, which is available at |
| 13 | # https://www.gnu.org/software/classpath/license.html. |
| 14 | # |
| 15 | # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| 16 | # |
| 17 | |
| 18 | list_test_ids(){ |
| 19 | echo batch_all |
| 20 | } |
| 21 | |
| 22 | test_run(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 23 | ${S1AS_HOME}/bin/asadmin start-domain |
| 24 | ${S1AS_HOME}/bin/asadmin start-database |
| 25 | cd ${APS_HOME}/devtests/batch |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 26 | PROXY_HOST=`echo ${http_proxy} | cut -d':' -f2 | ${SED} 's/\/\///g'` |
| 27 | PROXY_PORT=`echo ${http_proxy} | cut -d':' -f3 | ${SED} 's/\///g'` |
| 28 | ANT_OPTS="${ANT_OPTS} \ |
| 29 | -Dhttp.proxyHost=${PROXY_HOST} \ |
| 30 | -Dhttp.proxyPort=${PROXY_PORT} \ |
| 31 | -Dhttp.noProxyHosts='127.0.0.1|localhost|*.oracle.com' \ |
| 32 | -Dhttps.proxyHost=${PROXY_HOST} \ |
| 33 | -Dhttps.proxyPort=${PROXY_PORT} \ |
| 34 | -Dhttps.noProxyHosts='127.0.0.1|localhost|*.oracle.com'" |
| 35 | export ANT_OPTS |
| 36 | echo "ANT_OPTS=${ANT_OPTS}" |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 37 | ant ${TARGET} | tee ${TEST_RUN_LOG} |
| 38 | ${S1AS_HOME}/bin/asadmin stop-database |
| 39 | ${S1AS_HOME}/bin/asadmin stop-domain |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | run_test_id(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 43 | unzip_test_resources ${WORKSPACE}/bundles/glassfish.zip |
| 44 | cd `dirname ${0}` |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 45 | test_init |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 46 | get_test_target ${1} |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 47 | test_run |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 48 | generate_junit_report ${1} |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 49 | change_junit_report_class_names |
| 50 | } |
| 51 | |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 52 | get_test_target(){ |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 53 | case ${1} in |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 54 | batch_all ) |
| 55 | TARGET=all |
| 56 | export TARGET;; |
| 57 | esac |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 58 | } |
| 59 | |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 60 | OPT=${1} |
| 61 | TEST_ID=${2} |
| 62 | source `dirname $0`/../../../common_test.sh |
| 63 | case ${OPT} in |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 64 | list_test_ids ) |
| 65 | list_test_ids;; |
| 66 | run_test_id ) |
Romain Grecourt | f7e3a48 | 2018-11-20 00:47:09 -0800 | [diff] [blame] | 67 | trap "copy_test_artifacts ${TEST_ID}" EXIT |
| 68 | run_test_id ${TEST_ID} ;; |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 69 | esac |