forked from voxpupuli/puppet-nftables
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a4ffea
commit 8c00b81
Showing
8 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Nftables::RuleName' do | ||
it { is_expected.to allow_value('chain-rule') } | ||
it { is_expected.to allow_value('Chain_name-Rule_name') } | ||
it { is_expected.to allow_value('chain5_name0-rule_name-3') } | ||
it { is_expected.to allow_value('chain_name-rule2_name-33') } | ||
it { is_expected.to allow_value('chainname-3') } | ||
it { is_expected.not_to allow_value('-rule_name-') } | ||
it { is_expected.not_to allow_value('rule_name') } | ||
it { is_expected.not_to allow_value('chain_name-rule_name-') } | ||
it { is_expected.not_to allow_value('chain_name-rule_name-3b') } | ||
it { is_expected.not_to allow_value('chain_name-rule_name-foo') } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Nftables::SimpleRuleName' do | ||
it { is_expected.to allow_value('rule') } | ||
it { is_expected.to allow_value('Rule_name') } | ||
it { is_expected.to allow_value('rule_name-3') } | ||
it { is_expected.to allow_value('rule_name-33') } | ||
it { is_expected.to allow_value('3') } | ||
it { is_expected.not_to allow_value('rule_name-') } | ||
it { is_expected.not_to allow_value('rule_name-3b') } | ||
it { is_expected.not_to allow_value('rule_name-foo') } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# @summary | ||
# Represents a rule name to be used in a raw rule created via nftables::rule. | ||
# It's a dash separated string. The first component describes the chain to | ||
# add the rule to, the second the rule name and the (optional) third a number. | ||
# Ex: 'default_in-sshd', 'default_out-my_service-2'. | ||
type Nftables::RuleName = Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @summary | ||
# Represents a simple rule name to be used in a rule created via nftables::simplerule | ||
type Nftables::SimpleRuleName = Pattern[/^[a-zA-Z0-9_]+(-\d+)?$/] |