Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security/reliability: Add basic fuzz-testing harness #1663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nathaniel-brough
Copy link

No description provided.

@nathaniel-brough
Copy link
Author

If you are not familiar with fuzz testing using golang here is a brief intro on how to get started with this fuzz-testing harness. All you need to do is run;

$ go test -fuzz=FuzzSVG  oss.terrastruct.com/d2/fuzz
fuzz: elapsed: 0s, gathering baseline coverage: 0/51 completed
fuzz: elapsed: 1s, gathering baseline coverage: 51/51 completed, now fuzzing with 8 workers
fuzz: elapsed: 3s, execs: 193 (64/sec), new interesting: 1 (total: 52)
fuzz: elapsed: 6s, execs: 205 (4/sec), new interesting: 2 (total: 53)
fuzz: elapsed: 9s, execs: 300 (32/sec), new interesting: 2 (total: 53)
fuzz: elapsed: 12s, execs: 318 (6/sec), new interesting: 2 (total: 53)
fuzz: elapsed: 15s, execs: 678 (120/sec), new interesting: 3 (total: 54)
fuzz: elapsed: 18s, execs: 932 (85/sec), new interesting: 5 (total: 56)
fuzz: elapsed: 21s, execs: 987 (18/sec), new interesting: 5 (total: 56)
fuzz: elapsed: 24s, execs: 1195 (69/sec), new interesting: 7 (total: 58)
^Cfuzz: elapsed: 27s, execs: 1204 (3/sec), new interesting: 8 (total: 59)
fuzz: elapsed: 27s, execs: 1204 (0/sec), new interesting: 8 (total: 59)
PASS
ok      oss.terrastruct.com/d2/fuzz     27.306s

The fuzz harness will run indefinetely or until;

  • It crashes the d2 library
  • You manually exit (ctrl-C)
  • You specify a timeout on the command line.

Copy link
Collaborator

@alixander alixander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion here: #1664

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants