X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestPlc.py;h=a957cd6cdce77323ab74f4c5e3fc73982fcdd13e;hb=d502e1d5482497fd083e028d21f25091a469355b;hp=6c215f57968fb9ac8d5e592125277921f2a7ca1a;hpb=7317850c86d935cf17cbbc53da0b9e169d0f8555;p=tests.git diff --git a/system/TestPlc.py b/system/TestPlc.py index 6c215f5..a957cd6 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -72,7 +72,7 @@ def ignore_result (method): ref_method=TestPlc.__dict__[ref_name] result=ref_method(self) print "Actual - but ignored - result for %(ref_name)s is %(result)s"%locals() - return True + return Ignored (result) wrappee.__doc__="ignored version of " + method.__name__.replace('_ignore','').replace('ignore_','') return wrappee @@ -117,6 +117,10 @@ def auth_sfa_mapper (method): actual.__doc__=TestAuthSfa.__dict__[method.__name__].__doc__ return actual +class Ignored: + def __init__ (self,result): + self.result=result + SEP='' SEPSFA='' @@ -150,7 +154,7 @@ class TestPlc: 'empty_slices', 'ssh_slice_off', SEP, # check they are properly re-created with the same name 'fill_slices', 'ssh_slice_again_ignore', SEP, - 'force_gather_logs', SEP, + 'gather_logs_force', SEP, ] other_steps = [ 'export', 'show_boxes', SEP, @@ -1708,10 +1712,25 @@ class TestPlc: utils.header('Database restored from ' + dump) - @ignore_result - def ssh_slice_again_ignore (self): pass - @ignore_result - def check_initscripts_ignore (self): pass + @staticmethod + def create_ignore_steps (): + for step in TestPlc.default_steps + TestPlc.other_steps: + # default step can have a plc qualifier + if '@' in step: (step,qualifier)=step.split('@') + # or be defined as forced or ignored by default + for keyword in ['_ignore','_force']: + if step.endswith (keyword): step=step.replace(keyword,'') + if step == SEP or step == SEPSFA : continue + method=getattr(TestPlc,step) + name=step+'_ignore' + wrapped=ignore_result(method) +# wrapped.__doc__ = method.__doc__ + " (run in ignore-result mode)" + setattr(TestPlc, name, wrapped) + +# @ignore_result +# def ssh_slice_again_ignore (self): pass +# @ignore_result +# def check_initscripts_ignore (self): pass def standby_1_through_20(self): """convenience function to wait for a specified number of minutes"""