Test-kitchen VM naming problems


#1

Hello,

I am having troubles using test-kitchen

First i can’t use the platform parameter
Using kitchen test --platform ubuntu-12.04 still starts all VMs.
But worse is that i can’t ssh to any machine.

Here is example kitchen status:
Current VM states:

centos-5.8 not created
centos-6.3 not created
ubuntu-10.04 running
ubuntu-12.04 running

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run vagrant status NAME.

Yet runing kitchen ssh ubuntu-12.04 does
/usr/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:105:in with_target_vms': This command requires a specific VM name to target in a multi-VM environment. (Vagrant::Errors::MultiVMTargetRequired) from /usr/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/ssh.rb:39:inexecute’
from /usr/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/cli.rb:42:in execute' from /usr/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/environment.rb:167:incli’
from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/runner/vagrant.rb:47:in ssh' from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/cli/ssh.rb:30:inrun’
from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/cli.rb:108:in run' from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/cli.rb:72:inrun’
from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/bin/kitchen:7:in <top (required)>' from /usr/bin/kitchen:23:inload’
from /usr/bin/kitchen:23:in `’’

I also noticed that Virtualbox shows a diferent name for these machines[1], but trying ubuntu-12-04 does the same result.

Goint to the .kitchen directory and runing vagrant status gives me a failed to require problem.
So I decided to install test-kicthen with "vagrant gem install test-kitchen"
and vagrant status and ssh work fine.

But now kitchen status give me
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in require': cannot load such file -- chef/mixin/params_validate (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:inrescue in require’
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in require' from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/project/base.rb:19:in<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:inrequire’
from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/project.rb:19:in <top (required)>' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:inrequire’
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen/dsl.rb:20:in<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:inrequire’
from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/lib/test-kitchen.rb:21:in <top (required)>' from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:inrequire’
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /usr/lib/ruby/gems/1.9.1/gems/test-kitchen-0.6.0/bin/kitchen:5:in<top (required)>'
from /usr/bin/kitchen:23:in load' from /usr/bin/kitchen:23:in‘’

yet $ ls /usr/lib/ruby/gems/1.9.1/gems/chef-10.16.0/lib/chef/mixin/params_validate.rb
/usr/lib/ruby/gems/1.9.1/gems/chef-10.16.0/lib/chef/mixin/params_validate.rb

I am use chef-10.16.0 and test-kitchen 0.6.0

Any ideas welcome!

[1] http://ompldr.org/vZzBxMQ/2012-10-25-141829_423x119_scrot.png


Regards,
Alfredo Palhares


#2

So the problem was that vagrant is ignoring system wide gems.

I also noticed that vagrant gem would install to $HOME/.gems instead
of $HOME/.vagrant.d/gems

The workaround I did was symlink’ing $HOME/.vagrant.d/gems to /usr/lib/ruby/gems/1.9.1/gems

I opened a ticket[1] on kitchen since I was told on #vagrant (freenode) that system wide gems are
ignored by design, but please tell me if opening a bug for knife is silly (probably is)

[1]http://tickets.opscode.com/browse/KITCHEN-43