specinfra 1.24.0 → 1.25.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de086eeffea5fc8b227863dd31f5fa0de93d1897
4
- data.tar.gz: 5171079ee7006748cb98bbbd0eca833936624800
3
+ metadata.gz: 5b352bb1e25445757343ee15e75ead3eda56f66a
4
+ data.tar.gz: 305b731e380663f02ce97123fb40426406c07b52
5
5
  SHA512:
6
- metadata.gz: cb20c76bf0aa9b6576cadfaff5e8a84a7e521da2d51b4055eb96f6376a9a6625635508b8749f1a2e7695ed1b2016f5192ea25772d0a5920744fdc3d1f9e32c49
7
- data.tar.gz: 259f78a004ab4280099002c9720533b7c25e752aa29dc4bab95ca781d9d7a27476f8771ac83efe68de25511dccdd34f4c63d8e606c8ec69ed993f038d2820a1d
6
+ metadata.gz: 19a4b837e2c13e804b36266baa4f56cf072b7191581c61e8ca4510d7955a796031f0842d4c940ea5b8ff58c4c98d53d89d93cec79f28d8362bf015bb9b952f03
7
+ data.tar.gz: 831a8f49b9443373fe16003d8c866be9cde69bc3e642a9310d83cb02414787efbf0d65e6eb160195bc2f7fc077cca435c51bdd521e2125852e3cb1be53040913
@@ -1,19 +1,80 @@
1
1
  function FindIISWebsite
2
2
  {
3
3
  param($name)
4
- Import-Module WebAdministration
5
-
6
- Try {
7
- Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
8
- }
9
- Catch [System.IO.FileNotFoundException] {
10
- Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
11
- }
4
+
5
+ Import-Module WebAdministration
6
+
7
+ Try {
8
+ Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
9
+ }
10
+ Catch [System.IO.FileNotFoundException] {
11
+ Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
12
+ }
12
13
  }
13
14
 
14
15
  function FindIISAppPool
15
16
  {
16
17
  param($name)
17
- import-module WebAdministration
18
+
19
+ Import-Module WebAdministration
20
+
18
21
  Get-Item "IIS:\AppPools\$name" -Erroraction silentlycontinue
22
+ }
23
+
24
+ function FindSiteBindings
25
+ {
26
+ param($name, $protocol, $hostHeader, $port, $ipAddress)
27
+
28
+ Import-Module WebAdministration
29
+
30
+ Get-WebBinding -Name $name -Protocol $protocol -HostHeader $hostHeader -Port $port -IPAddress $ipAddress
31
+ }
32
+
33
+ function FindSiteVirtualDir
34
+ {
35
+ param($name, $vdir, $path)
36
+
37
+ Import-Module WebAdministration
38
+
39
+ $webVirtDirPath = [string]::Format('IIS:\Sites\{0}\{1}',$name, $vdir);
40
+ if (Test-Path $webVirtDirPath)
41
+ {
42
+ if ([string]::IsNullOrEmpty($path))
43
+ {
44
+ $true
45
+ }
46
+ else
47
+ {
48
+ (Get-Item $webVirtDirPath).physicalPath -eq $path
49
+ }
50
+ }
51
+ else
52
+ {
53
+ $false
54
+ }
55
+ }
56
+
57
+ function FindSiteApplication
58
+ {
59
+ param($name, $app, $pool, $physicalPath)
60
+
61
+ Import-Module WebAdministration
62
+
63
+ $path = "IIS:\Sites\${name}\${app}"
64
+ $result = $false
65
+ if (Test-Path $path)
66
+ {
67
+ $result = $true
68
+ if ([string]::IsNullOrEmpty($pool) -eq $false)
69
+ {
70
+ $result = $result -and (Get-Item $path).applicationPool -eq $pool
71
+ }
72
+
73
+ if ([string]::IsNullOrEmpty($physicalPath) -eq $false)
74
+ {
75
+ $result = $result -and (Get-Item $path).physicalPath -eq $physicalPath
76
+ }
77
+ }
78
+
79
+ $result
19
80
  }
