Skip to content

test(fuzz): add native Go fuzzing target for urunc config parsing - #922

Draft
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:feat/fuzz-urunc-config-parsing
Draft

test(fuzz): add native Go fuzzing target for urunc config parsing#922
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:feat/fuzz-urunc-config-parsing

Conversation

@ParthMozarkar

Copy link
Copy Markdown

Summary

This PR introduces native Go fuzzing (go test -fuzz) for system configuration decoding and validation in pkg/unikontainers/urunc_config.go.

This directly addresses part of #852 ("Add fuzzing and robustness testing") by establishing automated fuzz targets for core parsing functions.

Description of Changes

  1. In-Memory Helper: Added ParseUruncConfigBytes(data []byte) (*UruncConfig, error) in pkg/unikontainers/urunc_config.go to allow direct TOML parsing from byte slices without requiring disk file reads.
  2. Unit Tests: Added TestParseUruncConfigBytes in pkg/unikontainers/urunc_config_test.go to verify valid TOML bytes parsing and graceful error handling on malformed bytes.
  3. Go Native Fuzz Target: Implemented FuzzLoadUruncConfig(f *testing.F) in pkg/unikontainers/urunc_config_test.go with seed corpuses for valid TOML configurations, fuzzing TOML decoding and ensuring cfg.Map() invariants hold without panics.

Related Issue

Closes #919

Verification & Testing

  • Ran cross-compilation targeting Linux (GOOS=linux) for pkg/unikontainers.
  • Executed go test -v -fuzz=FuzzLoadUruncConfig -fuzztime=30s ./pkg/unikontainers with 0 panics.

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 3db728d
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a76382c745f490008f0f104

Signed-off-by: ParthMozarkar <greatparth21@gmail.com>
@ParthMozarkar
ParthMozarkar force-pushed the feat/fuzz-urunc-config-parsing branch from ad815af to 3db728d Compare August 7, 2026 19:55
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.

[Feature/Testing]: Add native Go fuzzing target for urunc system configuration loading and validation

1 participant