blob: c8b372ab847399980ae0c26c70257c35feaa6d5c [file] [log] [blame]
#!/bin/sh
#
# Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
#--- Extract environment properties --- "sed" doesn't work with iastools.zip used in windows
PASSWORD_FILE=${APS_HOME}/devtests/connector/config/password.txt
for x in `cat $APS_HOME/devtests/connector/config/ee-config.properties`
do
varval=`echo $x |cut -d'=' -f1`
if [ $varval = "admin.user" ];
then
AS_ADMIN_USER=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.port" ];
then
AS_ADMIN_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.host" ];
then
AS_ADMIN_HOST=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "orb.port" ];
then
ORB_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "http.port" ];
then
HTTP_LISTENER_1_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "https.port" ];
then
SSL_PORT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "admin.password" ];
then
echo "AS_ADMIN_PASSWORD=`echo $x |cut -d'=' -f2`" > ${PASSWORD_FILE}
echo "AS_ADMIN_ADMINPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE}
fi
if [ $varval = "master.password" ];
then
echo "AS_ADMIN_MASTERPASSWORD=`echo $x |cut -d'=' -f2`" >> ${PASSWORD_FILE}
fi
if [ $varval = "admin.domain" ];
then
AS_ADMIN_DOMAIN=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "nodeagent.name" ];
then
AS_ADMIN_NODEAGENT=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "server.instance.name" ];
then
AS_ADMIN_SERVER=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "cluster.name" ];
then
CLUSTER_NAME=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "clustered.instance.name" ];
then
CLUSTERED_INSTANCE_NAME=`echo $x |cut -d'=' -f2`
fi
if [ $varval = "install.type" ];
then
INSTALL_TYPE=`echo $x |cut -d'=' -f2`
fi
done
ASADMIN=${S1AS_HOME}/bin/asadmin
HTTP_LISTENER_2_PORT="1042"
SSL_MUTUALAUTH_PORT="1058"
JMX_SYSTEM_CONNECTOR_PORT="8687"
export AS_ADMIN_USER
#export AS_ADMIN_PASSWORD ## do not set AS_ADMIN_PASSWORD in env. -password option is deprecated.
export AS_ADMIN_PORT
export AS_ADMIN_HOST
export AS_ADMIN_DOMAIN
export AS_ADMIN_NODEAGENT
export AS_ADMIN_SERVER
export CLUSTER_NAME
export CLUSTERED_INSTANCE_NAME
LOG_DIR=$APS_HOME/devtests/jdbc/logs
if [ ${INSTALL_TYPE} = "standalone" ]; then
# ----------------
# Stop server instance: sqe-server----
echo " EEUNSETUP: stopping sever instance:${AS_ADMIN_SERVER}..."
${ASADMIN} stop-instance \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${AS_ADMIN_SERVER}
${ASADMIN} delete-instance \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${AS_ADMIN_SERVER}
fi
if [ ${INSTALL_TYPE} = "cluster" ]; then
# ----------------
# Create server instance: sqe-server----
echo " EEUNSETUP: stopping cluster ${CLUSTER_NAME}"
${ASADMIN} stop-cluster \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${CLUSTER_NAME}
${ASADMIN} delete-instance \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${CLUSTERED_INSTANCE_NAME}_1
${ASADMIN} delete-instance \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${CLUSTERED_INSTANCE_NAME}_2
${ASADMIN} delete-cluster \
--user ${AS_ADMIN_USER} \
--passwordfile ${PASSWORD_FILE} \
${CLUSTER_NAME}
fi
echo " EEUNSETUP: stopping nodeagent....."
${ASADMIN} stop-node-agent $AS_ADMIN_NODEAGENT
echo " EEUNSETUP: Deleting nodeagent....."
${ASADMIN} delete-node-agent ${AS_ADMIN_NODEAGENT}
echo " EEUNSETUP: Deleting nodeagent config....."
${ASADMIN} delete-node-agent-config --passwordfile ${PASSWORD_FILE} ${AS_ADMIN_NODEAGENT}
echo " EEUNSETUP: stopping domain...."
${ASADMIN} stop-domain ${AS_ADMIN_DOMAIN}
${ASADMIN} delete-domain ${AS_ADMIN_DOMAIN}
echo " EEUNSETUP: EE domain,server instance and nodeagent has been deleted"
rm -f $PASSWORD_FILE
echo " EEUNSETUP: Unsetup complete.... "