Skip to content

(MODULES-10335) - Update exec's title to be unique #341

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

Merged
merged 1 commit into from
Jan 20, 2020
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: 2 additions & 2 deletions manifests/sp_configure.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

if $restart {
Sqlserver_tsql["sp_configure-${instance}-${config_name}"] ~> Exec["restart-service-${service_name}"]
Sqlserver_tsql["sp_configure-${instance}-${config_name}"] ~> Exec["restart-service-${service_name}-${config_name}"]
}

sqlserver_tsql{ "sp_configure-${instance}-${config_name}":
Expand All @@ -51,7 +51,7 @@
require => Sqlserver::Config[$instance]
}

exec{"restart-service-${service_name}":
exec{"restart-service-${service_name}-${config_name}":
command => template('sqlserver/restart_service.ps1.erb'),
provider => powershell,
logoutput => true,
Expand Down
44 changes: 44 additions & 0 deletions spec/acceptance/sqlserver_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def run_sql_query_opts(query, expected_row_count)
sqlserver::database{'#{@db_name}':
ensure => 'absent',
}
sqlserver::database{'#{@db_name}-2':
ensure => 'absent',
}
MANIFEST
ensure_sqlserver_database(pp)
end
Expand Down Expand Up @@ -310,5 +313,46 @@ def run_sql_query_opts(query, expected_row_count)
run_sql_query(host, run_sql_query_opts(query, 1))
# rubocop:enable RSpec/InstanceVariable
end

it 'Test Case MODULES-10335: Create two database with seperate sp_configure', tier_low: true do
pp = <<-MANIFEST
sqlserver::config{'MSSQLSERVER':
admin_user => 'sa',
admin_pass => 'Pupp3t1@',
}
sqlserver::sp_configure{ 'sp_config4db':
config_name => 'contained database authentication',
value => 1,
reconfigure => true,
instance => 'MSSQLSERVER',
}
sqlserver::database{ '#{@db_name}':
require => Sqlserver::Sp_configure['sp_config4db']
}
sqlserver_tsql{'testsqlserver_tsql':
instance => 'MSSQLSERVER',
database => '#{@db_name}',
command => "CREATE TABLE #{@table_name} (id INT, name VARCHAR(20), email VARCHAR(20));",
require => Sqlserver::Database['#{@db_name}'],
}
sqlserver::sp_configure{ 'sp_config5db':
config_name => 'contained database authentication',
value => 1,
reconfigure => true,
instance => 'MSSQLSERVER',
}
sqlserver::database{ '#{@db_name}-2':
require => Sqlserver::Sp_configure['sp_config5db']
}
sqlserver_tsql{'testsqlserver_tsql':
instance => 'MSSQLSERVER',
database => '#{@db_name}-2',
command => "CREATE TABLE #{@table_name} (id INT, name VARCHAR(20), email VARCHAR(20));",
require => Sqlserver::Database['#{@db_name}-2'],
}
MANIFEST
ensure_sqlserver_database(pp)
# rubocop:enable RSpec/InstanceVariable
end
end
end
2 changes: 1 addition & 1 deletion spec/defines/sp_configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

describe 'service' do
it 'is defined' do
is_expected.to contain_exec('restart-service-MSSQLSERVER').with_refreshonly(true)
is_expected.to contain_exec('restart-service-MSSQLSERVER-filestream access level').with_refreshonly(true)
end
end
end