-
Notifications
You must be signed in to change notification settings - Fork 112
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
Adding a forward option for a zone. #46
Changes from 12 commits
18816ca
069ca05
69e4f47
1884ccb
d5c5ffb
1f747e2
2d64e83
f5fc4aa
946c3a3
d6481f8
2e8242f
6986953
37403d4
a2fe3a5
411f11e
066a565
b353b8f
f6be93a
8c89615
b2ca148
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ | |
context 'passing an array to data' do | ||
let :facts do { :concat_basedir => '/dne', } end | ||
let :params do | ||
{ :allow_transfer => [ '192.0.2.0', '2001:db8::/32' ] } | ||
{ :allow_transfer => [ '192.0.2.0', '2001:db8::/32' ], | ||
:allow_forwarder => ['8.8.8.8', '208.67.222.222'] | ||
} | ||
end | ||
|
||
it 'should pass input validation' do | ||
|
@@ -31,11 +33,26 @@ | |
should contain_concat__fragment('named.conf.local.test.com.include'). | ||
with_content(/192\.0\.2\.0/) | ||
} | ||
|
||
it { | ||
should contain_concat__fragment('named.conf.local.test.com.include'). | ||
with_content(/2001:db8::\/32/) | ||
with_content(/forwarders/) | ||
} | ||
|
||
it { | ||
should contain_concat__fragment('named.conf.local.test.com.include'). | ||
with_content(/forward only;/) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test if failing. I would like to see this in a context of "By default" => it should have content "forward only" And then another context of "When asked to have a forward first policy" => it should have content forward first In order to test both entry points. Bonus points for at test like |
||
} | ||
|
||
it { | ||
should contain_concat__fragment('named.conf.local.test.com.include'). | ||
with_content(/8.8.8.8/) | ||
} | ||
|
||
it { | ||
should contain_concat__fragment('named.conf.local.test.com.include'). | ||
with_content(/2001:db8::\/32/) | ||
} | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you give me another context, something like "When allow_forwarder is not defined" and test that it does not have content with the "forward" stuff? In erb I think that |
||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one way to do it, I would have used validate_re, but this works.