Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py

Issue 1131293005: Allow the IPC fuzzer to use a platform-specific corpus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py
diff --git a/tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py b/tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py
index 595caf1f9f2dd53e9472dd19492856f04235847a..98011c09103b977b6bf4962b87c581a78a0c6843 100755
--- a/tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py
+++ b/tools/ipc_fuzzer/scripts/ipc_fuzzer_mut.py
@@ -41,8 +41,16 @@ class MutationalFuzzer:
chrome_application_directory, self.ipc_replay_binary)
def set_corpus(self):
- input_directory = self.args.input_dir
- entries = os.listdir(input_directory)
+ # Corpus should be set per job as a fuzzer-specific environment variable.
+ try:
+ corpus = os.environ['CORPUS']
inferno 2015/05/11 21:22:43 os.getenv('CORPUS', 'default') is better here. no
+ except KeyError:
+ corpus = 'default'
+ corpus_directory = os.path.join(self.args.input_dir, corpus)
inferno 2015/05/11 21:22:43 new-line before this line.
+ if not os.path.exists(corpus_directory):
+ sys.exit('Corpus directory "%s" not found.' % corpus_directory)
+
+ entries = os.listdir(corpus_directory)
entries = [i for i in entries if i.endswith(utils.IPCDUMP_EXTENSION)]
self.corpus = [os.path.join(input_directory, entry) for entry in entries]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698