-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2017 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
{
//build more complex file name to support multiple salome session
std::string aFileName = Kernel_Utils::GetTmpFileName();
+ std::ostringstream str_pid;
+ str_pid << ::getpid();
+ aFileName = aFileName + "-" + str_pid.str();
#ifndef WIN32
aFileName += ".sh";
#else
std::string command;
std::string tmpFile = BuildTemporaryFileName();
const ParserResourcesType resInfo(_resManager->GetResourceDefinition(machine));
-
+
if(resInfo.Protocol == sh)
{
return resInfo.HostName;
return false;
}
#endif
-
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2017 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
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+import os
import unittest
import salome
import Engines
</resources>
"""
def setUp(self):
+ self.container_name = "MyContainer-%s"%(os.getpid())
pass
def test0(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="start",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="start",resource_params=rp)
co=cm.GiveContainer( p )
host1=co.getHostName()
- name1="/Containers/%s/MyContainer" % host1
+ name1="/Containers/%s/%s" % (host1,self.container_name)
self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
host2=co.getHostName()
- name2="/Containers/%s/MyContainer" % host2
+ name2="/Containers/%s/%s" % (host2,self.container_name)
self.assertEqual(co._get_name(), name2)
def test1(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="get",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="get",resource_params=rp)
co=cm.GiveContainer( p )
host1=co.getHostName()
- name1="/Containers/%s/MyContainer" % host1
+ name1="/Containers/%s/%s" % (host1,self.container_name)
self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
host2=co.getHostName()
- name2="/Containers/%s/MyContainer" % host2
+ name2="/Containers/%s/%s" % (host2,self.container_name)
self.assertEqual(co._get_name(), name2)
def test2(self):
""""""
rp=LifeCycleCORBA.ResourceParameters(policy="best",componentList=["PYHELLO"])
- p=LifeCycleCORBA.ContainerParameters(container_name="MyContainer",mode="getorstart",resource_params=rp)
+ p=LifeCycleCORBA.ContainerParameters(container_name=self.container_name,mode="getorstart",resource_params=rp)
co=cm.GiveContainer( p )
host1=co.getHostName()
- name1="/Containers/%s/MyContainer" % host1
+ name1="/Containers/%s/%s" % (host1,self.container_name)
self.assertEqual(co._get_name(), name1)
co=cm.GiveContainer( p )
host2=co.getHostName()
- name2="/Containers/%s/MyContainer" % host2
+ name2="/Containers/%s/%s" % (host2,self.container_name)
self.assertEqual(co._get_name(), name2)