def main(): parser = Args.make_parser( 'Lists the fuzzing corpus instances in CIPD for a named fuzzer') args = parser.parse_args() host = Host() device = Device.from_args(host, args) fuzzer = Fuzzer.from_args(device, args) cipd = Cipd(fuzzer) if not cipd.list(): return 1 return 0
def test_from_args(self): fuzzer = Fuzzer(MockDevice(), u'mock-package1', u'mock-target3') parser = Args.make_parser('description') args = parser.parse_args(['1/3']) cipd = Cipd.from_args(fuzzer, args) self.assertTrue(os.path.exists(cipd.root)) tmp_dir = tempfile.mkdtemp() try: args = parser.parse_args(['1/3', '--staging', tmp_dir]) cipd = Cipd.from_args(fuzzer, args) self.assertEqual(tmp_dir, cipd.root) finally: shutil.rmtree(tmp_dir)
def main(): parser = ArgParser( 'Transfers a fuzzing corpus for a named fuzzer from a device to CIPD') args = parser.parse_args() host = Host.from_build() device = Device.from_args(host, args) fuzzer = Fuzzer.from_args(device, args) if fuzzer.measure_corpus()[0] == 0: print('Ignoring ' + str(fuzzer) + '; corpus is empty.') return 0 with Corpus.from_args(fuzzer, args) as corpus: corpus.pull() cipd = Cipd(corpus) if not args.no_cipd: cipd.create() return 0
def main(): parser = Args.make_parser( 'Transfers a fuzzing corpus for a named fuzzer from a device to CIPD') args = parser.parse_args() host = Host() device = Device.from_args(host, args) fuzzer = Fuzzer.from_args(device, args) if fuzzer.measure_corpus()[0] == 0: print('Ignoring ' + str(fuzzer) + '; corpus is empty.') return 0 with Cipd.from_args(fuzzer, args) as cipd: device.fetch(fuzzer.data_path('corpus/*'), cipd.root) if not cipd.create(): return 1 return 0