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

Add integration tests for nftables package #292

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Jan 4, 2025

Adds integration tests to the nftables package to verify
that the Go code correctly programs nftables rules. The tests use
external nftables scripts to define the expected state and compare
it with the state produced by the Go code.

Copy link
Collaborator

@stapelberg stapelberg left a comment

Choose a reason for hiding this comment

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

Thanks! I originally thought “wait, we already have such an integration test!”, but then I realized it’s not in this repository: The test I had in mind was https://github.com/rtr7/router7/blob/master/integration/netconfig/netconfig_test.go from https://router7.org/

Just a few small changes, very nice overall!

tests/nft_test.go Outdated Show resolved Hide resolved
tests/nft_test.go Outdated Show resolved Hide resolved
tests/nft_test.go Outdated Show resolved Hide resolved
tests/nft_test.go Outdated Show resolved Hide resolved
tests/nft_test.go Outdated Show resolved Hide resolved
.github/workflows/push.yml Outdated Show resolved Hide resolved
@aojea aojea force-pushed the tests branch 3 times, most recently from 0f08738 to 29e428e Compare January 14, 2025 22:04
Change-Id: Ie90d72f48e42c9d896ba302685352295efacc099
Signed-off-by: Antonio Ojea <[email protected]>
@aojea
Copy link
Contributor Author

aojea commented Jan 14, 2025

addressed comments

.github/workflows/push.yml Outdated Show resolved Hide resolved
This commit adds integration tests to the nftables package to verify
that the Go code correctly programs nftables rules. The tests use
external nftables scripts to define the expected state and compare
it with the state produced by the Go code.

Change-Id: I9c8439ee462b4882b221e6244f53379b822446dc
Signed-off-by: Antonio Ojea <[email protected]>
@stapelberg stapelberg merged commit c9a67cc into google:main Jan 15, 2025
2 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