From: nejucomo Date: Wed, 30 Jan 2008 08:10:53 +0000 (-0700) Subject: tahoe_fuse: system test: Make output checking into non-fatal warnings, and make patte... X-Git-Tag: allmydata-tahoe-0.8.0~168 X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/somewhere?a=commitdiff_plain;h=98e92e2a482fd232b597819c11279254f94801de;p=tahoe-lafs%2Ftahoe-lafs.git tahoe_fuse: system test: Make output checking into non-fatal warnings, and make patterns looser. --- diff --git a/contrib/fuse/runtests.py b/contrib/fuse/runtests.py index d38c2b82..b55673dd 100644 --- a/contrib/fuse/runtests.py +++ b/contrib/fuse/runtests.py @@ -130,13 +130,11 @@ class SystemTest (object): # 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) @@ -157,9 +155,7 @@ class SystemTest (object): 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: @@ -180,8 +176,7 @@ class SystemTest (object): # 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) @@ -267,7 +262,6 @@ class SystemTest (object): if listing: raise self.TestFailure('Expected empty directory, found: %r' % (listing,)) - # Utilities: def run_tahoe(self, *args): realargs = ('tahoe',) + args @@ -291,13 +285,13 @@ class SystemTest (object): 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: @@ -347,6 +341,9 @@ class SystemTest (object): 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): @@ -390,7 +387,11 @@ def gather_output(*args, **kwargs): exitcode = p.wait() return (exitcode, output) - + +ExpectedCreationOutput = r'(introducer|client) created in (?P.*?)\n' +ExpectedStartOutput = r'STARTING (?P.*?)\n(introducer|client) node probably started' + + Usage = ''' Usage: %s [target]