mirror of https://github.com/google/oss-fuzz.git
[infra] profile command: do not fail hard if some fuzz targets have no corpus. (#1719)
* [infra] profile command: do not fail hard if some fuzz targets have no corpus. * Change listing to corpus_listing to be more explicit. * Address review comment from Abhishek
This commit is contained in:
parent
137bc2c9de
commit
f1e7093d22
|
@ -534,9 +534,19 @@ def _get_latest_corpus(project_name, fuzz_target, base_corpus_dir):
|
||||||
'ls',
|
'ls',
|
||||||
corpus_backup_url
|
corpus_backup_url
|
||||||
]
|
]
|
||||||
output = subprocess.check_output(command).splitlines()
|
|
||||||
|
corpus_listing = subprocess.Popen(
|
||||||
|
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
output, error = corpus_listing.communicate()
|
||||||
|
|
||||||
|
# Some fuzz targets (e.g. new ones) may not have corpus yet, just skip those.
|
||||||
|
if corpus_listing.returncode:
|
||||||
|
print('WARNING: corpus for {0} not found:\n{1}'.format(fuzz_target, error),
|
||||||
|
file=sys.stderr)
|
||||||
|
return
|
||||||
|
|
||||||
if output:
|
if output:
|
||||||
latest_backup_url = output[-1]
|
latest_backup_url = output.splitlines()[-1]
|
||||||
archive_path = corpus_dir + '.zip'
|
archive_path = corpus_dir + '.zip'
|
||||||
command = [
|
command = [
|
||||||
'gsutil',
|
'gsutil',
|
||||||
|
|
Loading…
Reference in New Issue