Back to index

salome-kernel  6.5.0
TestLifeCycleCORBA_SWIG.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  File   : TestLifeCycleCORBA_SWIG.py
00025 #  Author : Paul RASCLE, EDF
00026 #  Module : SALOME
00027 #  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/LifeCycleCORBA_SWIG/Test/TestLifeCycleCORBA_SWIG.py,v 1.5.2.2.14.2.12.1 2012-04-12 14:05:16 vsr Exp $
00028 #
00029 import sys, os,signal,string,commands
00030 import runSalome
00031 import setenv
00032 import orbmodule
00033 import TestKiller
00034 import addToKillList
00035 
00036 # get SALOME environment :
00037 
00038 args, modules_list, modules_root_dir = setenv.get_config()
00039 setenv.set_env(args, modules_list, modules_root_dir)
00040 
00041 # set environment for trace in logger
00042 # (with file, servers may be killed before the write to the file...)
00043 
00044 #os.environ["SALOME_trace"] = "file:/tmp/traceUnitTest.log"
00045 #os.environ["SALOME_trace"] = "local"
00046 os.environ["SALOME_trace"] = "with_logger"
00047 
00048 # launch CORBA naming server
00049 
00050 clt=orbmodule.client()
00051 
00052 # launch CORBA logger server
00053 
00054 myServer=runSalome.LoggerServer(args)
00055 myServer.run()
00056 clt.waitLogger("Logger")
00057 
00058 # launch notify server
00059 
00060 myServer=runSalome.NotifyServer(args,modules_root_dir)
00061 myServer.run()
00062 
00063 # launch registry server
00064 
00065 myServer=runSalome.RegistryServer(args)
00066 myServer.run()
00067 clt.waitNS("/Registry")
00068 
00069 # launch module catalog server
00070 
00071 cataServer=runSalome.CatalogServer(args)
00072 cataServer.setpath(modules_list,modules_root_dir)
00073 cataServer.run()
00074 clt.waitNS("/Kernel/ModulCatalog")
00075 
00076 # launch container manager server
00077 
00078 myCmServer = runSalome.LauncherServer(args)
00079 myCmServer.setpath(modules_list,modules_root_dir)
00080 myCmServer.run()
00081 clt.waitNS("/SalomeLauncher")
00082 
00083 # execute Unit Test
00084 
00085 command = ['TestLifeCycleCORBA']
00086 ret = os.spawnvp(os.P_WAIT, command[0], command)
00087 
00088 import LifeCycleCORBA_SWIGTest
00089 import unittest
00090 unittest.TextTestRunner(verbosity=2).run(LifeCycleCORBA_SWIGTest.suite())
00091 
00092 # kill containers created by the Container Manager
00093 
00094 import Engines
00095 launcher = clt.waitNS("/SalomeLauncher",Engines.SalomeLauncher)
00096 launcher.Shutdown()
00097 
00098 # kill Test process
00099 
00100 addToKillList.killList()
00101 
00102 TestKiller.killProcess(runSalome.process_id)