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

Do not test nftables::rules repeatadly #28

Merged
merged 1 commit into from
Nov 29, 2020

Conversation

traylenator
Copy link
Collaborator

Rather than testing the contents of nftable::rules just test
that nftables::rules instance is correct.

The existing test for the define nftables::rules is enough.

Motivation here is to make changes to nftables::rules easier to handle
down the line.

@traylenator
Copy link
Collaborator Author

These tests pass but I am confused why. Shouldn't the nftables::rule for the bridge br1-2 be.

it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2') }

I'm missing something.

If this is accepted I'll repeat this execise with other cases where nftables::rules and ::chains are being checked
multiple times.

Rather than testing the contents of nftable::rules just test
that nftables::rules instance is correct.

The existing test for the define nftables::rules is enough.

Motivation here is to make changes to nftables::rules easier to handle
down the line.
Copy link
Collaborator

@duritong duritong left a comment

Choose a reason for hiding this comment

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

lgtm

@traylenator
Copy link
Collaborator Author

Why is the passing test

it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_br1') }

and not

it { is_expected.to contain_nftables__rule('default_fwd-bridge_br1_2_br1_2') }

Copy link
Collaborator

@keachi keachi left a comment

Choose a reason for hiding this comment

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

lgtm

@keachi keachi merged commit 72aad4a into voxpupuli:master Nov 29, 2020
@traylenator traylenator added the enhancement New feature or request label Dec 10, 2020
@traylenator traylenator deleted the simplify branch December 15, 2020 10:29
figless pushed a commit to figless/puppet-nftables that referenced this pull request Aug 25, 2021
72aad4a Merge pull request voxpupuli#28 from traylenator/simplify
902ceaa Merge pull request voxpupuli#22 from cernops/log_limit
300b738 Do not test nftables::rules repeatadly
b10c621 Set a customisable rate limit to the logging rules

git-subtree-dir: code
git-subtree-split: 72aad4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants