2016-08-15 19:24:39 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
return unless os.windows?
|
|
|
|
|
2016-09-05 10:56:34 +00:00
|
|
|
# iis service is running
|
|
|
|
describe service('W3SVC') do
|
2016-08-15 19:24:39 +00:00
|
|
|
it { should be_installed }
|
|
|
|
it { should be_running }
|
|
|
|
end
|
|
|
|
|
2016-09-05 10:56:34 +00:00
|
|
|
# test the site without the iis resource
|
2016-08-15 19:24:39 +00:00
|
|
|
describe powershell("Get-Website") do
|
|
|
|
its(:stdout) {should match '.*?Default Web Site.*?'}
|
|
|
|
end
|
|
|
|
|
2016-09-05 10:56:34 +00:00
|
|
|
# test the site with the resource
|
2016-08-15 19:24:39 +00:00
|
|
|
describe iis_site('Default Web Site') do
|
|
|
|
it { should exist }
|
|
|
|
it { should be_running }
|
|
|
|
it { should have_app_pool('DefaultAppPool') }
|
2016-09-05 10:56:34 +00:00
|
|
|
its('app_pool') { should eq 'DefaultAppPool' }
|
2016-08-15 19:24:39 +00:00
|
|
|
it { should have_binding('http *:80:') }
|
2016-09-05 10:56:34 +00:00
|
|
|
its('bindings') { should include 'http *:80:' }
|
|
|
|
it { should have_path('%SystemDrive%\\inetpub\\wwwroot') }
|
|
|
|
its('path') { should eq '%SystemDrive%\\inetpub\\wwwroot' }
|
2016-08-15 19:24:39 +00:00
|
|
|
end
|
2016-12-15 15:13:15 +00:00
|
|
|
|
|
|
|
# test compatability with Serverspec
|
|
|
|
describe iis_website('Default Web Site') do
|
|
|
|
it{ should exist }
|
|
|
|
it{ should be_running }
|
|
|
|
it{ should be_in_app_pool('DefaultAppPool') }
|
|
|
|
end
|