Skip to content

Commit 7ec8cda

Browse files
Zach ReichertIristyle
Zach Reichert
authored andcommitted
(maint) modify acceptance install for new config
- Introduce new sql_host role that can be used to identify a node to install SQL Server on. - Add additional metadata called sql_version to each node definition to specify installation of SQL 2012 or 2014
1 parent 28cf097 commit 7ec8cda

File tree

3 files changed

+26
-39
lines changed

3 files changed

+26
-39
lines changed

spec/acceptance/nodesets/windows-2012r2-64a-inverted.yml renamed to spec/acceptance/nodesets/win_2012r2_sql2012.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,19 @@ HOSTS:
77
platform: debian-6-i386
88
template: debian-6-i386
99
hypervisor: vcloud
10-
sql2012:
10+
win2012r2:
1111
roles:
1212
- agent
13-
- default
14-
- sql2012
15-
platform: windows-2012r2-x86_64
16-
template: win-2012r2-x86_64
17-
hypervisor: vcloud
18-
sql2014:
19-
roles:
20-
- agent
21-
- sql2014
13+
- sql_host
2214
platform: windows-2012r2-x86_64
2315
template: win-2012r2-x86_64
2416
hypervisor: vcloud
17+
sql_version: 2012
2518
CONFIG:
2619
nfs_server: none
2720
consoleport: 443
2821
datastore: instance0
2922
folder: Delivery/Quality Assurance/FOSS/Dynamic
3023
resourcepool: delivery/Quality Assurance/FOSS/Dynamic
3124
pooling_api: http://vcloud.delivery.puppetlabs.net/
25+
forge_host: api-module-staging.puppetlabs.com

spec/spec_helper_acceptance.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# Readable test descriptions
1111
c.formatter = :documentation
1212
c.before(:suite) do
13-
base_install
13+
host = find_only_one('sql_host')
14+
base_install(host['sql_version'])
1415
end
1516
end
1617

spec/sql_testing_helpers.rb

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,24 @@ def run_sql_query(host, opts = {})
6565
end
6666
end
6767

68-
def base_install
69-
sql2012 = find_only_one('sql2012')
70-
step "Mount the ISO on the agent #{sql2012.node_name}"
71-
iso_2012_opts = {
72-
:qa_iso_resource_root => QA_RESOURCE_ROOT,
73-
:sqlserver_iso => SQL_2012_ISO,
74-
:sqlserver_version => '2012',
75-
}
76-
mount_iso(sql2012, iso_2012_opts)
77-
step "Install Microsoft SQL 2012 on the agent #{sql2012.node_name} before running any tests"
78-
sql2012_opts ={
79-
:features => 'SQL',
80-
}
81-
install_sqlserver(sql2012, sql2012_opts)
82-
83-
sql2014 = find_only_one('sql2014')
84-
step "Mount the ISO on the agent #{sql2014.node_name}"
85-
iso_2014_opts = {
86-
:qa_iso_resource_root => QA_RESOURCE_ROOT,
87-
:sqlserver_iso => SQL_2014_ISO,
88-
:sqlserver_version => '2014',
89-
}
90-
mount_iso(sql2014, iso_2014_opts)
91-
step "Install Microsoft SQL 2014 on the agent #{sql2014.node_name} before running any tests"
92-
sql2014_opts ={
93-
:features => 'SQL',
94-
}
95-
install_sqlserver(sql2014, sql2014_opts)
68+
def base_install(sql_version)
69+
case sql_version
70+
when /2012/
71+
iso_opts = {
72+
:qa_iso_resource_root => QA_RESOURCE_ROOT,
73+
:sqlserver_iso => SQL_2012_ISO,
74+
:sqlserver_version => '2012',
75+
}
76+
when /2014/
77+
iso_opts = {
78+
:qa_iso_resource_root => QA_RESOURCE_ROOT,
79+
:sqlserver_iso => SQL_2014_ISO,
80+
:sqlserver_version => '2014',
81+
}
82+
end
83+
host = find_only_one('sql_host')
84+
step "Mount the ISO on the aggent #{host.node_name}"
85+
mount_iso(host, iso_opts)
86+
step "Install Microsoft SQL #{sql_version} on the agent #{host.node_name} before running any tests"
87+
install_sqlserver(host, {:features => 'SQL'})
9688
end

0 commit comments

Comments
 (0)