Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/login.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@

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

if $check_expiration and !$check_policy {
fail ('Can not have check expiration enabled when check_policy is disabled')
}

$create_delete = $ensure ? {
present => 'create',
absent => 'delete',
Expand Down
5 changes: 5 additions & 0 deletions spec/defines/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@
it_behaves_like 'mssql_tsql command'
it_behaves_like 'mssql_tsql onlyif'
end
describe 'check_policy' do
let(:additional_params) { {:check_policy => false, :check_expiration => true} }
let(:raise_error_check) { 'Can not have check expiration enabled when check_policy is disabled' }
it_should_behave_like 'validation error'
end
end