[svn r37946] setup/teardown hosts correspond

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-05 01:23:14 +01:00
parent c93cfc1e2b
commit 0b9b0909bf
3 changed files with 8 additions and 12 deletions

View File

@ -127,12 +127,8 @@ class HostManager(object):
finishedcallback=donecallback)
rsync.send(root)
def init_hosts(self, reporter):
# hosts ready
def setup_hosts(self, reporter):
self.init_rsync(reporter)
return self.setup_nodes(reporter)
def setup_nodes(self, reporter):
nodes = []
for host in self.hosts:
if hasattr(host.gw, 'remote_exec'): # otherwise dummy for tests :/

View File

@ -133,21 +133,21 @@ class RSession(AbstractSession):
reporter(repevent.TestStarted(hm.hosts))
try:
nodes = hm.init_hosts(reporter)
nodes = hm.setup_hosts(reporter)
reporter(repevent.RsyncFinished())
try:
self.dispatch_tests(nodes, reporter, checkfun)
except (KeyboardInterrupt, SystemExit):
print >>sys.stderr, "C-c pressed waiting for gateways to teardown..."
channels = [node.channel for node in nodes]
hostmanager.kill_channels(channels)
hostmanager.teardown_gateways(reporter, channels)
hm.kill_channels(channels)
hm.teardown_gateways(reporter, channels)
print >>sys.stderr, "... Done"
raise
channels = [node.channel for node in nodes]
hostmanager.teardown_hosts(reporter, channels, nodes,
exitfirst=self.config.option.exitfirst)
hm.teardown_hosts(reporter, channels, nodes,
exitfirst=self.config.option.exitfirst)
reporter(repevent.Nodes(nodes))
retval = reporter(repevent.TestFinished())
self.kill_server(startserverflag)

View File

@ -122,7 +122,7 @@ class TestRSessionRemote(DirSetup):
tmpdir = py.test.ensuretemp("emptyconftest")
config = py.test.config._reparse([tmpdir])
hm = HostManager(config, hosts)
nodes = hm.init_hosts(setup_events.append)
nodes = hm.setup_hosts(setup_events.append)
hm.teardown_hosts(teardown_events.append,
[node.channel for node in nodes], nodes)
@ -147,7 +147,7 @@ class TestRSessionRemote(DirSetup):
config = py.test.config._reparse([])
hm = HostManager(config, hosts=hosts)
nodes = hm.init_hosts(allevents.append)
nodes = hm.setup_hosts(allevents.append)
from py.__.test.rsession.testing.test_executor \
import ItemTestPassing, ItemTestFailing, ItemTestSkipping