Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports differentiating between SSH/WinRM communicator now that new Vag... #67

Merged
merged 3 commits into from
Jul 7, 2014
Merged

Supports differentiating between SSH/WinRM communicator now that new Vag... #67

merged 3 commits into from
Jul 7, 2014

Conversation

marnovdm
Copy link

...rant version supports Windows guests. Technically it was already working this just changes the output so that it doesn't show "Waiting for SSH" when waiting for a Windows VM to boot.

@flamingbear
Copy link
Member

This left a bunch of broken specs. I'll have to take a look before I will pull.

Failures:

  1) VagrantPlugins::VSphere::Action up should check if the VM exits
     Failure/Error: Vagrant::Action::Runner.new.run described_class.send("action_#{action}"), @env
     VagrantPlugins::VSphere::Errors::VSphereError:
       No error message
     # ./lib/vSphere/action/connect_vsphere.rb:24:in `rescue in call'
     # ./lib/vSphere/action/connect_vsphere.rb:14:in `call'
     # ./spec/action_spec.rb:6:in `run'
     # ./spec/action_spec.rb:15:in `run_up'
     # ./spec/action_spec.rb:27:in `block (3 levels) in <top (required)>'

  2) VagrantPlugins::VSphere::Action up should create the VM when the VM does already not exist
     Failure/Error: Vagrant::Action::Runner.new.run described_class.send("action_#{action}"), @env
     VagrantPlugins::VSphere::Errors::VSphereError:
       No error message
     # ./lib/vSphere/action/connect_vsphere.rb:24:in `rescue in call'
     # ./lib/vSphere/action/connect_vsphere.rb:14:in `call'
     # ./spec/action_spec.rb:6:in `run'
     # ./spec/action_spec.rb:15:in `run_up'
     # ./spec/action_spec.rb:35:in `block (3 levels) in <top (required)>'

  3) VagrantPlugins::VSphere::Action::Clone should create a CloneVM task
     Failure/Error: call
       Double "config_vm" received unexpected message :communicator with (no args)
     # ./lib/vSphere/util/machine_helpers.rb:6:in `wait_for_ssh'
     # ./lib/vSphere/action/clone.rb:51:in `call'
     # ./spec/clone_spec.rb:9:in `block (2 levels) in <top (required)>'

  4) VagrantPlugins::VSphere::Action::Clone should set the machine id to be the new UUID
     Failure/Error: call
       Double "config_vm" received unexpected message :communicator with (no args)
     # ./lib/vSphere/util/machine_helpers.rb:6:in `wait_for_ssh'
     # ./lib/vSphere/action/clone.rb:51:in `call'
     # ./spec/clone_spec.rb:18:in `block (2 levels) in <top (required)>'

  5) VagrantPlugins::VSphere::Action::Clone should call the next item in the middleware stack
     Failure/Error: call
       Double "config_vm" received unexpected message :communicator with (no args)
     # ./lib/vSphere/util/machine_helpers.rb:6:in `wait_for_ssh'
     # ./lib/vSphere/action/clone.rb:51:in `call'
     # ./spec/clone_spec.rb:23:in `block (2 levels) in <top (required)>'

  6) VagrantPlugins::VSphere::Action::Clone should set static IP when given config spec
     Failure/Error: call
       Double "config_vm" received unexpected message :communicator with (no args)
     # ./lib/vSphere/util/machine_helpers.rb:6:in `wait_for_ssh'
     # ./lib/vSphere/action/clone.rb:51:in `call'
     # ./spec/clone_spec.rb:29:in `block (2 levels) in <top (required)>'

Finished in 1.77 seconds
34 examples, 6 failures

Failed examples:

rspec ./spec/action_spec.rb:24 # VagrantPlugins::VSphere::Action up should check if the VM exits
rspec ./spec/action_spec.rb:30 # VagrantPlugins::VSphere::Action up should create the VM when the VM does already not exist
rspec ./spec/clone_spec.rb:8 # VagrantPlugins::VSphere::Action::Clone should create a CloneVM task
rspec ./spec/clone_spec.rb:17 # VagrantPlugins::VSphere::Action::Clone should set the machine id to be the new UUID
rspec ./spec/clone_spec.rb:22 # VagrantPlugins::VSphere::Action::Clone should call the next item in the middleware stack
rspec ./spec/clone_spec.rb:27 # VagrantPlugins::VSphere::Action::Clone should set static IP when given config spec
/Users/savoie/.rbenv/versions/2.0.0-p451/bin/ruby -S rspec ./spec/action_spec.rb ./spec/clone_spec.rb ./spec/connect_vsphere_spec.rb ./spec/destroy_spec.rb ./spec/get_ssh_info_spec.rb ./spec/get_state_spec.rb ./spec/is_created_spec.rb failed

@marnovdm
Copy link
Author

Sorry about that, had not expected this change to impact unit tests, my bad.

I've looked at the issue & pushed a fix, rake now finishes successfully on my system. I hope I've interpreted this correctly as I've not worked with Ruby unit-tests before but I've added communicator field in spec_helper. Please let me know if this is not the clean way to implement this.

@flamingbear
Copy link
Member

Sorry, this passes specs, but breaks our vagrant up. Of course it's not a valuable error message. I'll have to look at this later.

savoie@savoie-laptop ~/Dropbox/projects/brightness-temperature-vm (master=)$ vagrant --verbose up development
Bringing machine 'development' up with 'vsphere' provider...
==> development: Calling vSphere CloneVM with the following settings:
==> development:  -- Template VM: Linux/SCM/dev/ubuntu-12-LTS-dev
==> development:  -- Name: savoie-default-test-development-20140520084552
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/plugin/v2/config.rb:73:in `method_missing'
/Users/savoie/.vagrant.d/gems/gems/vagrant-vsphere-0.8.3.pre.67/lib/vSphere/util/machine_helpers.rb:6:in `wait_for_ssh'
/Users/savoie/.vagrant.d/gems/gems/vagrant-vsphere-0.8.3.pre.67/lib/vSphere/action/clone.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builtin/call.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Users/savoie/.vagrant.d/gems/gems/vagrant-vsphere-0.8.3.pre.67/lib/vSphere/action/connect_vsphere.rb:19:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/machine.rb:157:in `action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.5.2/lib/vagrant/batch_action.rb:72:in `block (2 levels) in run'
No error message

@marnovdm
Copy link
Author

Hmm odd, it works for my Windows and Linux projects. The Linux projects don't even specify a communicator so it's not like it only works if you specify it.

I'm not really a Ruby guy so I don't know how to improve/fix this, please let me know if I can do anything else like provide debug output.

@mkuzmin
Copy link
Contributor

mkuzmin commented May 21, 2014

Windows guests are supported since Vagrant 1.6
Probably the error is caused by running the change under version 1.5.

@marnovdm
Copy link
Author

Can't believe I missed that, good spot! Hopefully this can be merged now.

@flamingbear flamingbear merged commit 09f24d1 into nsidc:master Jul 7, 2014
@flamingbear
Copy link
Member

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants