# # Test Case using shell script to create, start, stop and destroy child containers # export FUSE_FOLDERNAME="fuse-esb-7.1.0.fuse-046" export BASE_FUSE_DIR="/Users/sjavurek/Fuse/Enterprise/7.1/${FUSE_FOLDERNAME}" export INSTANCES_BASE_FUSE_DIR="/Users/sjavurek/Fuse/Enterprise/7.1/${FUSE_FOLDERNAME}/instances" export FUSE_CLIENT=${BASE_FUSE_DIR}/bin/client export PARENT_SSH_PORT=8101 export USER=admin export PASSWORD=admin # These pertain to Child containers export CHILD1_NAME=imgateway export CHILD1_SSH_PORT=5601 export CHILD1_RMI_SERVER_PORT=5801 export CHILD1_RMI_REGISTRY_PORT=5501 export CHILD1_JAVA_OPTS="-Xms256M -Xmx2048M -XX:PermSize=128M -XX:MaxPermSize=768M" export CHILD2_NAME=hadoop export CHILD2_SSH_PORT=5602 export CHILD2_RMI_SERVER_PORT=5802 export CHILD2_RMI_REGISTRY_PORT=5502 export CHILD2_JAVA_OPTS="-Xms256M -Xmx2048M -XX:PermSize=128M -XX:MaxPermSize=768M" #sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" echo "** Stop Children" sh $INSTANCES_BASE_FUSE_DIR/$CHILD1_NAME/bin/stop sh $INSTANCES_BASE_FUSE_DIR/$CHILD2_NAME/bin/stop #sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" echo " ** Starting children " sh $INSTANCES_BASE_FUSE_DIR/$CHILD1_NAME/bin/start sh $INSTANCES_BASE_FUSE_DIR/$CHILD2_NAME/bin/start #sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:start $CHILD1_NAME" #sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:start $CHILD2_NAME" sleep 10 #sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" echo "" echo "" echo " ** Testing children active " sh $FUSE_CLIENT -a $CHILD1_SSH_PORT -u $USER -p $PASSWORD "features:list |grep jetty" if [[ $? = 0 ]];then echo "" echo "-- Client connected and issued feature:list command to CHILD container $CHILD1_NAME" else echo $? echo "Installation failed - error with the client connection - probably $CHILD1_NAME failed to start" exit 5 fi sh $FUSE_CLIENT -a $CHILD2_SSH_PORT -u $USER -p $PASSWORD "features:list |grep jetty" if [[ $? = 0 ]];then echo "" echo "-- Client connected and issued feature:list command to CHILD container $CHILD2_NAME" else echo $? echo "Installation failed - error with the client connection - probably $CHILD2_NAME failed to start" exit 5 fi echo "--Child containers ${CHILD1_NAME} and ${CHILD2_NAME} started successfully." echo "** Test client connections after patch install" sh $FUSE_CLIENT -a $CHILD1_SSH_PORT -u $USER -p $PASSWORD "features:list |grep jetty" if [[ $? = 0 ]];then echo "" echo "-- Client connected and issued feature:list command to CHILD container $CHILD1_NAME" else echo $? echo "Installation failed - error with the client connection - probably $CHILD1_NAME failed to start" exit 5 fi sh $FUSE_CLIENT -a $CHILD2_SSH_PORT -u $USER -p $PASSWORD "features:list |grep jetty" if [[ $? = 0 ]];then echo "" echo "-- Client connected and issued feature:list command to CHILD container $CHILD2_NAME" else echo $? echo "Installation failed - error with the client connection - probably $CHILD2_NAME failed to start" exit 5 fi echo "--Child containers ${CHILD1_NAME} and ${CHILD2_NAME} started successfully." echo "Sleeping ..." echo sleep 60 sleep 10 echo "Rise and shine ..." echo sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list" sh $FUSE_CLIENT -a $PARENT_SSH_PORT -u $USER -p $PASSWORD "admin:list"