tahoe_fuse: system test: Move test summary to end of output.

This commit is contained in:
nejucomo 2008-01-30 02:46:24 -07:00
parent ab3d399ac7
commit 5e94c07045

View File

@ -84,14 +84,14 @@ class SystemTest (object):
Set to False if you wish to analyze a failure. Set to False if you wish to analyze a failure.
''' '''
self.fullcleanup = fullcleanup self.fullcleanup = fullcleanup
print '\n*** Setting up system test.' print '\n*** Setting up system tests.'
try: try:
self.init_cli_layer() failures, total = self.init_cli_layer()
print '\n*** System Tests complete: %d failed out of %d.' % (failures, total)
except self.SetupFailure, sfail: except self.SetupFailure, sfail:
print print
print sfail print sfail
print '\n*** System Tests were not successfully completed.'
print '\n*** System Test complete.'
def init_cli_layer(self): def init_cli_layer(self):
'''This layer finds the appropriate tahoe executable.''' '''This layer finds the appropriate tahoe executable.'''
@ -109,13 +109,13 @@ class SystemTest (object):
version = self.run_tahoe('--version') version = self.run_tahoe('--version')
print 'Using %r with version:\n%s' % (self.cliexec, version.rstrip()) print 'Using %r with version:\n%s' % (self.cliexec, version.rstrip())
self.create_testroot_layer() return self.create_testroot_layer()
def create_testroot_layer(self): def create_testroot_layer(self):
print 'Creating test base directory.' print 'Creating test base directory.'
self.testroot = tempfile.mkdtemp(prefix='tahoe_fuse_test_') self.testroot = tempfile.mkdtemp(prefix='tahoe_fuse_test_')
try: try:
self.launch_introducer_layer() return self.launch_introducer_layer()
finally: finally:
if self.fullcleanup: if self.fullcleanup:
print 'Cleaning up test root directory.' print 'Cleaning up test root directory.'
@ -142,7 +142,7 @@ class SystemTest (object):
try: try:
self.check_tahoe_output(startoutput, ExpectedStartOutput, introbase) self.check_tahoe_output(startoutput, ExpectedStartOutput, introbase)
self.launch_clients_layer(introbase) return self.launch_clients_layer(introbase)
finally: finally:
print 'Stopping introducer node.' print 'Stopping introducer node.'
@ -151,8 +151,7 @@ class SystemTest (object):
TotalClientsNeeded = 3 TotalClientsNeeded = 3
def launch_clients_layer(self, introbase, clientnum = 1): def launch_clients_layer(self, introbase, clientnum = 1):
if clientnum > self.TotalClientsNeeded: if clientnum > self.TotalClientsNeeded:
self.create_test_dirnode_layer() return self.create_test_dirnode_layer()
return
tmpl = 'Launching client %d of %d.' tmpl = 'Launching client %d of %d.'
print tmpl % (clientnum, print tmpl % (clientnum,
@ -184,7 +183,7 @@ class SystemTest (object):
try: try:
self.check_tahoe_output(startoutput, ExpectedStartOutput, base) self.check_tahoe_output(startoutput, ExpectedStartOutput, base)
self.launch_clients_layer(introbase, clientnum+1) return self.launch_clients_layer(introbase, clientnum+1)
finally: finally:
print 'Stopping client node %d.' % (clientnum,) print 'Stopping client node %d.' % (clientnum,)
@ -213,7 +212,7 @@ class SystemTest (object):
f.write(cap) f.write(cap)
f.close() f.close()
self.mount_fuse_layer() return self.mount_fuse_layer(cap)
def mount_fuse_layer(self): def mount_fuse_layer(self):
print 'Mounting fuse interface.' print 'Mounting fuse interface.'
@ -231,7 +230,11 @@ class SystemTest (object):
'--basedir', self.clientbase]) '--basedir', self.clientbase])
# FIXME: Verify the mount somehow? # FIXME: Verify the mount somehow?
self.run_test_layer(mp) # The mount is verified by the test_layer, but we sleep to
# avoid race conditions against the first few tests.
time.sleep(fusepause)
return self.run_test_layer(fusebasecap, mp)
finally: finally:
print '\n*** Cleaning up system test' print '\n*** Cleaning up system test'
@ -259,7 +262,7 @@ class SystemTest (object):
print 'Error in test code... Cleaning up.' print 'Error in test code... Cleaning up.'
raise raise
print '\n*** Testing complete: %d failed out of %d.' % (failures, total) return (failures, total)
# Tests: # Tests: