def getExecutionMachines(): if os.environ.has_key("LSB_HOSTS"): hosts = os.environ["LSB_HOSTS"].split() return [ host.split(".")[0] for host in hosts ] else: from plugins import gethostname return [ gethostname() ]
def getRemoteHost(self): if os.name == "posix" and len(self.currTestSelection) > 0: state = self.currTestSelection[0].stateInGui if hasattr(state, "executionHosts") and len(state.executionHosts) > 0: remoteHost = state.executionHosts[0] localhost = plugins.gethostname() if remoteHost != localhost: return remoteHost
def getExecutionMachines(): hostFile = os.getenv("PE_HOSTFILE") if not hostFile or not os.path.isfile(hostFile): return [ gethostname() ] hostlines = open(hostFile).readlines() hostlist = [] for line in hostlines: parts = line.strip().split() if len(parts) < 2: continue host = parts[0].split(".")[0] counter = int(parts[1]) while counter > 0: hostlist.append(host) counter = counter - 1 return hostlist
def getExecutionMachines(self, test): runMachine = test.app.getRunMachine() if runMachine == "localhost": return [ plugins.gethostname() ] else: return [ runMachine ]
def fixDisplay(self, env): # Must make sure SGE jobs don't get a locally referencing DISPLAY display = env.get("DISPLAY") if display and display.startswith(":"): env["DISPLAY"] = plugins.gethostname() + display
def getFullDisplay(self): display = os.getenv("DISPLAY", "") if display.startswith(":"): return plugins.gethostname() + display else: return display.replace("localhost", plugins.gethostname())