Skip to content

Commit 13dfd91

Browse files
author
jordanbreen28
committed
Address failing spec tests
1 parent 19df5f6 commit 13dfd91

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

lib/puppet/provider/sqlserver_instance/mssql.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def modify_features(features, action)
6868
begin
6969
config_file = create_temp_for_install_switch unless action == 'uninstall'
7070
cmd_args << "/ConfigurationFile=\"#{config_file.path}\"" unless config_file.nil?
71-
cmd_args << '/UPDATEENABLED=False' if action == 'install'
7271
res = try_execute(cmd_args, "Error trying to #{action} features (#{features.join(', ')}", obfuscated_strings, [0, 1641, 3010])
7372

7473
warn("#{action} of features (#{features.join(', ')}) returned exit code 3010 - reboot required") if res.exitstatus == 3010

spec/unit/puppet/provider/sqlserver_instance_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def stub_uninstall(args, installed_features, exit_code = 0)
5656
'/ACTION=install',
5757
'/Q',
5858
'/IACCEPTSQLSERVERLICENSETERMS',
59-
'/UPDATEENABLED=False',
6059
"/INSTANCENAME=#{execute_args[:name]}",
61-
"/FEATURES=#{execute_args[:features].join(',')}"]
60+
"/FEATURES=#{execute_args[:features].join(',')}",
61+
'/UPDATEENABLED=False']
6262
(execute_args.keys - ['ensure', 'loglevel', 'features', 'name', 'source', 'sql_sysadmin_accounts', 'sql_security_mode', 'install_switches'].map(&:to_sym)).sort.map do |key|
6363
cmd_args << "/#{resourcekey_to_cmdarg[key.to_s]}=\"#{@resource[key]}\""
6464
end

spec/unit/puppet/sqlserver_spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def stub_modify_features(action, args, features, additional_switches = [], exit_
2323
'/Q',
2424
'/IACCEPTSQLSERVERLICENSETERMS',
2525
"/FEATURES=#{features.join(',')}"]
26-
cmds << "/ISSVCACCOUNT=#{args[:is_svc_account]}" if args.key?(:is_svc_account)
2726
cmds << '/UPDATEENABLED=False' if action == 'install'
27+
cmds << "/ISSVCACCOUNT=#{args[:is_svc_account]}" if args.key?(:is_svc_account)
2828
if args.key?(:is_svc_password)
2929
cmds << "/ISSVCPASSWORD=#{args[:is_svc_password]}"
3030
end

spec/unit/puppet_x/sql_connection_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def stub_connection
5151

5252
context 'Use default authentication' do
5353
it 'defauls to SQL_LOGIN if admin_login_type is not set' do
54-
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;User ID=sa;Password=Pupp3t1@')
54+
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;UID=sa;PWD=Pupp3t1@')
5555
subject.open_and_run_command('query', admin_user: 'sa', admin_pass: 'Pupp3t1@')
5656
end
5757
end
@@ -74,11 +74,11 @@ def stub_connection
7474
end
7575

7676
it 'does not add the default instance of MSSQLSERVER to connection string' do
77-
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;User ID=sa;Password=Pupp3t1@')
77+
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;UID=sa;PWD=Pupp3t1@')
7878
subject.open_and_run_command('query', admin_user: 'sa', admin_pass: 'Pupp3t1@', instance_name: 'MSSQLSERVER')
7979
end
8080
it 'adds a non default instance to connection string' do
81-
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.\\LOGGING;DataTypeComptibility=80;User ID=sa;Password=Pupp3t1@')
81+
expect(@connection).to receive(:Open).with('Provider=MSOLEDBSQL;Initial Catalog=master;Application Name=Puppet;Data Source=.\\LOGGING;DataTypeComptibility=80;UID=sa;PWD=Pupp3t1@')
8282
subject.open_and_run_command('query', admin_user: 'sa', admin_pass: 'Pupp3t1@', instance_name: 'LOGGING')
8383
end
8484
end

0 commit comments

Comments
 (0)