Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions client/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,18 @@ func (c *FuzzitClient) uploadCrash(exitCode int) error {
func (c *FuzzitClient) runLibFuzzerFuzzing() error {
ctx := context.Background()

args := []string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
"-error_exitcode=76",
"-max_total_time=3600",
"corpus",
"seed",
}
args := append(
[]string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
"-error_exitcode=76",
"-max_total_time=3600",
},
append(
strings.Split(c.currentJob.Args, " "),
"corpus", "seed",
)...,
)

var err error
err = nil
Expand Down Expand Up @@ -295,11 +299,18 @@ func (c *FuzzitClient) runLibFuzzerRegression() error {
return nil
}

args := append([]string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
"-error_exitcode=76",
}, regressionFiles...)
args := append(
[]string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
"-error_exitcode=76",
},
append(
strings.Split(c.currentJob.Args, " "),
regressionFiles...,
)...,
)

log.Println("Running regression...")
cmd := exec.Command("./fuzzer",
args...)
Expand Down
4 changes: 2 additions & 2 deletions client/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestDownloadAndExtractCorpus(t *testing.T) {
err = tc.client.DownloadAndExtractCorpus(dir, tc.target)
if err != nil {
if err.Error() != tc.err {
t.Errorf("was expecting %s recieved %s", tc.err, err.Error())
t.Errorf("was expecting %s received %s", tc.err, err.Error())
}
} else {
if tc.err != "" {
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestCreateLocalJob(t *testing.T) {
err := tc.client.CreateLocalJob(newJob, []string{"testdata/fuzzer.tar.gz"})
if err != nil {
if err.Error() != tc.err {
t.Errorf("was expecting %s recieved %s", tc.err, err.Error())
t.Errorf("was expecting %s received %s", tc.err, err.Error())
}
} else {
if tc.err != "" {
Expand Down
4 changes: 2 additions & 2 deletions cmd/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ var jobCmd = &cobra.Command{
Args: cobra.MinimumNArgs(2),
Run: func(cmd *cobra.Command, args []string) {
if newJob.Type != "fuzzing" && newJob.Type != "regression" && newJob.Type != "local-regression" {
log.Fatalf("--type should be either fuzzing, regression or local-regression. Recieved: %s", newJob.Type)
log.Fatalf("--type should be either fuzzing, regression or local-regression. Received: %s", newJob.Type)
}

if newJob.Engine != "libfuzzer" && newJob.Engine != "jqf" {
log.Fatalf("--engine should be either libfuzzer or jqf. Recieved: %s", newJob.Type)
log.Fatalf("--engine should be either libfuzzer or jqf. Received: %s", newJob.Type)
}

image := client.HostToDocker[newJob.Host]
Expand Down