Skip to content

Commit 0b75dc2

Browse files
committed
Merge pull request #55 from cyberious/LoginCheckPolicyValidation
Add check for invalid combinination of check_policy and check_expiration
2 parents 5fb8aaa + 9ec5bd3 commit 0b75dc2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

manifests/login.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363

6464
validate_re($login_type,['^(SQL_LOGIN|WINDOWS_LOGIN)$'])
6565

66+
if $check_expiration and !$check_policy {
67+
fail ('Can not have check expiration enabled when check_policy is disabled')
68+
}
69+
6670
$create_delete = $ensure ? {
6771
present => 'create',
6872
absent => 'delete',

spec/defines/login_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@
3535
it_behaves_like 'mssql_tsql command'
3636
it_behaves_like 'mssql_tsql onlyif'
3737
end
38+
describe 'check_policy' do
39+
let(:additional_params) { {:check_policy => false, :check_expiration => true} }
40+
let(:raise_error_check) { 'Can not have check expiration enabled when check_policy is disabled' }
41+
it_should_behave_like 'validation error'
42+
end
3843
end

0 commit comments

Comments
 (0)