specinfra 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7305e313da41e92515a147b79088c2fd10c5ec8
4
- data.tar.gz: 73d74b156b1ffbc104058c3460a950981a8271f8
3
+ metadata.gz: 4ca4e174f6c51dfac9700e39ade588870b8af063
4
+ data.tar.gz: a467000e09b950ddb4e140b5e2e25d31c9d9d13c
5
5
  SHA512:
6
- metadata.gz: 3154a2b02e09a6e0a202db602ae883835a46408f5b8dbc45bb4fa75829376c7bb29385762ed19b2dd4914a20bd20b221bb13ba4d60b58bf87957ca0320e74be8
7
- data.tar.gz: 06efb9ba8734e8bc077f359cdcbf0a2d42f801b933be28228fac8997b77d683297b3761a7447d51469d498c02aa1de4bb84a78d413ad02ad10992d77e2c022cc
6
+ metadata.gz: 21de2127baa02922587d8fe915fa4f2da5f6192fd066baaf313f01b1cc7f53ffc7d8b458a8cf250cd8b9056fa17f485846eabcd066a1f7abbab921be0a0d2edb
7
+ data.tar.gz: 4bbb1221e12972ac0cffaab4ee414ba30d6ebf8545594e4e66059df4e827bca371eab6700c622b12f4542a0abe5d15436a9b90b4208a18f7063f02ba5d0638b8
@@ -0,0 +1,13 @@
1
+ function FindIISWebsite
2
+ {
3
+ param($name)
4
+ import-module WebAdministration
5
+ Get-Website | Where { $_.name -match $name }
6
+ }
7
+
8
+ function FindIISAppPool
9
+ {
10
+ param($name)
11
+ import-module WebAdministration
12
+ Get-Item "IIS:\AppPools\$name" -Erroraction silentlycontinue
13
+ }
@@ -79,6 +79,14 @@ module SpecInfra
79
79
  raise NotImplementedError.new
80
80
  end
81
81
 
82
+ def check_service_installed(service)
83
+ raise NotImplementedError.new
84
+ end
85
+
86
+ def check_service_start_mode(service, mode)
87
+ raise NotImplementedError.new
88
+ end
89
+
82
90
  def check_listening(port)
83
91
  regexp = ":#{port} "
84
92
  "netstat -tunl | grep -- #{escape(regexp)}"
@@ -129,6 +137,11 @@ module SpecInfra
129
137
  "grep -qF -- #{escape(expected_pattern)} #{escape(file)}"
130
138
  end
131
139
 
140
+ def check_file_checksum(file, expected)
141
+ regexp = "^#{expected}"
142
+ "cksum #{escape(file)} | grep -iw -- #{escape(regexp)}"
143
+ end
144
+
132
145
  def check_file_md5checksum(file, expected)
133
146
  regexp = "^#{expected}"
134
147
  "md5sum #{escape(file)} | grep -iw -- #{escape(regexp)}"
@@ -106,6 +106,20 @@ module SpecInfra
106
106
  end
107
107
  end
108
108
 
109
+ def check_service_installed(service)
110
+ Backend::PowerShell::Command.new do
111
+ using 'find_service.ps1'
112
+ exec "@(FindService -name '#{service}').count -gt 0"
113
+ end
114
+ end
115
+
116
+ def check_service_start_mode(service, mode)
117
+ Backend::PowerShell::Command.new do
118
+ using 'find_service.ps1'
119
+ exec "'#{mode}' -match (FindService -name '#{service}').StartMode -and (FindService -name '#{service}') -ne $null"
120
+ end
121
+ end
122
+
109
123
  def check_enabled(service, level=nil)
110
124
  Backend::PowerShell::Command.new do
111
125
  using 'find_service.ps1'
@@ -222,6 +236,55 @@ module SpecInfra
222
236
  Backend::PowerShell::Command.new { exec cmd }
223
237
  end
224
238
 
239
+ def check_iis_website_enabled(name)
240
+ Backend::PowerShell::Command.new do
241
+ using 'find_iis_component.ps1'
242
+ exec "(FindIISWebsite -name '#{name}').serverAutoStart -eq $true"
243
+ end
244
+ end
245
+
246
+ def check_iis_website_installed(name)
247
+ Backend::PowerShell::Command.new do
248
+ using 'find_iis_component.ps1'
249
+ exec "@(FindIISWebsite -name '#{name}').count -gt 0"
250
+ end
251
+ end
252
+
253
+ def check_iis_website_running(name)
254
+ Backend::PowerShell::Command.new do
255
+ using 'find_iis_component.ps1'
256
+ exec "(FindIISWebsite -name '#{name}').state -eq 'Started'"
257
+ end
258
+ end
259
+
260
+ def check_iis_website_app_pool(name, app_pool)
261
+ Backend::PowerShell::Command.new do
262
+ using 'find_iis_component.ps1'
263
+ exec "(FindIISWebsite -name '#{name}').applicationPool -match '#{app_pool}'"
264
+ end
265
+ end
266
+
267
+ def check_iis_website_path(name, path)
268
+ Backend::PowerShell::Command.new do
269
+ using 'find_iis_component.ps1'
270
+ exec "[System.Environment]::ExpandEnvironmentVariables( ( FindIISWebsite -name '#{name}' ).physicalPath ).replace('\\', '/' ) -eq ('#{path}'.trimEnd('/').replace('\\', '/'))"
271
+ end
272
+ end
273
+
274
+ def check_iis_app_pool(name)
275
+ Backend::PowerShell::Command.new do
276
+ using 'find_iis_component.ps1'
277
+ exec "@(FindIISAppPool -name '#{name}').count -gt 0"
278
+ end
279
+ end
280
+
281
+ def check_iis_app_pool_dotnet(name, dotnet)
282
+ Backend::PowerShell::Command.new do
283
+ using 'find_iis_component.ps1'
284
+ exec "(FindIISAppPool -name '#{name}').managedRuntimeVersion -match 'v#{dotnet}'"
285
+ end
286
+ end
287
+
225
288
  private
226
289
 
227
290
  def item_has_attribute item, attribute
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: octorelease
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Common layer for serverspec and configspec
@@ -73,8 +73,8 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
78
  - Gemfile
79
79
  - LICENSE.txt
80
80
  - README.md
@@ -92,6 +92,7 @@ files:
92
92
  - lib/specinfra/backend/powershell/support/check_file_access_rules.ps1
93
93
  - lib/specinfra/backend/powershell/support/crop_text.ps1
94
94
  - lib/specinfra/backend/powershell/support/find_group.ps1
95
+ - lib/specinfra/backend/powershell/support/find_iis_component.ps1
95
96
  - lib/specinfra/backend/powershell/support/find_installed_application.ps1
96
97
  - lib/specinfra/backend/powershell/support/find_service.ps1
97
98
  - lib/specinfra/backend/powershell/support/find_user.ps1
@@ -149,17 +150,17 @@ require_paths:
149
150
  - lib
150
151
  required_ruby_version: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - '>='
153
+ - - ">="
153
154
  - !ruby/object:Gem::Version
154
155
  version: '0'
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - '>='
158
+ - - ">="
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []
161
162
  rubyforge_project:
162
- rubygems_version: 2.0.3
163
+ rubygems_version: 2.2.2
163
164
  signing_key:
164
165
  specification_version: 4
165
166
  summary: Common layer for serverspec and configspec