summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2016-02-24 09:31:51 -0800
committerMatt Wrock <matt@mattwrock.com>2016-02-24 09:31:51 -0800
commitbde67dc539ee182e5e6e08a3323d58b4547eff6e (patch)
treede28293ed960c3a4e373165a6b4ce4f5e3fe9b7e
parentdf890fd7aef5d3d131c83477a33b786e64304dc8 (diff)
parent2a21a1f35241567269da1fa6a6e420b51207d6f7 (diff)
downloadchef-bde67dc539ee182e5e6e08a3323d58b4547eff6e.tar.gz
Merge pull request #4618 from chef/dsc_listener
enable HTTP winrm listener for dsc functional tests
-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