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 = ArgParser( 'Minimizes the current corpus for the named fuzzer. This should be ' + 'used after running the fuzzer for a while, or after incorporating a ' + 'third-party corpus using \'fetch-corpus\'') args, fuzzer_args = parser.parse_known_args() host = Host.from_build() device = Device.from_args(host, args) fuzzer = Fuzzer.from_args(device, args) with Corpus.from_args(fuzzer, args) as corpus: cipd = Cipd(corpus) if not args.no_cipd: cipd.install('latest') corpus.push() if fuzzer.merge(fuzzer_args) == (0, 0): print('Corpus for ' + str(fuzzer) + ' is empty.') return 1 corpus.pull() if not args.no_cipd: cipd.create() return 0