3
3
require 'erb'
4
4
5
5
host = find_only_one ( "sql_host" )
6
- inst_name = "MSSQL" + SecureRandom . hex ( 4 )
7
- inst_name = inst_name . upcase
6
+ inst_name = ( "MSSQL" + SecureRandom . hex ( 4 ) ) . upcase
8
7
9
8
describe "sqlserver_instance" , :node => host do
10
9
version = host [ 'sql_version' ] . to_s
@@ -37,12 +36,10 @@ def ensure_sqlserver_instance(host, features, inst_name, ensure_val = 'present')
37
36
38
37
before ( :all ) do
39
38
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
40
- remove_sql_features ( host , { :features => features , :version => version } )
41
39
end
42
40
43
41
after ( :all ) do
44
42
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
45
- remove_sql_features ( host , { :features => features , :version => version } )
46
43
end
47
44
48
45
it "create #{ inst_name } instance" do
@@ -54,7 +51,6 @@ def ensure_sqlserver_instance(host, features, inst_name, ensure_val = 'present')
54
51
end
55
52
56
53
it "remove #{ inst_name } instance" do
57
- remove_sql_features ( host , { :features => features , :version => version } )
58
54
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
59
55
60
56
validate_sql_install ( host , { :version => version } ) do |r |
@@ -63,20 +59,18 @@ def ensure_sqlserver_instance(host, features, inst_name, ensure_val = 'present')
63
59
end
64
60
end
65
61
66
- context "can create instance with only SQL feature" do
62
+ context "can create instance with only one SQL feature" do
67
63
features = [ 'SQL' ]
68
64
69
65
before ( :all ) do
70
66
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
71
- remove_sql_features ( host , { :features => features , :version => version } )
72
67
end
73
68
74
69
after ( :all ) do
75
70
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
76
- remove_sql_features ( host , { :features => features , :version => version } )
77
71
end
78
72
79
- it "create #{ inst_name } instance with only SQL feature" do
73
+ it "create #{ inst_name } instance with only one SQL feature" do
80
74
ensure_sqlserver_instance ( host , features , inst_name )
81
75
82
76
validate_sql_install ( host , { :version => version } ) do |r |
@@ -85,20 +79,18 @@ def ensure_sqlserver_instance(host, features, inst_name, ensure_val = 'present')
85
79
end
86
80
end
87
81
88
- context "can create instance with only RS feature" do
82
+ context "can create instance with only one RS feature" do
89
83
features = [ 'RS' ]
90
84
91
85
before ( :all ) do
92
86
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
93
- remove_sql_features ( host , { :features => features , :version => version } )
94
87
end
95
88
96
89
after ( :all ) do
97
90
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
98
- remove_sql_features ( host , { :features => features , :version => version } )
99
91
end
100
92
101
- it "create #{ inst_name } instance with only RS feature" do
93
+ it "create #{ inst_name } instance with only one RS feature" do
102
94
ensure_sqlserver_instance ( host , features , inst_name )
103
95
104
96
validate_sql_install ( host , { :version => version } ) do |r |
@@ -107,28 +99,25 @@ def ensure_sqlserver_instance(host, features, inst_name, ensure_val = 'present')
107
99
end
108
100
end
109
101
110
- context "can create instance with only AS feature" do
102
+ context "can create instance with only one AS feature" do
111
103
features = [ 'AS' ]
112
104
113
105
before ( :all ) do
114
106
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
115
- remove_sql_features ( host , { :features => features , :version => version } )
116
107
end
117
108
118
109
after ( :all ) do
119
110
ensure_sqlserver_instance ( host , features , inst_name , 'absent' )
120
- remove_sql_features ( host , { :features => features , :version => version } )
121
111
end
122
112
123
113
#skip below test due to ticket MODULES-2379, when the ticket was resolved
124
114
# will change xit to it
125
- xit "create #{ inst_name } instance with only AS feature" do
115
+ xit "create #{ inst_name } instance with only one AS feature" do
126
116
ensure_sqlserver_instance ( host , features , inst_name )
127
117
128
118
validate_sql_install ( host , { :version => version } ) do |r |
129
119
expect ( r . stdout ) . to match ( /#{ Regexp . new ( inst_name ) } / )
130
120
end
131
121
end
132
122
end
133
-
134
123
end
0 commit comments