# directories not considered as test grids
C_IGNORE_GRIDS = ['.git', '.svn', 'RESSOURCES']
+DEFAULT_TIMEOUT = 150
+
# Get directory to be used for the temporary files.
#
def getTmpDirDEFAULT():
cmd = cmd % { 'user': user,
'base': testbase_base,
'dir': testbase_name }
-
+
+ # Get the application environment
+ self.logger.write(_("Set the application environment\n"), 5)
+ env_appli = src.environment.SalomeEnviron(self.config,
+ src.environment.Environ(dict(os.environ)))
+ env_appli.set_application_env(self.logger)
+
self.logger.write("> %s\n" % cmd, 5)
if src.architecture.is_windows():
# preexec_fn not supported on windows platform
shell=True,
preexec_fn=set_signal,
stdout=self.logger.logTxtFile,
- stderr=subprocess.PIPE)
+ stderr=subprocess.PIPE,
+ env=env_appli.environ.environ,)
if res != 0:
raise src.SatException(_("Error: unable to get test base '%(nam"
launcherDir = os.path.dirname(self.launcher)
if launcherName == 'runAppli':
# Old application
- cmd = "for i in " + launcherDir + "/env.d/*.sh; do source ${i};"
- " done ; echo $KERNEL_ROOT_DIR"
+ cmd = ("for i in " + launcherDir + "/env.d/*.sh; do source ${i};"
+ " done ; echo $KERNEL_ROOT_DIR")
else:
# New application
cmd = ("echo -e 'import os\nprint os.environ[\"KERNEL_" +
"ROOT_DIR\"]' > tmpscript.py; %s shell" +
" tmpscript.py") % self.launcher
- root_dir = subprocess.Popen(cmd,
+
+ # OP 14/11/2017 Ajout de traces pour essayer de decouvrir le pb
+ # de remontee de log des tests
+ #root_dir = subprocess.Popen(cmd,
+ # stdout=subprocess.PIPE,
+ # shell=True,
+ # executable='/bin/bash').communicate()[0].split()[-1]
+ # OP Add Windows case
+ if src.architecture.is_windows():
+ subproc_res = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ shell=True).communicate()
+ pass
+ else:
+ subproc_res = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
shell=True,
- executable='/bin/bash').communicate()[0].split()[-1]
+ executable='/bin/bash').communicate()
+ pass
+ #print "TRACES OP - test_module.py/Test.get_tmp_dir() subproc_res = "
+ #for resLine in subproc_res:
+ # print "- '#%s#'" %resLine
+
+ root_dir = subproc_res[0].split()[-1]
+
+ # OP 14/11/2017 Ajout de traces pour essayer de decouvrir le pb
+ # de remontee de log des tests
+ #print "TRACES OP - test_module.py/Test.get_tmp_dir() root_dir = '#%s#'" %root_dir
# import grid salome_utils from KERNEL that gives
# the right getTmpDir function
-
(file_, pathname, description) = imp.find_module("salome_utils",
[os.path.join(root_dir,
'bin',
return binSalome, binPython, killSalome
# Case where SALOME has the launcher that uses the SalomeContext API
- if VersionSalome >= 730:
- if 'profile' not in self.config.APPLICATION:
- # Before revision of application concept
- launcher_name = self.config.APPLI.launch_alias_name
- binSalome = os.path.join(self.config.APPLICATION.workdir,
- appdir,
- launcher_name)
- else:
- # After revision of application concept
- launcher_name = self.config.APPLICATION.profile.launcher_name
- binSalome = os.path.join(self.config.APPLICATION.workdir,
- launcher_name)
+ else:
+ launcher_name = src.get_launcher_name(self.config)
+ binSalome = os.path.join(self.config.APPLICATION.workdir,
+ launcher_name)
- if src.architecture.is_windows():
- binSalome += '.bat'
-
binPython = binSalome + ' shell'
killSalome = binSalome + ' killall'
return binSalome, binPython, killSalome
self.currentsession)
sessionname = "%s/%s" % (self.currentgrid, self.currentsession)
time_out = self.get_test_timeout(sessionname,
- self.config.SITE.test.timeout)
+ DEFAULT_TIMEOUT)
- time_out_salome = src.get_cfg_param(self.config.SITE.test,
- "timeout_app",
- self.config.SITE.test.timeout)
+ time_out_salome = DEFAULT_TIMEOUT
# generate wrapper script
script_path = os.path.join(out_path, 'wrapperScript.py')
self.nb_run -= 1
elif script_info.res == "?":
self.nb_not_run += 1
+
self.config.TESTS.append(test_info, '')
self.settings.clear()
# read known failures pyconf
- if "testerror" in self.config.SITE:
+ if "testerror" in self.config.LOCAL:
#import testerror
#self.known_errors = testerror.read_test_failures(
# self.config.TOOLS.testerror.file_path,
self.logger.write("\n", 2, False)
# evaluate results
- res_count = "%d / %d" % (self.nb_succeed,
- self.nb_run - self.nb_acknoledge)
res_out = _("Tests Results: %(succeed)d / %(total)d\n") % \
{ 'succeed': self.nb_succeed, 'total': self.nb_run }
if self.nb_timeout > 0:
self.logger.write(_("%d tests TIMEOUT\n") % self.nb_timeout, 1)
- res_count += " TO: %d" % self.nb_timeout
if self.nb_not_run > 0:
self.logger.write(_("%d tests not executed\n") % self.nb_not_run, 1)
- res_count += " NR: %d" % self.nb_not_run
+ if self.nb_acknoledge > 0:
+ self.logger.write(_("%d tests known failures\n") % self.nb_acknoledge, 1)
status = src.OK_STATUS
if self.nb_run - self.nb_succeed - self.nb_acknoledge > 0: