def setUp(self): (fd, f) = tempfile.mkstemp(text=True) os.close(fd) self.delete_file(f) self.file = '%s.stderr' % f cfg = { 'runner': { 'runtimeout': 1 }, 'target': { 'cmdline_template': string.Template('PROGRAM $SEEDFILE foo') } } if sys.platform == 'win32': cfg['target']['cmdline_tempate'] = string.Template( 'c:\\cygwin\\bin\\cat.exe -a foo') else: cfg['target']['cmdline_template'] = string.Template('cat -a foo') testcase = Mock() testcase.fuzzedfile = Mock() testcase.fuzzedfile.path = f testcase.fuzzedfile.dirname = os.path.dirname(f) self.se = StdErr(cfg, testcase)
def setUp(self): (fd, f) = tempfile.mkstemp(text=True) os.close(fd) self.delete_file(f) self.file = '%s.stderr' % f cfg = Mock() cfg.progtimeout = 1 if sys.platform == 'win32': cfg.get_command_list = lambda x: ['c:\\cygwin\\bin\\cat.exe', '-a', 'foo'] else: cfg.get_command_list = lambda x: ['cat', '-a', 'foo'] crash = Mock() crash.fuzzedfile = Mock() crash.fuzzedfile.path = f crash.fuzzedfile.dirname = os.path.dirname(f) crash.killprocname = 'bar' self.se = StdErr(cfg, crash)