Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 1c3a673

Browse files
committed
Coverage task works
1 parent 1b6820c commit 1c3a673

File tree

3 files changed

+14
-28
lines changed

3 files changed

+14
-28
lines changed

src/agent/onefuzz-task/src/local/libfuzzer_basic.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# * ./etc/scaleset_name -> Where I wrote the value `local` / ----- These 2 allow us to omit setting ONEFUZZ_ROOT env var
88
# * ./inputs/
99
# * ./crashes/
10+
# * ./coverage/
1011
# Ideally (in my opinion), this folder/file setup should be automated but remain configurable if desired
1112
# 3. Install llvm and export LLVM_SYMBOLIZER_PATH like we do in setup.sh
1213

@@ -35,10 +36,10 @@ tasks:
3536
# minimized_stack_depth: ""
3637
# check_queue: ""
3738

38-
# - type: "Coverage"
39-
# <<: *target_args
40-
# input_queue:
41-
# path: "./coverage"
42-
# readonly_inputs: []
43-
# module_allowlist: ""
44-
# source_allowlist: ""
39+
- type: "Coverage"
40+
<<: *target_args
41+
target_options:
42+
- "{input}"
43+
input_queue: "./inputs"
44+
readonly_inputs: []
45+
coverage: "./coverage"

src/agent/onefuzz-task/src/local/schema.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,7 @@
106106
}
107107
},
108108
"FolderWatch": {
109-
"type": "object",
110-
"required": [
111-
"path"
112-
],
113-
"properties": {
114-
"path": {
115-
"description": "The path to watch",
116-
"type": "string"
117-
}
118-
}
109+
"type": "string"
119110
},
120111
"TaskConfig": {
121112
"oneOf": [
@@ -286,8 +277,7 @@
286277
],
287278
"properties": {
288279
"coverage": {
289-
"type": "string",
290-
"default": "./onefuzz_coverage.json"
280+
"type": "string"
291281
},
292282
"input_queue": {
293283
"anyOf": [

src/agent/onefuzz-task/src/local/template.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct Coverage {
131131
target_timeout: Option<u64>,
132132
module_allowlist: Option<String>,
133133
source_allowlist: Option<String>,
134-
input_queue: Option<FolderWatch>,
134+
input_queue: FolderWatch,
135135
readonly_inputs: Vec<PathBuf>,
136136
coverage: PathBuf,
137137
}
@@ -194,22 +194,17 @@ impl TaskConfig {
194194
})
195195
.collect();
196196

197-
let input_q_fut: OptionFuture<_> = config
198-
.input_queue
199-
.iter()
200-
.map(|w| context.monitor_dir(w))
201-
.next()
202-
.into();
197+
let input_q_fut = context.monitor_dir(&config.input_queue);
203198

204-
let input_q = input_q_fut.await.transpose()?;
199+
let input_q = input_q_fut.await?;
205200

206201
let coverage_config = crate::tasks::coverage::generic::Config {
207202
target_exe: config.target_exe.clone(),
208203
target_env: config.target_env.clone(),
209204
target_options: config.target_options.clone(),
210205
target_timeout: None,
211206
readonly_inputs: ri?,
212-
input_queue: input_q,
207+
input_queue: Some(input_q),
213208
common: CommonConfig {
214209
task_id: uuid::Uuid::new_v4(),
215210
..context.common.clone()

0 commit comments

Comments
 (0)