# tahoe child process is still running.
createoutput = self.run_tahoe('create-introducer', '--basedir', introbase)
- pat = r'^introducer created in (.*?)\n\s*$'
- self.check_tahoe_output(createoutput, pat, introbase)
+ self.check_tahoe_output(createoutput, ExpectedCreationOutput, introbase)
startoutput = self.run_tahoe('start', '--basedir', introbase)
try:
- pat = r'^STARTING (.*?)\nintroducer node probably started\s*$'
- self.check_tahoe_output(startoutput, pat, introbase)
+ self.check_tahoe_output(startoutput, ExpectedStartOutput, introbase)
self.launch_clients_layer(introbase)
base = os.path.join(self.testroot, 'client_%d' % (clientnum,))
output = self.run_tahoe('create-client', '--basedir', base)
- pat = r'^client created in (.*?)\n'
- pat += r' please copy introducer.furl into the directory\s*$'
- self.check_tahoe_output(output, pat, base)
+ self.check_tahoe_output(output, ExpectedCreationOutput, base)
if clientnum == 1:
# The first client is special:
# tahoe child process is still running.
startoutput = self.run_tahoe('start', '--basedir', base)
try:
- pat = r'^STARTING (.*?)\nclient node probably started\s*$'
- self.check_tahoe_output(startoutput, pat, base)
+ self.check_tahoe_output(startoutput, ExpectedStartOutput, base)
self.launch_clients_layer(introbase, clientnum+1)
if listing:
raise self.TestFailure('Expected empty directory, found: %r' % (listing,))
-
# Utilities:
def run_tahoe(self, *args):
realargs = ('tahoe',) + args
tmpl = 'The output of tahoe did not match the expectation:\n'
tmpl += 'Expected regex: %s\n'
tmpl += 'Actual output: %r\n'
- raise self.SetupFailure(tmpl, expected, output)
+ self.warn(tmpl, expected, output)
- if expdir != m.group(1):
+ elif expdir != m.group('path'):
tmpl = 'The output of tahoe refers to an unexpected directory:\n'
tmpl += 'Expected directory: %r\n'
tmpl += 'Actual directory: %r\n'
- raise self.SetupFailure(tmpl, expdir, m.group(1))
+ self.warn(tmpl, expdir, m.group(1))
def stop_node(self, basedir):
try:
tmpl += 'Waited %.2f seconds (%d polls).'
raise self.SetupFailure(tmpl, totaltime, attempt+1)
+ def warn(self, tmpl, *args):
+ print ('Test Warning: ' + tmpl) % args
+
# SystemTest Exceptions:
class Failure (Exception):
exitcode = p.wait()
return (exitcode, output)
-
+
+ExpectedCreationOutput = r'(introducer|client) created in (?P<path>.*?)\n'
+ExpectedStartOutput = r'STARTING (?P<path>.*?)\n(introducer|client) node probably started'
+
+
Usage = '''
Usage: %s [target]