From ac393028ba1a7ca2c20eab672c4e6ccfb8da48c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Mon, 18 Jan 2016 15:16:03 +0100 Subject: [PATCH] remove obsolete scripts --- bin/CMakeLists.txt | 11 +- bin/appli_clean.sh | 4 +- bin/appli_gen.py | 6 +- bin/appliskel/CMakeLists.txt | 6 +- bin/appliskel/runAppli | 63 -------- bin/appliskel/runConsole | 48 ------ bin/appliskel/runSalomeScript | 252 ----------------------------- bin/appliskel/runSession | 131 --------------- bin/runSalome | 73 --------- doc/salome/main.dox | 4 +- doc/salome/running_salome.dox | 39 ++--- src/Launcher/BatchTest.cxx | 56 +++---- src/SALOMEDS/Test/TestSALOMEDS.cxx | 24 +-- 13 files changed, 57 insertions(+), 660 deletions(-) delete mode 100755 bin/appliskel/runAppli delete mode 100755 bin/appliskel/runConsole delete mode 100755 bin/appliskel/runSalomeScript delete mode 100755 bin/appliskel/runSession delete mode 100755 bin/runSalome diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index f97300c1f..587e841fd 100755 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -44,7 +44,7 @@ SET(SCRIPTS orbmodule.py ORBConfigFile.py parseConfigFile.py - runSalome + PortManager.py runSalome.py runSession.py runConsole.py @@ -64,11 +64,4 @@ SET(SCRIPTS waitNS.py ) -IF(SALOME_USE_PORTMANAGER) - SET(PORTMANAGER_SCRIPTS - PortManager.py - ) - LIST(APPEND SCRIPTS ${PORTMANAGER_SCRIPTS}) -ENDIF() - SALOME_INSTALL_SCRIPTS("${SCRIPTS}" ${SALOME_INSTALL_SCRIPT_SCRIPTS}) diff --git a/bin/appli_clean.sh b/bin/appli_clean.sh index 8f7d8b6dd..619ba1cb8 100644 --- a/bin/appli_clean.sh +++ b/bin/appli_clean.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -23,7 +23,7 @@ #clean appli -DELCOM="rm -rf bin lib share doc idl env.d envd USERS getAppliPath.py runAppli runConsole runSession runRemote.sh SalomeApp.xml runSalomeScript update_catalogs.py kill_remote_containers.py salome *.pyc *~ .bashrc" +DELCOM="rm -rf bin lib share doc idl env.d envd USERS getAppliPath.py runRemote.sh SalomeApp.xml update_catalogs.py kill_remote_containers.py salome *.pyc *~ .bashrc" DOIT="false" if [ $# -gt 0 ] diff --git a/bin/appli_gen.py b/bin/appli_gen.py index 1c9383852..10bf434f7 100644 --- a/bin/appli_gen.py +++ b/bin/appli_gen.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -232,11 +232,7 @@ def install(prefix, config_file, verbose=0): for fn in ('envd', 'getAppliPath.py', 'kill_remote_containers.py', - 'runAppli', # OBSOLETE (replaced by salome) - 'runConsole', # OBSOLETE (replaced by salome) 'runRemote.sh', - 'runSalomeScript', # OBSOLETE (replaced by salome) - 'runSession', # OBSOLETE (replaced by salome) 'salome', 'update_catalogs.py', '.bashrc', diff --git a/bin/appliskel/CMakeLists.txt b/bin/appliskel/CMakeLists.txt index 99a628c52..f3e2e73dd 100755 --- a/bin/appliskel/CMakeLists.txt +++ b/bin/appliskel/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -28,10 +28,6 @@ ADD_SUBDIRECTORY(tests) SET(SCRIPTS envd runRemote.sh - runAppli - runConsole - runSession - runSalomeScript .bashrc getAppliPath.py update_catalogs.py diff --git a/bin/appliskel/runAppli b/bin/appliskel/runAppli deleted file mode 100755 index a401333ff..000000000 --- a/bin/appliskel/runAppli +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - - -############################################### -############### IMPORTANT NOTE ################ -############################################### -# The runAppli script is obsolete. # -# Please consider the new salome launcher. # -############################################### - - -#APPLI_HOME=`dirname $0` -APPLI_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# --- retrieve APPLI path, relative to $HOME, set ${APPLI} - -export APPLI=`${APPLI_HOME}/getAppliPath.py` - -# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) - -. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} - -#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS" -export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS" - -# --- if mpi lam, start lam (seems safe to be done several times) -# (manual stop with lamhalt) - -if [ "$LAMBHOST" ]; then - lamboot -fi - -# --- run SALOME -# (default arguments defined in local SalomeApp.xml could be completed -# by arguments to this command) - -if [ $# -ne 0 ] ; then - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* - -else - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py -fi diff --git a/bin/appliskel/runConsole b/bin/appliskel/runConsole deleted file mode 100755 index 8173855a8..000000000 --- a/bin/appliskel/runConsole +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - - -############################################### -############### IMPORTANT NOTE ################ -############################################### -# The runConsole script is obsolete. # -# Please consider the new salome launcher. # -############################################### - - -APPLI_HOME=`dirname $0` - -# --- retrieve APPLI path, relative to $HOME, set ${APPLI} - -export APPLI=`${APPLI_HOME}/getAppliPath.py` - -# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) - -. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} - -#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS" -export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS" - -# --- open a Python interpreter with SALOME environment - -${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i ${KERNEL_ROOT_DIR}/bin/salome/salomeConsole.py $* diff --git a/bin/appliskel/runSalomeScript b/bin/appliskel/runSalomeScript deleted file mode 100755 index 8c0247e96..000000000 --- a/bin/appliskel/runSalomeScript +++ /dev/null @@ -1,252 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -############################################### -############### IMPORTANT NOTE ################ -############################################### -# The runSalomeScript script is obsolete. # -# Please consider the new salome launcher. # -############################################### - -import os,sys,optparse -import socket,shutil -import re - -usage=""" - Connect to a SALOME session (local or remote) and execute a Python script with data files in argument (optional) - - Usage: %prog [ options ] script - - script : The Python script to execute in the SALOME session - - SALOME SESSION - -------------- - If PORT and MACHINE are not given, try to connect to the last active session on the local machine - If PORT and MACHINE are given, try to connect to the remote session associated with PORT on MACHINE - If MACHINE is not given, try to connect to the session associated to PORT on the local machine - If PORT is not given, try to connect to the remote session associated to port 2810 on MACHINE - - If MACHINE isn't localhost or hostname, USER is needed - - If Salome isn't installed on the local machine, use APPLI_DIST to execute a distant session - - - INPUTS AND OUPUTS - ----------------- - script is needed in all case - INPUT and OUTPUT are used only when Salome isn't on local machine. It defines a list of script (full path, blank separated) - Actions done with these two lists are : - - adjustment of path in a temporary script file - - copy of the input files and script file on the distant machine - -""" - -appli_local=os.path.realpath(os.path.dirname(__file__)) - -def get_hostname(): - return socket.gethostname().split('.')[0] - -def vararg_callback(option, opt_str, value, parser): - """optparse callback for variable length arguments""" - assert value is None - - done = 0 - value = [] - rargs = parser.rargs - while rargs: - arg = rargs[0] - - # Stop if we hit an arg like "--foo", "-a", "-fx", "--file=f", - # etc. Note that this also stops on "-3" or "-3.0", so if - # your option takes numeric values, you will need to handle this. - if ((arg[:2] == "--" and len(arg) > 2) or - (arg[:1] == "-" and len(arg) > 1 and arg[1] != "-")): - break - else: - value.append(arg) - del rargs[0] - - setattr(parser.values, option.dest, value) - -def parse_args(): - """parse arguments, check validity and set defaults""" - parser = optparse.OptionParser(usage=usage) - parser.add_option('-p','--port', dest="port", default='', help="The port to connect to") - parser.add_option('-m','--machine', dest="machine", default='', help="The computer to connect to") - parser.add_option('-d','--directory', dest="directory", help="[Distant Mode] The APPLI_HOME path on the distant machine (must be used if Salome isn't on the local machine)") - parser.add_option('-u','--user', dest="user", default='', help="[Distant Mode] The user on the computer to connect to") - parser.add_option('-i','--infiles', dest="infiles", default=[], action="callback", callback=vararg_callback, - help="[Distant Mode] The list of input files (blank separated) used in the Python script") - parser.add_option('-o','--outfiles', dest="outfiles", default=[], action="callback", callback=vararg_callback, - help="[Distant Mode] The list of output files (blank separated) generated by the Python script") - - args=sys.argv[1:] - - script="" - if args: - script=args.pop() - - options, args = parser.parse_args(args) - - #check the arguments - if not os.path.exists(script): - print "ERROR: the script file is mandatory" - sys.exit(1) - - machine=options.machine - port=options.port - user=options.user - infiles = options.infiles - outfiles = options.outfiles - directory=options.directory - - mode="local" - - if machine: - here=get_hostname() - if machine != here and machine != "localhost": - #SALOME server is on a remote computer - mode="remote" - - if not user: - print "ERROR: the remote execution needs -u user argument" - sys.exit(1) - - if not os.path.exists(os.path.join(appli_local,"runSession")): - if not directory: - print "ERROR: the remote execution without SALOME installation needs -d directory argument" - sys.exit(1) - - return mode,user,machine,port,directory,infiles,outfiles,script - -def copy_files(user,machine,script,infiles,outfiles,directory): - """modify script, copy files to remote computer and return lists of copied files""" - - namescript=os.path.basename(script) - import getpass - logname = getpass.getuser() - tmp_script="/tmp/%s_%s_%s" % (logname,os.getpid(),namescript) - with open(script, 'r') as fscript: - script_text=fscript.read() - - list_infiles=[] - list_outfiles=[] - - n=0 - for infile in infiles: - # generate a temporary file name - namefile=os.path.basename(infile) - tmp_file="/tmp/%s_%s_i%s_%s" % (logname,os.getpid(),n,namefile) - - #modify the salome script - script_text = re.sub(infile,tmp_file,script_text) - - # copy the infile to the remote server - cmd="scp %s %s@%s:%s" % (infile,user,machine,tmp_file) - print "[ SCP ]",cmd - os.system(cmd) - - list_infiles.append(tmp_file) - n=n+1 - - n=0 - for outfile in outfiles: - # generate a temporary file name - namefile=os.path.basename(outfile) - tmp_file="/tmp/%s_%s_o%s_%s" % (logname,os.getpid(),n,namefile) - - #modify the salome script - script_text = re.sub(outfile,tmp_file,script_text) - - list_outfiles.append(tmp_file) - n=n+1 - - with open(tmp_script,'w') as fscript: - fscript.write(script_text) - - if directory: - #copy the salome script on the remote server - cmd="scp %s %s@%s:%s" % (tmp_script,user,machine,tmp_script) - print "[ SCP ]",cmd - os.system(cmd) - - return list_infiles, list_outfiles, tmp_script - -def main(): - - mode,user,machine,port,directory,infiles,outfiles,script = parse_args() - - tmp_script=script - - if mode == "remote": - list_infiles, list_outfiles, tmp_script = copy_files(user,machine,script,infiles,outfiles,directory) - - ################################################# - # Execution # - ################################################# - if mode == "remote": - print "[ REMOTE ]" - - # execute runSession from the remote SALOME application - cmd="ssh %s@%s %s/runSession " % (user,machine,directory) - if port: - cmd=cmd+"-p %s "%port - cmd = cmd +"python " + tmp_script - print '[ SSH ] ' + cmd - os.system(cmd) - - else: - print "[ LOCAL ]" - - # execute runSession from the local SALOME application - cmd="%s/runSession " % appli_local - if machine: - cmd=cmd+"-m %s "%machine - if port: - cmd=cmd+"-p %s "%port - cmd = cmd +"python " + tmp_script - print '[ SH ] ' + cmd - os.system(cmd) - - ################################################# - # Get remote files and clean # - ################################################# - if mode == "remote": - temp_files=list_infiles+list_outfiles+[tmp_script] - - #get the outfiles - for outfile in outfiles: - remote_outfile=list_outfiles.pop(0) - cmd="scp %s@%s:%s %s" %(user,machine,remote_outfile,outfile) - print "[ SCP ] "+cmd - os.system(cmd) - - #clean temporary files - cmd="ssh %s@%s \\rm -f %s" % (user,machine," ".join(temp_files)) - print '[ SSH ] ' + cmd - os.system(cmd) - os.remove(tmp_script) - -if __name__ == '__main__': - main() diff --git a/bin/appliskel/runSession b/bin/appliskel/runSession deleted file mode 100755 index b05ff4dec..000000000 --- a/bin/appliskel/runSession +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# Useful shell to run executable progs or shells under Salome env -# Use it with args to run a program : runSession python -i myprog.py -# Use it without args to run an interactive shell under Salome env - - -############################################### -############### IMPORTANT NOTE ################ -############################################### -# The runSession script is obsolete. # -# Please consider the new salome launcher. # -############################################### - - -APPLI_HOME=`dirname $0` - -NSPORT=last -NSHOST=localhost - -usage() -{ - echo "Connect to a SALOME session (local or remote)" - echo "" - echo "Usage: $(basename $0) [ -p PORT ] [ -m MACHINE ] [ -h ] [command]" - echo "" - echo " -p PORT : The port to connect to " - echo " -m MACHINE : The machine to connect to " - echo " -h : Print this message" - echo " command : The command to execute in the SALOME session" - echo "" - echo "If the command is not given a shell is opened" - echo "If PORT and MACHINE are not given, try to connect to the last active session on the local machine" - echo "If PORT and MACHINE are given, try to connect to the remote session associated with PORT on MACHINE" - echo "If MACHINE is not given, try to connect to the session associated to PORT on the local machine" - echo "If PORT is not given, try to connect to the remote session associated to port 2810 on MACHINE" - echo "" -} - -while getopts 'm:p:h' OPTION - do - case $OPTION in - m)NSHOST="$OPTARG" ;; - p)NSPORT="$OPTARG" ;; - h|?) usage - exit 1 ;; - esac - done -shift $(($OPTIND - 1)) - -# --- retrieve APPLI path, relative to $HOME, set ${APPLI} - -export APPLI=`${APPLI_HOME}/getAppliPath.py` - -# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...) - -. ${HOME}/${APPLI}/envd ${HOME}/${APPLI} - -#export OMNIORB_USER_PATH="${HOME}/.salomeConfig/USERS" -export OMNIORB_USER_PATH="${HOME}/${APPLI}/USERS" - -# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME -# Usage: writeConfigFile PORT HOST -function writeConfigFile -{ - if [ $# -ne 2 ]; then - echo "Usage: $0 PORT HOST" - return - fi - export NSPORT=$1 - export NSHOST=$2 - - # Get (in bash) the configuration filename from (Python) ORBConfigFile return values - RETURN_VALUES=$(${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/ORBConfigFile.py ${OMNIORB_USER_PATH} ${NSHOST} ${NSPORT} with_username=${USER}) - export OMNIORB_CONFIG=$(echo ${RETURN_VALUES} | cut -d' ' -f1) -} - - -if test "x${NSPORT}" == "xlast"; then - #PORT is not given - if test "x${NSHOST}" == "xlocalhost"; then - #MACHINE and PORT are not given - # --- set omniORB configuration to current session if any - fileOmniConfig=${OMNIORB_USER_PATH}/.omniORB_${USER}_last.cfg - if [ -f $fileOmniConfig ]; then - export OMNIORB_CONFIG=${OMNIORB_USER_PATH}/.omniORB_${USER}_last.cfg - # --- set environment variables for port and hostname of NamingService - export NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host` - export NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port` - fi - else - #MACHINE is given PORT is not given - writeConfigFile 2810 ${NSHOST} - fi -else - #PORT is given - if test "x${NSHOST}" == "xlocalhost"; then - #MACHINE is not given PORT is given - NSHOST=`hostname` - fi - writeConfigFile ${NSPORT} ${NSHOST} -fi - -# --- invoke shell with or without args - -if [ $# -ne 0 ] ; then - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py -exec $* -else - ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -fi diff --git a/bin/runSalome b/bin/runSalome deleted file mode 100755 index 943957ea9..000000000 --- a/bin/runSalome +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - - -############################################### -############### IMPORTANT NOTE ################ -############################################### -# The runSalome script is obsolete. # -# Please consider the new salome launcher. # -############################################### - - -# ********************************************************** -# This file is used by m4 files in many modules to detect SALOME KERNEL. -# Its initial purpose (starting salome) can be replaced by new salome command. -# When definitively switching from autotools to Cmake, this file may be removed. -# ********************************************************** - - - -${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* - - - - -# ----------------------------------------------------------------------------- -# examples: -# --------- -# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome -# -# - parameters for launching are taken from SalomeApp.xml; -# - if the config file does not exist, it is created with default values. -# -# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome --modules=GEOM,SMESH,VISU,MED --embedded=registry,study,moduleCatalog --standalone=cppContainer --xterm --killall -# -# - parameters from command line supersede those from SalomeApp.xml -# -# Some CORBA servers can be launched in the SALOME_Session_Server's process -# (embedded = same process) or in a separate process (standalone). -# In above example, Registry, Study and Module Catalog servers are started -# in the embedded mode; default C++ container (FactoryServer) is started in -# the standalone mode. -# -# $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome -h -# -# - print help on the runSalome command -# ----------------------------------------------------------------------------- -# -# The -i option starts Python interpreter after launching SALOME session -# (see runSalome.py script). -# Logger server is optional. -# -# ----------------------------------------------------------------------------- diff --git a/doc/salome/main.dox b/doc/salome/main.dox index 8dcfc33df..cffb2fefc 100644 --- a/doc/salome/main.dox +++ b/doc/salome/main.dox @@ -16,9 +16,7 @@ introductory documentation, listed below. See \subpage SALOME_Application to define your own configuration of %SALOME and run it on one or several computers. This is the recommended way of configuration. -# How to launch %SALOME: - - Using a python launcher like the \subpage salome_command. - - Deprecated: Using the shell launchers (runAppli, runSession, runConsole...) alongside configuration files (*.cfg or *.sh), - - Deprecated: Using \c runSalome script, see \subpage running_salome_page + - Using the python \subpage salome_command. -# How to use KERNEL services in Python scripts\n The %SALOME KERNEL offers a list of services available in Python. See \subpage KERNEL_Services. -# How to use KERNEL services from a C++ context\n diff --git a/doc/salome/running_salome.dox b/doc/salome/running_salome.dox index 32cf2e8a7..366bec62d 100644 --- a/doc/salome/running_salome.dox +++ b/doc/salome/running_salome.dox @@ -2,55 +2,36 @@ \page running_salome_page Running Salome -There are two ways to run %SALOME: +To run %SALOME, use the python \ref salome_command. -1) Using a python launcher. +Using this command, you DO NOT need to first set-up proper environment for %SALOME; all is done by the command itself. -For more details see \ref salome_command. - -2) Deprecated : Using shell launchers. - -For more details see \ref SALOME_Application. - -3) Deprecated : Using \c %runSalome script supplied with %SALOME KERNEL module distribution. - -To launch %SALOME using \c %runSalome script, you have first to -set-up proper environment for %SALOME. If you installed %SALOME using -%SALOME Installation Wizard (Linux), you can use \c salome.sh or -\c salome.csh script (that is located in the \c KERNEL_<version> -directory of your %SALOME installation), for example: - -\code -cd /home/user/salome_6.5.0/KERNEL_6.5.0 -source salome.csh -\endcode - -Launch %SALOME session using the \c %runSalome script located -in the \c SALOME/KERNEL/bin/salome directory: +Launch %SALOME session using the following command: \code -runSalome [options] [STUDY_FILE] [PYTHON_FILE [PYTHON_FILE ...]] +salome start [options] [STUDY_FILE] [PYTHON_FILE [args] [PYTHON_FILE [args]...]] \endcode Optionally, you can specify in the command line: - Study (document) file to be opened in %SALOME session passing; - One or more Python scripts to be executed after %SALOME start-up. Python scripts will be executed in the new or opened study - in the order they appear in the command line. + in the order they appear in the command line. Passing args to these scripts + is possible but require a specific \c args: syntax (see \ref salome_command). -The \c %runSalome script supports large set of options that allow +This command supports large set of options that allow specifying the way to launch %SALOME session. Complete description of all options can be obtained using \c --help or -h option: \code -runSalome --help +salome start --help \endcode Here below is a description of most important options: - \c --help or \c -h -Print detail help information on the \c %runSalome script. +Print detail help information on the command. - \c --version @@ -68,7 +49,7 @@ Launch %SALOME session in terminal mode (without GUI). Parse application settings from the <file> instead of default resource file. Default resource file is situated in user's home directory; for -example, for %SALOME version 6.5.0, the file is ${HOME}/.config/salome/.SalomeApprc.6.5.0 +example, for %SALOME version 6.5.0, the file is ${HOME}/.config/salome/.SalomeApprc.6.5.0 - \c --modules=module1,module2,... or \c -m=module1,module2,... diff --git a/src/Launcher/BatchTest.cxx b/src/Launcher/BatchTest.cxx index 47c9bec6d..788aca8b5 100644 --- a/src/Launcher/BatchTest.cxx +++ b/src/Launcher/BatchTest.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -35,7 +35,7 @@ #ifdef WIN32 # include #endif -BatchTest::BatchTest(const Engines::ResourceDefinition& batch_descr) +BatchTest::BatchTest(const Engines::ResourceDefinition& batch_descr) { #ifdef WITH_LIBBATCH _batch_descr = batch_descr; @@ -60,7 +60,7 @@ bool BatchTest::test() { bool rtn = false; - INFOS(std::endl + INFOS(std::endl << "--- Testing batch Machine :" << std::endl << "--- Name : " << _batch_descr.hostname << std::endl << "--- hostname : " << _batch_descr.hostname << std::endl @@ -94,15 +94,15 @@ BatchTest::test() << "--- Submit mpi job : " << result_jobsubmit_mpi << std::endl << "--- Application : " << result_appli << std::endl ); - - if (result_connection == "OK" && + + if (result_connection == "OK" && result_filecopy == "OK" && result_getresult == "OK" && result_jobsubmit_simple == "OK" && result_jobsubmit_mpi == "OK" && result_appli == "OK") rtn = true; - + return rtn; } @@ -227,7 +227,7 @@ BatchTest::test_getresult() command = "scp"; if(protocol == "rsh") command = "rcp"; - command += " " + username + "@" + hostname + ":" + home + command += " " + username + "@" + hostname + ":" + home + "/" + _base_filename + " " + _test_filename + "_copy"; // Test @@ -239,7 +239,7 @@ BatchTest::test_getresult() result += oss.str(); return result; } - + // Compare files std::ifstream src_file(_test_filename.c_str()); if (!src_file) @@ -270,8 +270,8 @@ BatchTest::test_getresult() return result; } -std::string -BatchTest::test_jobsubmit_simple() +std::string +BatchTest::test_jobsubmit_simple() { int status; std::string home; @@ -382,11 +382,11 @@ BatchTest::test_jobsubmit_simple() } std::getline(file_job, jobid); file_job.close(); - + // Wait the end of the job command = protocol + " " + username + "@" + hostname + " qstat -f " + jobid + " > " + file_job_name; bool stop = false; - while (!stop) + while (!stop) { status = system(command.c_str()); if(status && status != 153 && status != 256*153) @@ -411,7 +411,7 @@ BatchTest::test_jobsubmit_simple() command = "scp"; if(protocol == "rsh") command = "rcp"; - command += " " + command += " " + username + "@" + hostname + ":" + home + "/" + _date + "_simple* /tmp"; status = system(command.c_str()); if(status) { @@ -421,7 +421,7 @@ BatchTest::test_jobsubmit_simple() result += oss.str(); return result; } - + // Test results std::string normal_input; std::string file_normal_name = "/tmp/" + _date + "_simple_output.log"; @@ -457,8 +457,8 @@ BatchTest::test_jobsubmit_simple() return result; } -std::string -BatchTest::test_jobsubmit_mpi() +std::string +BatchTest::test_jobsubmit_mpi() { #ifdef WITH_LIBBATCH int status; @@ -605,11 +605,11 @@ BatchTest::test_jobsubmit_mpi() } std::getline(file_job, jobid); file_job.close(); - + // Wait the end of the job command = protocol + " " + username + "@" + hostname + " qstat -f " + jobid + " > " + file_job_name; bool stop = false; - while (!stop) + while (!stop) { status = system(command.c_str()); if(status && status != 153 && status != 256*153) @@ -634,7 +634,7 @@ BatchTest::test_jobsubmit_mpi() command = "scp"; if(protocol == "rsh") command = "rcp"; - command += " " + command += " " + username + "@" + hostname + ":" + home + "/" + _date + "_mpi* /tmp"; status = system(command.c_str()); if(status) { @@ -644,7 +644,7 @@ BatchTest::test_jobsubmit_mpi() result += oss.str(); return result; } - + // Test results std::string normal_input; std::string file_normal_name = "/tmp/" + _date + "_mpi_output.log"; @@ -667,14 +667,14 @@ BatchTest::test_jobsubmit_mpi() return result; } result = "OK"; - return result; + return result; #else throw LauncherException("Method BatchTest::test_jobsubmit_mpi is not available " "(libBatch was not present at compilation time)"); #endif } -std::string +std::string BatchTest::test_appli() { int status; @@ -685,7 +685,7 @@ BatchTest::test_appli() std::string username = _batch_descr.username.in(); std::string protocol = _batch_descr.protocol.in(); std::string applipath = _batch_descr.applipath.in(); - + // Getting home directory std::string rst = get_home(&home); if(rst != "") { @@ -697,7 +697,7 @@ BatchTest::test_appli() std::ofstream file_appli; file_appli.open(_test_file_appli.c_str(), std::ofstream::out); file_appli << "#!/bin/bash\n" - << "if [ -f " << applipath << "/runAppli ]\n" + << "if [ -f " << applipath << "/salome ]\n" << "then\n" << " echo OK\n" << "else\n" @@ -722,8 +722,8 @@ BatchTest::test_appli() } // Launch test - command = protocol + " " + username + "@" + hostname - + " sh " + home + "/" + _base_filename + "_appli_test > " + command = protocol + " " + username + "@" + hostname + + " sh " + home + "/" + _base_filename + "_appli_test > " + _test_filename + "_appli_test_result"; status = system(command.c_str()); @@ -746,7 +746,7 @@ BatchTest::test_appli() } std::getline(file_appli_result, rst_appli); file_appli_result.close(); - + if (rst_appli != "OK") { result += "Error checking application on remote host ! result = " + rst; @@ -769,7 +769,7 @@ BatchTest::get_home(std::string * home) std::string protocol = _batch_descr.protocol.in(); std::string file_home_name = _test_filename + "_home"; - command = protocol + " " + username + "@" + hostname + " 'echo $HOME' > " + file_home_name; + command = protocol + " " + username + "@" + hostname + " 'echo $HOME' > " + file_home_name; status = system(command.c_str()); if(status) { std::ostringstream oss; diff --git a/src/SALOMEDS/Test/TestSALOMEDS.cxx b/src/SALOMEDS/Test/TestSALOMEDS.cxx index 37e77451e..c742383f9 100644 --- a/src/SALOMEDS/Test/TestSALOMEDS.cxx +++ b/src/SALOMEDS/Test/TestSALOMEDS.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -55,7 +55,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( SALOMEDSTest_Embedded ); #ifdef WIN32 #define setenv Kernel_Utils::setenv -#endif +#endif // ============================================================================ /*! @@ -70,10 +70,10 @@ int main(int argc, char* argv[]) setenv("SALOME_trace", "file:./traceUnitTest.log", 1); // 1: overwrite - system("runSalome -t &"); + system("salome -t &"); // --- Wait till SALOMEDS server is launched - + char hostname[511]; int size; gethostname(hostname, size); @@ -87,17 +87,17 @@ int main(int argc, char* argv[]) ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); CORBA::ORB_var orb = init(argc , argv ) ; - + #ifndef WIN32 sleep(15); #else Sleep(15000); #endif - + std::string host; // = Kernel_Utils::GetHostname(); char* wait_Superv = getenv("SALOMEDS_UNITTESTS_WAIT_SUPERVISOR"); - if(wait_Superv) host = Kernel_Utils::GetHostname(); + if(wait_Superv) host = Kernel_Utils::GetHostname(); SALOME_NamingService NS(orb); if(host.empty()) @@ -126,20 +126,20 @@ int main(int argc, char* argv[]) // Activate the objects. This tells the POA that the objects are ready to accept requests. PortableServer::ObjectId_var aStudyManager_iid = poa->activate_object(aStudyManager_i); aStudyManager_i->register_name("/myStudyManager_embedded"); - + // Obtain a POAManager, and tell the POA to start accepting // requests on its objects. PortableServer::POAManager_var pman = poa->the_POAManager(); pman->activate(); } - + // --- Create the event manager and test controller CPPUNIT_NS::TestResult controller; // --- Add a listener that colllects test result CPPUNIT_NS::TestResultCollector result; - controller.addListener( &result ); + controller.addListener( &result ); // --- Add a listener that print dots as test run. #ifdef WIN32 @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) #else CPPUNIT_NS::BriefTestProgressListener progress; #endif - controller.addListener( &progress ); + controller.addListener( &progress ); // --- Get the top level suite from the registry @@ -166,7 +166,7 @@ int main(int argc, char* argv[]) testFile.open("UnitTestsResult", std::ios::out | std::ios::trunc); //CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr ); CPPUNIT_NS::CompilerOutputter outputter( &result, testFile ); - outputter.write(); + outputter.write(); // --- Run the tests. -- 2.39.2