Use Winrm 1.2.0 and fix tests

This commit is contained in:
Max Lincoln 2014-07-22 17:30:58 -04:00
parent 243cc5dc37
commit 2b9626f19c
4 changed files with 17 additions and 31 deletions

View File

@ -1,8 +1,6 @@
source "https://rubygems.org"
gemspec
# f4ece43: Allow the user to disable SSL peer verification.
gem 'winrm', git: 'https://github.com/WinRb/WinRM.git', ref: 'f4ece4384df2768bc7756c3c5c336db65b05c674'
if File.exist?(File.expand_path("../../vagrant-spec", __FILE__))
gem 'vagrant-spec', path: "../vagrant-spec"

View File

@ -51,7 +51,7 @@ describe VagrantPlugins::CommunicatorWinRM::WinRMShell do
it "should create endpoint options" do
expect(subject.send(:endpoint_options)).to eq(
{ user: "username", pass: "password", host: "localhost", port: 5985,
operation_timeout: 60, basic_auth_only: true })
operation_timeout: 60, basic_auth_only: true, no_ssl_peer_verification: true })
end
end

View File

@ -23,6 +23,13 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
end
def find_network(name)
network_definitions = subject.networks.map do |n|
n[1]
end
network_definitions.find {|n| n[:id] == name}
end
before do
env = double("env")
env.stub(root_path: nil)
@ -121,28 +128,6 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
end
describe "#define" do
it "should allow regular names" do
subject.define "foo"
subject.finalize!
assert_valid
end
[
"foo [1]",
"bar {2}",
"foo/bar",
].each do |name|
it "should disallow names with brackets" do
subject.define name
subject.finalize!
assert_invalid
end
end
end
describe "#guest" do
it "is nil by default" do
subject.finalize!
@ -183,16 +168,20 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
subject.finalize!
n = subject.networks
expect(n.length).to eq(2)
# WinRM HTTP
expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(5985)
expect(n[0][1][:host]).to eq(55985)
expect(n[0][1][:host_ip]).to eq("127.0.0.1")
expect(n[0][1][:id]).to eq("winrm")
# WinRM HTTPS
expect(n[1][0]).to eq(:forwarded_port)
expect(n[1][1][:guest]).to eq(22)
expect(n[1][1][:host]).to eq(2222)
expect(n[1][1][:id]).to eq("ssh")
expect(n[1][1][:guest]).to eq(5986)
expect(n[1][1][:host]).to eq(55986)
expect(n[1][1][:host_ip]).to eq("127.0.0.1")
expect(n[1][1][:id]).to eq("winrmssl")
end
it "allows overriding SSH" do
@ -215,7 +204,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
subject.finalize!
n = subject.networks
expect(n.length).to eq(2)
expect(n.length).to eq(1)
expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(22)
expect(n[0][1][:host]).to eq(14100)

View File

@ -28,8 +28,7 @@ Gem::Specification.new do |s|
s.add_dependency "rb-kqueue", "~> 0.2.0"
s.add_dependency "rest-client", ">= 1.6.0", "< 2.0"
s.add_dependency "wdm", "~> 0.1.0"
# 1.1.4 (Unreleased)
#s.add_dependency "winrm", "~> 1.1.3"
s.add_dependency "winrm", "~> 1.2"
# We lock this down to avoid compilation issues.
s.add_dependency "nokogiri", "= 1.6.3.1"