summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-02-23 18:27:10 -0800
committerMatt Wrock <matt@mattwrock.com>2016-02-23 18:27:10 -0800
commit2a21a1f35241567269da1fa6a6e420b51207d6f7 (patch)
treede28293ed960c3a4e373165a6b4ce4f5e3fe9b7e
parentdf890fd7aef5d3d131c83477a33b786e64304dc8 (diff)
downloadchef-dsc_listener.tar.gz
enable HTTP winrm listener for dsc functional testsdsc_listener
-rw-r--r--spec/functional/resource/dsc_script_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb
index 921638bcf8..42c23a695f 100644
--- a/spec/functional/resource/dsc_script_spec.rb
+++ b/spec/functional/resource/dsc_script_spec.rb
@@ -17,14 +17,24 @@
#
require "spec_helper"
+require "chef/mixin/powershell_out"
require "chef/mixin/shell_out"
require "chef/mixin/windows_architecture_helper"
require "support/shared/integration/integration_helper"
describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
include Chef::Mixin::WindowsArchitectureHelper
+ include Chef::Mixin::PowershellOut
before(:all) do
@temp_dir = ::Dir.mktmpdir("dsc-functional-test")
+ # enable the HTTP listener if it is not already enabled needed by underlying DSC engine
+ winrm_code = <<-CODE
+ winrm get winrm/config/listener?Address=*+Transport=HTTP
+ if($LASTEXITCODE -ne 0) {
+ winrm create winrm/config/Listener?Address=*+Transport=HTTP
+ }
+ CODE
+ powershell_out!(winrm_code)
end
after(:all) do