镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test: add make fuzz and a urunc.json fuzz target - #1095

Open
pocopepe wants to merge 1 commit into
urunc-dev:mainfrom
pocopepe:feat/fuzzing
Open

pocopepe wants to merge 1 commit into
urunc-dev:mainfrom
pocopepe:feat/fuzzing

Conversation

@pocopepe

@pocopepe pocopepe commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Description

Adding a Makefile stub to extend the suite to fuzzing, and a bare bones fuzz target that runs locally and feeds arbitrary bytes as urunc.json through GetUnikernelConfig.

Related issues

How was this tested?

Ran make fuzz

pocopepe@pocopepe:~/urunc$ make fuzz 
Fuzzing FuzzGetUnikernelConfig in pkg/unikontainers/
fuzz: elapsed: 0s, gathering baseline coverage: 0/147 completed
fuzz: elapsed: 1s, gathering baseline coverage: 147/147 completed, now fuzzing with 16 workers
fuzz: elapsed: 3s, execs: 5970 (1987/sec), new interesting: 2 (total: 149)
fuzz: elapsed: 6s, execs: 9173 (1069/sec), new interesting: 4 (total: 151)
fuzz: elapsed: 9s, execs: 15685 (2170/sec), new interesting: 5 (total: 152)
fuzz: elapsed: 12s, execs: 18047 (788/sec), new interesting: 6 (total: 153)
fuzz: elapsed: 15s, execs: 23180 (1711/sec), new interesting: 6 (total: 153)
fuzz: elapsed: 16s, execs: 23180 (0/sec), new interesting: 6 (total: 153)
PASS
ok      github.com/urunc-dev/urunc/pkg/unikontainers    16.095s

LLM usage

N/A

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit b0b1c99
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6ad132b4a4847fb862b280c0

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @pocopepe ,

thank you for the PR. A few questions:

  • Is the first fuzzing example actual or just a placeholder to ensure evrything works well?
  • I do not think we need any discovery loop for fuzzing targets. Instead, we can use fuzzing targets in the same way we use unit tests per packages right now. So we cna name the fuzzing functions with a specific pattern to match a target.

Comment thread Makefile Outdated
fns=$$($(GO) test -list '^Fuzz' ./$$pkg) || exit 1; \
for fn in $$(echo "$$fns" | grep '^Fuzz'); do \
echo "Fuzzing $$fn in $$pkg"; \
$(GO) test -run='^$$' -fuzz="^$$fn$$" -fuzztime=$(FUZZTIME) ./$$pkg || exit 1; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should also add the GOFLAGS=$(TEST_FLAGS) and other test flags that apply cleanly for fuzzing. If they do not apply, we can refactor a bit the existing variables so they cna be more re-usable.

@pocopepe

Copy link
Copy Markdown
Contributor Author

Hi @cmainas,

  • The target isn't a placeholder, it actually fuzzes, checks that urunc returns either a config or an error. It's small, but felt like something worth keeping around.
  • Noted. I was thinking of a ClusterFuzzLite build, where a discovery loop keeps things less hands-on. I'll keep that in its build script instead.

I've made the changes and added the Go flags as well.

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @pocopepe for the fixes in the Makefile.

Since this is an actual fuzzing test, I added some comments. However we need to enrich it in follow ups.

Comment thread pkg/unikontainers/annotations_fuzz_test.go Outdated
Comment thread pkg/unikontainers/annotations_fuzz_test.go Outdated
Ref: urunc-dev#852
Signed-off-by: viju <avijusanjai@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants