From: spo Date: Thu, 3 Sep 2015 11:31:54 +0000 (+0300) Subject: Improve Linux scripts X-Git-Tag: V_1.4.0_beta4~137 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fc33424bb806c86eb577beb3ab1fa20ed87b5c9a;p=modules%2Fshaper.git Improve Linux scripts --- diff --git a/linux_run.sh b/linux_run.sh index 9ec642567..10b611264 100755 --- a/linux_run.sh +++ b/linux_run.sh @@ -8,10 +8,10 @@ source ${a_dir}/env.sh source ${a_dir}/env_standalone.sh if [ -f GDB ]; then - ${INSTALL_DIR}/bin/GeomApp & + ${INSTALL_DIR}/bin/GeomApp >>log_GeomApp 2>>err_GeomApp & APP_PID=$! echo "Connecting GDB to PID ${APP_PID}..." - gdb --command=./commands.gdb - ${APP_PID} >>gdb.log 2>>gdb.err + gdb - ${APP_PID} >>log_gdb_linux 2>>err_gdb_linux else ${INSTALL_DIR}/bin/GeomApp fi diff --git a/salome_run.sh b/salome_run.sh index 9a3fcdbd0..ddb38bb5d 100755 --- a/salome_run.sh +++ b/salome_run.sh @@ -1,34 +1,64 @@ -#!/bin/bash -e +#!/bin/bash -x a_dir=$(dirname $0) cd ${a_dir} -#if [ "$#" = 1 ]; then -# export SALOME_PORT="$1" -#elif [ -z ${SALOME_PORT} ]; then -# export SALOME_PORT=2900 -#fi - -echo "Run SALOME on port ${SALOME_PORT}" - source ${a_dir}/env.sh source ${a_dir}/env_salome.sh -set -x +e - SALOME_ARGS="-r ./test.squish/shared/testdata/SalomeApp.xml" -#SALOME_ARGS="${SALOME_ARGS} --port=${SALOME_PORT}" if [ -f GDB ]; then echo "No --gdb-session" #SALOME_ARGS="${SALOME_ARGS} --gdb-session" fi SALOME_ARGS="${SALOME_ARGS} --ns-port-log=$(pwd)/.salomeport" -${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} 2>&1 >/dev/null & +# kill processes of previous SALOME run +if [ -f .salomeport ]; then + SALOME_PORT=$(cat .salomeport) + ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT} + pkill -f "omniNames -start ${SALOME_PORT}" + rm .salomeport +fi + +${KERNEL_ROOT_DIR}/bin/salome/runSalome.py ${SALOME_ARGS} >log_runSalome 2>err_runSalome & SALOME_PID=$! -wait ${SALOME_PID} -echo "SALOME_PORT=$(cat $(pwd)/.salomeport)" +ATTEMPT=0 +while [[ -f .salomeport && ${ATTEMPT} -lt 5 ]]; do + sleep 5 + SALOME_PORT=$(cat .salomeport) + ATTEMPT=$[${ATTEMPT}+1] +done +if [ ${ATTEMPT} = 5 ]; then + echo "Can not receive SALOME_PORT: file .salomeport does not exist..." + exit 1 +fi + +echo "SALOME_PORT ${SALOME_PORT}" +if [ -f GDB ]; then + SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)" + ATTEMPT=0 + while [[ "${SALOME_SESSION_SERVER_PID}" = "" && "${ATTEMPT}" -lt 5 ]]; do + sleep 5 + SALOME_SESSION_SERVER_PID="$(salome_pid.py ${SALOME_PORT} 'SALOME_Session_Server' 2>/dev/null)" + ATTEMPT=$[${ATTEMPT}+1] + done + if [ ${ATTEMPT} = 5 ]; then + echo "Can not receive SALOME_SESSION_SERVER_PID..." + exit 2 + fi + + echo "SALOME_SESSION_SERVER_PID ${SALOME_SESSION_SERVER_PID}" + echo "Connecting GDB to PID ${SALOME_SESSION_SERVER_PID}..." + gdb - ${SALOME_SESSION_SERVER_PID} >>log_gdb_salome 2>>err_gdb_salome +fi + +wait ${SALOME_PID} + +echo "Kill SALOME on port ${SALOME_PORT}" ${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py ${SALOME_PORT} +pkill -f "omniNames -start ${SALOME_PORT}" + diff --git a/test_squish-vnc.sh b/test_squish-vnc.sh index 1afa54823..3885bbad7 100755 --- a/test_squish-vnc.sh +++ b/test_squish-vnc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e a_dir=$(dirname $0) diff --git a/test_squish.sh b/test_squish.sh index b353af1b7..b1846e5b2 100755 --- a/test_squish.sh +++ b/test_squish.sh @@ -19,7 +19,7 @@ for aut in linux_run.sh salome_run.sh; do done squishserver --config setAUTTimeout 120 squishserver --verbose --port=${SQUISHSERVER_PORT} --stop -squishserver --verbose --port=${SQUISHSERVER_PORT} 1>server.log 2>server.err & +squishserver --verbose --port=${SQUISHSERVER_PORT} 1>log_squishserver 2>err_squishserver & squishrunner --port=${SQUISHSERVER_PORT} --config setCursorAnimation off diff --git a/vnc.sh b/vnc.sh index 6d72768f9..f1811b8f0 100755 --- a/vnc.sh +++ b/vnc.sh @@ -7,4 +7,4 @@ fi echo "DISPLAY is :${DISPLAY_PORT}" export PATH=/dn23/NEWGEOM/NEWGEOM_JENKINS_BUILD_AREA/tools:/opt/TurboVNC/bin:${PATH} -./vnc-run --server-num ${DISPLAY_PORT} -e vnc.err vglrun "$@" +./vnc-run --server-num ${DISPLAY_PORT} -e err_vnc vglrun "$@"