@@ -290,6 +290,27 @@ module SpecInfra
290
290
  exec "[System.Environment]::ExpandEnvironmentVariables( ( FindIISWebsite -name '#{name}' ).physicalPath ).replace('\\', '/' ) -eq ('#{path}'.trimEnd('/').replace('\\', '/'))"
291
291
  end
292
292
  end
293
+
294
+ def check_iis_website_binding(name, port, protocol, ipAddress, hostHeader)
295
+ Backend::PowerShell::Command.new do
296
+ using 'find_iis_component.ps1'
297
+ exec "(FindSiteBindings -name '#{name}' -protocol '#{protocol}' -hostHeader '#{hostHeader}' -port #{port} -ipAddress '#{ipAddress}').count -gt 0"
298
+ end
299
+ end
300
+
301
+ def check_iis_website_virtual_dir(name, vdir, path)
302
+ Backend::PowerShell::Command.new do
303
+ using 'find_iis_component.ps1'
304
+ exec "(FindSiteVirtualDir -name '#{name}' -vdir '#{vdir}' -path '#{path}') -eq $true"
305
+ end
306
+ end
307
+
308
+ def check_iis_website_application(name, app, pool, physicalPath)
309
+ Backend::PowerShell::Command.new do
310
+ using 'find_iis_component.ps1'
311
+ exec "(FindSiteApplication -name '#{name}' -app '#{app}' -pool '#{pool}' -physicalPath '#{physicalPath}') -eq $true"
312
+ end
313
+ end
293
314
 
294
315
  def check_iis_app_pool(name)
295
316
  Backend::PowerShell::Command.new do
@@ -312,6 +333,13 @@ module SpecInfra
312
333
  end
313
334
  end
314
335
 
336
+ def check_managed_pipeline_mode(name, mode)
337
+ Backend::PowerShell::Command.new do
338
+ using 'find_iis_component.ps1'
339
+ exec "(FindIISAppPool -name '#{name}').managedPipelineMode -eq '#{mode}'"
340
+ end
341
+ end
342
+
315
343
  def check_idle_timeout(name, minutes)
316
344
  Backend::PowerShell::Command.new do
317
345
  using 'find_iis_component.ps1'
@@ -1,3 +1,3 @@
1
1
  module SpecInfra
2
- VERSION = "1.24.0"
2
+ VERSION = "1.25.0"
3
3
  end
data/wercker.yml CHANGED
@@ -1,4 +1,4 @@
1
- box: mizzy/serverspec-base
1
+ box: mizzy/serverspec-base@0.0.2
2
2
  build:
3
3
  steps:
4
4
  - script:
@@ -35,16 +35,16 @@ build:
35
35
  code: rake spec:centos65
36
36
  cwd: $WORKING_DIR
37
37
  - script:
38
- name: Run vagrant up ubuntu1310
39
- code: vagrant up ubuntu1310 --provider=digital_ocean
38
+ name: Run vagrant up ubuntu1404
39
+ code: vagrant up ubuntu1404 --provider=digital_ocean
40
40
  cwd: $WORKING_DIR
41
41
  - script:
42
- name: Run vagrant reload ubuntu1310
43
- code: vagrant reload ubuntu1310
42
+ name: Run vagrant reload ubuntu1404
43
+ code: vagrant reload ubuntu1404
44
44
  cwd: $WORKING_DIR
45
45
  - script:
46
- name: Run rake spec:ubuntu1310
47
- code: rake spec:ubuntu1310
46
+ name: Run rake spec:ubuntu1404
47
+ code: rake spec:ubuntu1404
48
48
  cwd: $WORKING_DIR
49
49
 
50
50
  after-steps:
@@ -53,8 +53,8 @@ build:
53
53
  code: vagrant destroy centos65 --force
54
54
  cwd: $WORKING_DIR
55
55
  - script:
56
- name: Run vagrant destroy ubuntu1310
57
- code: vagrant destroy ubuntu1310 --force
56
+ name: Run vagrant destroy ubuntu1404
57
+ code: vagrant destroy ubuntu1404 --force
58
58
  cwd: $WORKING_DIR
59
59
  - 1syo/idobata-notify@0.1.1:
60
60
  token: $IDOBATA_TOKEN
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.0
4
+ version: 1.25.0
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-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler