beaker-windows 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzBiMzE5OTc5MjQ0Mzc5N2E5ODRlNDIzNTlkODJiM2JiMmNlNjNkNA==
5
+ data.tar.gz: !binary |-
6
+ YjBiMGFiYzI2Nzc4MDgzZTNlMWU5MTYzMGJlYTJhZDlkZTY5YzYzMA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MDc3YzI2YzNiZGU0N2U2ZDYzM2NjM2QyMzMyNjZhNjMyOWI3ZjkzNGY3MDlh
10
+ ZjliMGY4ZTEzZTQyYmJkNzgwMDIzN2VjM2NmY2Q5ZWUzNzdjODY5MTM5YTlm
11
+ N2FkNjAwZTMyNjQxYzFmZTYwN2U5M2FhNjEwM2U2NDM3M2QxYjg=
12
+ data.tar.gz: !binary |-
13
+ ZDYxYWZkYjVhODM3ZTVlYWU4OTFmNWUyNGM4NzQ1MDhmYTJmMWIxOWI5NmJj
14
+ MGI1ZmQ5ZWNlM2ZjMWFmZWY3ZWY2NzJhM2I3ZWYyYjc0MWEwNzE5NzMzZmM1
15
+ M2Y4NWU5ZDVkNDM5ODIxZGE4NjFmMzJkODJiMjMyMThkMjVmZGQ=
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+ #this will probably not be available on rubygems, at least initially
3
+ #will probably be only available at https://rubygems.delivery.puppetlabs.net
4
+ #TODO: Change this line when it is actually available internally
5
+
6
+ # Specify your gem's dependencies in beaker-windows.gemspec
7
+ gemspec
@@ -0,0 +1,272 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ beaker-windows (0.6.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ CFPropertyList (2.3.2)
10
+ activesupport (4.2.6)
11
+ i18n (~> 0.7)
12
+ json (~> 1.7, >= 1.7.7)
13
+ minitest (~> 5.1)
14
+ thread_safe (~> 0.3, >= 0.3.4)
15
+ tzinfo (~> 1.1)
16
+ addressable (2.4.0)
17
+ aws-sdk (1.66.0)
18
+ aws-sdk-v1 (= 1.66.0)
19
+ aws-sdk-v1 (1.66.0)
20
+ json (~> 1.4)
21
+ nokogiri (>= 1.4.4)
22
+ beaker (2.36.0)
23
+ aws-sdk (~> 1.57)
24
+ beaker-answers (~> 0.0)
25
+ beaker-hiera (~> 0.0)
26
+ beaker-pe (~> 0.0)
27
+ docker-api
28
+ fission (~> 0.4)
29
+ fog (~> 1.25, < 1.35.0)
30
+ fog-google (~> 0.0.9)
31
+ google-api-client (~> 0.8)
32
+ hocon (~> 0.1)
33
+ inifile (~> 2.0)
34
+ json (~> 1.8)
35
+ mime-types (~> 2.99)
36
+ minitest (~> 5.4)
37
+ net-scp (~> 1.2)
38
+ net-ssh (~> 2.9)
39
+ open_uri_redirections (~> 0.2.1)
40
+ rbvmomi (~> 1.8)
41
+ rsync (~> 1.0.9)
42
+ stringify-hash (~> 0.0)
43
+ unf (~> 0.1)
44
+ beaker-answers (0.4.0)
45
+ require_all (~> 1.3.2)
46
+ stringify-hash (~> 0.0.0)
47
+ beaker-hiera (0.1.1)
48
+ stringify-hash (~> 0.0.0)
49
+ beaker-pe (0.1.0)
50
+ stringify-hash (~> 0.0.0)
51
+ builder (3.2.2)
52
+ diff-lcs (1.2.5)
53
+ docile (1.1.5)
54
+ docker-api (1.26.2)
55
+ excon (>= 0.38.0)
56
+ json
57
+ excon (0.48.0)
58
+ faraday (0.9.2)
59
+ multipart-post (>= 1.2, < 3)
60
+ fission (0.5.0)
61
+ CFPropertyList (~> 2.2)
62
+ fog (1.34.0)
63
+ fog-atmos
64
+ fog-aws (>= 0.6.0)
65
+ fog-brightbox (~> 0.4)
66
+ fog-core (~> 1.32)
67
+ fog-dynect (~> 0.0.2)
68
+ fog-ecloud (~> 0.1)
69
+ fog-google (>= 0.0.2)
70
+ fog-json
71
+ fog-local
72
+ fog-powerdns (>= 0.1.1)
73
+ fog-profitbricks
74
+ fog-radosgw (>= 0.0.2)
75
+ fog-riakcs
76
+ fog-sakuracloud (>= 0.0.4)
77
+ fog-serverlove
78
+ fog-softlayer
79
+ fog-storm_on_demand
80
+ fog-terremark
81
+ fog-vmfusion
82
+ fog-voxel
83
+ fog-xml (~> 0.1.1)
84
+ ipaddress (~> 0.5)
85
+ nokogiri (~> 1.5, >= 1.5.11)
86
+ fog-atmos (0.1.0)
87
+ fog-core
88
+ fog-xml
89
+ fog-aws (0.9.1)
90
+ fog-core (~> 1.27)
91
+ fog-json (~> 1.0)
92
+ fog-xml (~> 0.1)
93
+ ipaddress (~> 0.8)
94
+ fog-brightbox (0.10.1)
95
+ fog-core (~> 1.22)
96
+ fog-json
97
+ inflecto (~> 0.0.2)
98
+ fog-core (1.36.0)
99
+ builder
100
+ excon (~> 0.45)
101
+ formatador (~> 0.2)
102
+ fog-dynect (0.0.2)
103
+ fog-core
104
+ fog-json
105
+ fog-xml
106
+ fog-ecloud (0.3.0)
107
+ fog-core
108
+ fog-xml
109
+ fog-google (0.0.9)
110
+ fog-core
111
+ fog-json
112
+ fog-xml
113
+ fog-json (1.0.2)
114
+ fog-core (~> 1.0)
115
+ multi_json (~> 1.10)
116
+ fog-local (0.3.0)
117
+ fog-core (~> 1.27)
118
+ fog-powerdns (0.1.1)
119
+ fog-core (~> 1.27)
120
+ fog-json (~> 1.0)
121
+ fog-xml (~> 0.1)
122
+ fog-profitbricks (0.0.5)
123
+ fog-core
124
+ fog-xml
125
+ nokogiri
126
+ fog-radosgw (0.0.5)
127
+ fog-core (>= 1.21.0)
128
+ fog-json
129
+ fog-xml (>= 0.0.1)
130
+ fog-riakcs (0.1.0)
131
+ fog-core
132
+ fog-json
133
+ fog-xml
134
+ fog-sakuracloud (1.7.5)
135
+ fog-core
136
+ fog-json
137
+ fog-serverlove (0.1.2)
138
+ fog-core
139
+ fog-json
140
+ fog-softlayer (1.1.0)
141
+ fog-core
142
+ fog-json
143
+ fog-storm_on_demand (0.1.1)
144
+ fog-core
145
+ fog-json
146
+ fog-terremark (0.1.0)
147
+ fog-core
148
+ fog-xml
149
+ fog-vmfusion (0.1.0)
150
+ fission
151
+ fog-core
152
+ fog-voxel (0.1.0)
153
+ fog-core
154
+ fog-xml
155
+ fog-xml (0.1.2)
156
+ fog-core
157
+ nokogiri (~> 1.5, >= 1.5.11)
158
+ formatador (0.2.5)
159
+ google-api-client (0.9.4)
160
+ addressable (~> 2.3)
161
+ googleauth (~> 0.5)
162
+ httpclient (~> 2.7)
163
+ hurley (~> 0.1)
164
+ memoist (~> 0.11)
165
+ mime-types (>= 1.6)
166
+ representable (~> 2.3.0)
167
+ retriable (~> 2.0)
168
+ thor (~> 0.19)
169
+ googleauth (0.5.1)
170
+ faraday (~> 0.9)
171
+ jwt (~> 1.4)
172
+ logging (~> 2.0)
173
+ memoist (~> 0.12)
174
+ multi_json (~> 1.11)
175
+ os (~> 0.9)
176
+ signet (~> 0.7)
177
+ hocon (0.9.5)
178
+ httpclient (2.7.1)
179
+ hurley (0.2)
180
+ i18n (0.7.0)
181
+ inflecto (0.0.2)
182
+ inifile (2.0.2)
183
+ ipaddress (0.8.3)
184
+ json (1.8.3)
185
+ jwt (1.5.3)
186
+ kramdown (1.10.0)
187
+ little-plugger (1.1.4)
188
+ logging (2.0.0)
189
+ little-plugger (~> 1.1)
190
+ multi_json (~> 1.10)
191
+ logutils (0.6.1)
192
+ markdown (0.4.0)
193
+ kramdown (>= 0.13.7)
194
+ props (>= 0.2.0)
195
+ textutils (>= 0.2.0)
196
+ memoist (0.14.0)
197
+ mime-types (2.99.1)
198
+ mini_portile2 (2.0.0)
199
+ minitest (5.8.4)
200
+ multi_json (1.11.2)
201
+ multipart-post (2.0.0)
202
+ net-scp (1.2.1)
203
+ net-ssh (>= 2.6.5)
204
+ net-ssh (2.9.4)
205
+ nokogiri (1.6.7.2)
206
+ mini_portile2 (~> 2.0.0.rc2)
207
+ open_uri_redirections (0.2.1)
208
+ os (0.9.6)
209
+ props (1.1.2)
210
+ rake (10.5.0)
211
+ rbvmomi (1.8.2)
212
+ builder
213
+ nokogiri (>= 1.4.1)
214
+ trollop
215
+ representable (2.3.0)
216
+ uber (~> 0.0.7)
217
+ require_all (1.3.3)
218
+ retriable (2.1.0)
219
+ rspec (3.4.0)
220
+ rspec-core (~> 3.4.0)
221
+ rspec-expectations (~> 3.4.0)
222
+ rspec-mocks (~> 3.4.0)
223
+ rspec-core (3.4.4)
224
+ rspec-support (~> 3.4.0)
225
+ rspec-expectations (3.4.0)
226
+ diff-lcs (>= 1.2.0, < 2.0)
227
+ rspec-support (~> 3.4.0)
228
+ rspec-mocks (3.4.1)
229
+ diff-lcs (>= 1.2.0, < 2.0)
230
+ rspec-support (~> 3.4.0)
231
+ rspec-support (3.4.1)
232
+ rsync (1.0.9)
233
+ rubyzip (1.2.0)
234
+ signet (0.7.2)
235
+ addressable (~> 2.3)
236
+ faraday (~> 0.9)
237
+ jwt (~> 1.5)
238
+ multi_json (~> 1.10)
239
+ simplecov (0.11.2)
240
+ docile (~> 1.1.0)
241
+ json (~> 1.8)
242
+ simplecov-html (~> 0.10.0)
243
+ simplecov-html (0.10.0)
244
+ stringify-hash (0.0.2)
245
+ textutils (1.4.0)
246
+ activesupport
247
+ logutils (>= 0.6.1)
248
+ props (>= 1.1.2)
249
+ rubyzip (>= 1.0.0)
250
+ thor (0.19.1)
251
+ thread_safe (0.3.5)
252
+ trollop (2.1.2)
253
+ tzinfo (1.2.2)
254
+ thread_safe (~> 0.1)
255
+ uber (0.0.15)
256
+ unf (0.1.4)
257
+ unf_ext
258
+ unf_ext (0.0.7.2)
259
+ yard (0.8.7.6)
260
+
261
+ PLATFORMS
262
+ ruby
263
+
264
+ DEPENDENCIES
265
+ beaker (~> 2.32)
266
+ beaker-windows!
267
+ bundler (~> 1.6)
268
+ markdown (~> 0)
269
+ rake (~> 10.0)
270
+ rspec (~> 3.0)
271
+ simplecov (~> 0.11)
272
+ yard (~> 0)
@@ -0,0 +1,8 @@
1
+ # experimental_beaker-windows_bump_and_tag_master - History
2
+ ## Tags
3
+ * [LATEST - 11 Mar, 2016 (7a991e6b)](#LATEST)
4
+
5
+ ## Details
6
+ ### <a name = "LATEST">LATEST - 11 Mar, 2016 (7a991e6b)
7
+
8
+ * Initial release.
@@ -0,0 +1,15 @@
1
+ Copyright (C) 2011-2016 Puppet Labs Inc
2
+
3
+ Puppet Labs can be contacted at: info@puppetlabs.com
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
@@ -0,0 +1,221 @@
1
+ # Beaker Windows
2
+
3
+ Beaker helper library for testing on Windows.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'beaker-windows'
10
+
11
+ And then execute:
12
+
13
+ $ bundle install
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install beaker-windows
18
+
19
+ ## Methods
20
+
21
+ ### join_path
22
+
23
+ Join paths together with a "\" Windows style path separator. This method will
24
+ accept path segments with mixed separators as well as leading and trailing
25
+ separators. Optionally you can specify to use an alternate path separator or
26
+ strip the drive letter off the combined path.
27
+
28
+ #### Example 1
29
+
30
+ join_path('c:\dog', 'bark')
31
+
32
+ #### Example 2
33
+
34
+ join_path('c:\dog', 'bark', :path_sep => '/')
35
+
36
+ #### Example 3
37
+
38
+ join_path('c:\dog', 'bark', :path_sep => '/', :strip_drive => true)
39
+
40
+ ### exec_ps_cmd
41
+
42
+ Executes a PowerShell command on a host. Allow validation of command execution
43
+ and fail if PowerShell command throws an exception. Note: if quotes are
44
+ required then the single quote should be preferred. If double quotes are
45
+ required you will need to double escape the quotes!
46
+
47
+ #### Example 1
48
+
49
+ on(hosts, exec_ps_cmd("Set-Content -path 'fu.txt' -value 'fu'"))
50
+
51
+ #### Example 2
52
+
53
+ You can specify custom PowerShell options.
54
+
55
+ on(hosts, exec_ps_cmd("Set-Content -path 'fu.txt' -value 'fu'", :ExecutionPolicy => 'Unrestricted')
56
+
57
+ #### Example 3
58
+
59
+ Encode a command that contains nested quotes or Unicode.
60
+
61
+ on(hosts, exec_ps_cmd("Set Content -path 'fu.txt', -value 'fu'", :EncodedCommand => true))
62
+
63
+ #### Example 4
64
+
65
+ Wrap the PowerShell command to guarantee an exit code of "1" if the command fails.
66
+
67
+ on(hosts, exec_ps_cmd("1 -eq 2", :verify_cmd => true))
68
+
69
+ #### Example 5
70
+
71
+ If the command throws an exception then it should exit with "1". (Default)
72
+
73
+ on(hosts, exec_ps_cmd("does.not.exist", :excep_fail => true))
74
+
75
+ ### exec_ps_script_on
76
+
77
+ Execute a PowerShell script on a remote machine. (This method supports native
78
+ Unicode) Note: This method fails on Windows 2008 R2! See BKR-293 for more details.
79
+
80
+ #### Example 1
81
+
82
+ exec_ps_script_on(host, 'Write-Host Hello')
83
+
84
+ #### Example 2
85
+
86
+ Can also be used in a block for granular verification.
87
+
88
+ exec_ps_script_on(hosts, 'Write-Host Hello') do |result|
89
+ assert_match(/Hello/, result.stdout)
90
+ end
91
+
92
+ ### get_windows_features_on
93
+
94
+ Get a list (returns an Array) of Windows features on a host. Allow for
95
+ filtering of installed or available features.
96
+
97
+ #### Example 1
98
+
99
+ Get all features regardless of installation state.
100
+
101
+ get_windows_features_on(host)
102
+
103
+ #### Example 2
104
+
105
+ Filter for installed features.
106
+
107
+ get_windows_features_on(host, :filter => :installed)
108
+
109
+ #### Example 3
110
+
111
+ Filter for available features.
112
+
113
+ get_windows_features_on(host, :filter => :available)
114
+
115
+ ### install_windows_feature_on
116
+
117
+ Install a Windows role or feature on a host.
118
+
119
+ #### Example 1
120
+
121
+ install_windows_feature_on(host, 'Print-Server')
122
+
123
+ #### Example 2
124
+
125
+ Optionally failures can be suppressed which allows for delayed verification
126
+ of feature installation. (See
127
+ [assert_windows_feature_on](#assert_windows_feature_on) for more details.)
128
+
129
+ install_windows_feature_on(host, 'Bad-Feature', :suppress_fail => true)
130
+
131
+ ### remove_windows_feature_on
132
+
133
+ Remove a Windows role or feature on a host.
134
+
135
+ #### Example 1
136
+
137
+ remove_windows_feature_on(host, 'Print-Server')
138
+
139
+ #### Example 2
140
+
141
+ Optionally failures can be suppressed which allows for delayed verification
142
+ of feature removal. (See
143
+ [assert_windows_feature_on](#assert_windows_feature_on) for more details.)
144
+
145
+ remove_windows_feature_on(host, 'Bad-Feature', :suppress_fail => true)
146
+
147
+ ### assert_windows_feature_on
148
+
149
+ Assert that a Windows feature is installed or not on a host. The advantage
150
+ of this assert is that is will report as a Beaker test failure if the
151
+ assertion fails.
152
+
153
+ #### Example 1
154
+
155
+ Assert that a Windows feature is installed.
156
+
157
+ assert_windows_feature_on(host, 'Print-Server')
158
+
159
+ #### Example 2
160
+
161
+ Assert that a Windows feature is available.
162
+
163
+ assert_windows_feature_on(host, 'WINS', :state => :available)
164
+
165
+ ### get_registry_value_on
166
+
167
+ Get the data from a registry value.
168
+
169
+ #### Example 1
170
+
171
+ get_registry_value_on(host, :hklm, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "SystemRoot")
172
+
173
+ ### set_registry_value_on
174
+
175
+ Set the data for a registry value.
176
+
177
+ #### Example 1
178
+
179
+ Set data for a REG_SZ registry value.
180
+
181
+ set_registry_value_on(host, :hkcu, 'SOFTWARE\test_key', 'string_value', 'test_data')
182
+
183
+ #### Example 2
184
+
185
+ Set data for a REG_DWORD registry value.
186
+
187
+ set_registry_value_on(host, :hkcu, 'SOFTWARE\test_key', 'dword_value', 255, :dword)
188
+
189
+ #### Example 3
190
+
191
+ Set data for a REG_BINARY registry value.
192
+
193
+ set_registry_value_on(host, :hkcu, 'SOFTWARE\test_key', 'bin_value', 'be,ef,f0,0d', :bin)
194
+
195
+ ### remove_registry_value_on
196
+
197
+ Remove a registry value.
198
+
199
+ #### Example 1
200
+
201
+ remove_registry_value_on(host, :hkcu, 'SOFTWARE\test_key', 'string_value')
202
+
203
+ ### new_registry_key_on
204
+
205
+ Create a new registry key. If the key already exists then this method will
206
+ silently fail. This method will create parent intermediate parent keys if they
207
+ do not exist.
208
+
209
+ #### Example 1
210
+
211
+ new_registry_key_on(host, :hkcu, 'SOFTWARE\some_new_key')
212
+
213
+ ### remove_registry_key_on
214
+
215
+ Remove a registry key. The method will not remove a registry key if the key contains
216
+ nested subkeys and values. Use the "recurse" argument to force deletion of nested
217
+ registry keys.
218
+
219
+ #### Example 1
220
+
221
+ remove_registry_key_on(host, :hkcu, 'SOFTWARE\test_key')