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.
Encapsulate port-related exprs in Nftables::Port
- Loading branch information
1 parent
6739966
commit 09b07e5
Showing
5 changed files
with
23 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Nftables::Port' do | ||
it { is_expected.to allow_value(53) } | ||
it { is_expected.to allow_value([1, 1985, 65_535]) } | ||
it { is_expected.to allow_value('53-55') } | ||
it { is_expected.not_to allow_value('53') } | ||
it { is_expected.not_to allow_value([]) } | ||
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
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,7 @@ | ||
# @summary | ||
# Represents a port expression to be used within a rule. | ||
type Nftables::Port = Variant[ | ||
Array[Stdlib::Port, 1], | ||
Stdlib::Port, | ||
Nftables::Port::Range, | ||
] |
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 port range expression to be used within a rule. | ||
type Nftables::Port::Range = Pattern[/^\d+-\d+$/] |