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

tests: import the config fuzzing tests #453

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

daniloegea
Copy link
Collaborator

@daniloegea daniloegea commented Apr 5, 2024

This is a project I've been working. It will use json schemas to generate random YAML files. It implements support for most of the interface types and properties support by Netplan. I used JavaScript (note that I don't have much experience with it :P) to use the json-schema-faker project.

The config_fuzzer will generate random netplan YAML files and use them to test libnetplan.

It also adds a new Github workflow to run the tests. If a crash or memory issue is detected, the workflow will fail in the end. It's being executed in this PR.

There is a lot of room for improvement but this is a good start.

Description

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

@daniloegea daniloegea force-pushed the config_fuzzer_ci branch 2 times, most recently from da985df to 89e5dfb Compare April 5, 2024 12:24
@daniloegea daniloegea changed the title [WIP] tests: import the config fuzzing tests tests: import the config fuzzing tests Apr 5, 2024
@daniloegea daniloegea marked this pull request as ready for review April 5, 2024 12:50
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

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

Introducing some JavaScript code... But this will only be part of our development workflow and seems manageable and extensible. And it already proofed useful (#450, #451).

LGTM overall, I left some tiny inline comments.

We can (should) always extend/adopt the schema descriptions for future Netplan settings.

I see there are some comments in tests/config_fuzzer/runner.sh, can we maybe have a proper tests/config_fuzzer/README.md to document how to use this, e.g. locally?
Maybe we could also move the schema definitions to tests/config_fuzzer/schema/, to unbloat the primary directory of the fuzzer?

.github/workflows/config-fuzzing.yml Outdated Show resolved Hide resolved
tests/config_fuzzer/package.json Outdated Show resolved Hide resolved
The config_fuzzer will generate random netplan YAML files and use them
to test libnetplan.

It also adds a new Github workflow to run the tests. This workflow will
not block merges if it fails.
@daniloegea daniloegea merged commit dca7227 into canonical:main Apr 12, 2024
12 of 16 checks passed
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