-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mefellows-feature/masterzen-pr'
Merged PR #14 to ease development of the Packer WinRM communicator system
- Loading branch information
Showing
25 changed files
with
356 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
*.coverprofile | ||
*.cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: go | ||
go: | ||
- 1.2 | ||
- 1.3 | ||
- tip | ||
install: | ||
- make updatedeps | ||
- go build -o winrm-cli | ||
before_install: | ||
- go get github.com/axw/gocov/gocov | ||
- go get github.com/mattn/goveralls | ||
- go get code.google.com/p/go.tools/cmd/cover | ||
- go get github.com/modocache/gover | ||
- go get gopkg.in/check.v1 | ||
script: | ||
- make ci | ||
after_script: | ||
- $HOME/gopath/bin/goveralls -service="travis-ci" -coverprofile=profile.cov -repotoken $COVERALLS_TOKEN | ||
matrix: | ||
allow_failures: | ||
- go: tip | ||
env: | ||
global: | ||
secure: "GTrEtbp3sq14Jjz34pgIO0/Zv19YaDOOUJay4qnzGxs527HkW7YdsWENz0/yGHet+0jMOPatfP3uLaQHVFCNFZLfMYVmD5apMl7hPFrCaDZVvI9+ZwngIZ8gHzcf2Q+L6LxUT523ypjmRR+T1qYfbOy4UXlfGCyHFBbRB7AbMDk=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
# All Vagrant configuration is done here. The most common configuration | ||
# options are documented and commented below. For a complete reference, | ||
# please see the online documentation at vagrantup.com. | ||
|
||
# Every Vagrant virtual environment requires a box to build off of. | ||
config.vm.box = "kensykora/windows_2012_r2_standard" | ||
|
||
config.vm.guest = :windows | ||
config.vm.communicator = "winrm" | ||
|
||
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--vram", "128"] | ||
v.gui = true | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
<!-- Create Shell --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> | ||
<env:Header> | ||
<a:To>http://localhost:5985/wsman</a:To> | ||
<a:ReplyTo> | ||
<a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | ||
</a:ReplyTo> | ||
<w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize> | ||
<w:OperationTimeout>PT60S</w:OperationTimeout> | ||
<a:MessageID>uuid:c0fb2e4a-b066-4649-618b-5897f91acafd</a:MessageID> | ||
<w:Locale mustUnderstand="false" xml:lang="en-US" /> | ||
<p:DataLocale mustUnderstand="false" xml:lang="en-US" /> | ||
<a:Action mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action> | ||
<w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI> | ||
<w:OptionSet> | ||
<w:Option Name="WINRS_NOPROFILE">FALSE</w:Option> | ||
<w:Option Name="WINRS_CODEPAGE">437</w:Option> | ||
</w:OptionSet> | ||
</env:Header> | ||
<env:Body> | ||
<rsp:Shell> | ||
<rsp:InputStreams>stdin</rsp:InputStreams> | ||
<rsp:OutputStreams>stdout stderr</rsp:OutputStreams> | ||
</rsp:Shell> | ||
</env:Body> | ||
</env:Envelope> | ||
|
||
<!-- shellid: 0179DFE0-5409-4F07-946E-54635608A269 --> | ||
|
||
|
||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> | ||
<env:Header> | ||
<a:To>http://localhost:5985/wsman</a:To> | ||
<a:ReplyTo> | ||
<a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | ||
</a:ReplyTo> | ||
<w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize> | ||
<w:OperationTimeout>PT60S</w:OperationTimeout> | ||
<a:MessageID>uuid:05ea1914-c6dd-423d-5dac-c0e3b1ba056f</a:MessageID> | ||
<w:Locale mustUnderstand="false" xml:lang="en-US" /> | ||
<p:DataLocale mustUnderstand="false" xml:lang="en-US" /> | ||
<a:Action mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command</a:Action> | ||
<w:SelectorSet> | ||
<w:Selector Name="ShellId">0179DFE0-5409-4F07-946E-54635608A269</w:Selector> | ||
</w:SelectorSet> | ||
<w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI> | ||
<w:OptionSet> | ||
<w:Option Name="WINRS_CONSOLEMODE_STDIN">TRUE</w:Option> | ||
<w:Option Name="WINRS_SKIP_CMD_SHELL">FALSE</w:Option> | ||
</w:OptionSet> | ||
</env:Header> | ||
<env:Body> | ||
<rsp:CommandLine> | ||
<rsp:Command>"powershell.exe -EncodedCommand ZGly"</rsp:Command> | ||
</rsp:CommandLine> | ||
</env:Body> | ||
</env:Envelope> | ||
|
||
<!-- command id: 98EA8A09-FCCF-43A9-8D76-AA678A2FDE80 --> | ||
|
||
|
||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> | ||
<env:Header> | ||
<a:To>http://localhost:5985/wsman</a:To> | ||
<a:ReplyTo> | ||
<a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | ||
</a:ReplyTo> | ||
<w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize> | ||
<w:OperationTimeout>PT60S</w:OperationTimeout> | ||
<a:MessageID>uuid:eccb3559-1a6e-44fc-5cfb-ab2e2a95300b</a:MessageID> | ||
<w:Locale mustUnderstand="false" xml:lang="en-US" /> | ||
<p:DataLocale mustUnderstand="false" xml:lang="en-US" /> | ||
<a:Action mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Receive</a:Action> | ||
<w:SelectorSet> | ||
<w:Selector Name="ShellId">C64C758B-1A01-447D-A7BB-F85FD1E88148</w:Selector> | ||
</w:SelectorSet> | ||
<w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI> | ||
</env:Header> | ||
<env:Body> | ||
<rsp:Receive> | ||
<rsp:DesiredStream CommandId="92394CDB-903A-446C-BE25-1237E290BD1D">stdout stderr</rsp:DesiredStream> | ||
</rsp:Receive> | ||
</env:Body> | ||
</env:Envelope> | ||
|
||
|
||
|
||
|
||
<!-- Close shell --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"> | ||
<env:Header> | ||
<a:To>http://localhost:5985/wsman</a:To> | ||
<a:ReplyTo> | ||
<a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | ||
</a:ReplyTo> | ||
<w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize> | ||
<w:OperationTimeout>PT60S</w:OperationTimeout> | ||
<a:MessageID>uuid:ff1fcd4b-3f7a-4732-62e1-2afa9fbfd344</a:MessageID> | ||
<w:Locale mustUnderstand="false" xml:lang="en-US" /> | ||
<p:DataLocale mustUnderstand="false" xml:lang="en-US" /> | ||
<a:Action mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action> | ||
<w:SelectorSet> | ||
<w:Selector Name="ShellId">D24CE524-7FDD-481F-8824-87A2CC6A80AE</w:Selector> | ||
</w:SelectorSet> | ||
<w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI> | ||
</env:Header> | ||
<env:Body /> | ||
</env:Envelope> | ||
|
||
|
||
|
||
<!-- Working Signal Request --> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:b="http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd" xmlns:cfg="http://schemas.microsoft.com/wbem/wsman/1/config" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<env:Header> | ||
<a:To>http://localhost:5985/wsman</a:To> | ||
<a:ReplyTo> | ||
<a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | ||
</a:ReplyTo> | ||
<w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize> | ||
<a:MessageID>uuid:BE57E710-1E58-4955-AD2B-FF841ED3F52B</a:MessageID> | ||
<w:Locale xml:lang="en-US" mustUnderstand="false" /> | ||
<p:DataLocale xml:lang="en-US" mustUnderstand="false" /> | ||
<w:OperationTimeout>PT5M0S</w:OperationTimeout> | ||
<w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI> | ||
<a:Action mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Signal</a:Action> | ||
<w:SelectorSet> | ||
<w:Selector Name="ShellId">0179DFE0-5409-4F07-946E-54635608A269</w:Selector> | ||
</w:SelectorSet> | ||
</env:Header> | ||
<env:Body> | ||
<rsp:Signal CommandId="98EA8A09-FCCF-43A9-8D76-AA678A2FDE80"> | ||
<rsp:Code>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate</rsp:Code> | ||
</rsp:Signal> | ||
</env:Body> | ||
</env:Envelope> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
echo "==> Running commands using WinRM against a Vagrant machine:" | ||
echo | ||
|
||
|
||
echo "==> What's my execution policy?" | ||
winrm "powershell -command \"get-executionpolicy\"" | ||
echo "==> Whoami?" | ||
winrm "whoami" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
go test -v ./... | ||
|
||
# Run test coverage on each subdirectories and merge the coverage profile. | ||
echo "mode: count" > profile.cov | ||
|
||
# Standard go tooling behavior is to ignore dirs with leading underscors | ||
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); do | ||
if ls $dir/*.go &> /dev/null; then | ||
go test -covermode=count -coverprofile=$dir/profile.tmp $dir | ||
if [ -f $dir/profile.tmp ]; then | ||
cat $dir/profile.tmp | tail -n +2 >> profile.cov | ||
rm $dir/profile.tmp | ||
fi | ||
fi | ||
done | ||
|
||
go tool cover -func profile.cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.