Skip to content

Commit

Permalink
Added -user option to the validate command.
Browse files Browse the repository at this point in the history
The info is passed to the cucumber through an environment variable ENV['veewee_user']
Now the next thing is to rewrite the ssh_steps.rb to make use of it
  • Loading branch information
jedi4ever committed Jul 1, 2011
1 parent 2b5d758 commit 3ac0ba4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -5,6 +5,7 @@ The first step is to download an existing 'base box'. I believe this scares a lo
Veewee tries to automate this and to share the knowledge and sources you need to create a basebox. Instead of creating custom ISO's from your favorite distribution, it leverages the 'keyboardputscancode' command of Virtualbox so send the actual 'boot prompt' keysequence to boot an existing iso.

Before we can actually build the boxes, we need to take care of the minimal things to install:

- Have Virtualbox 4.x installed -> download it from http://download.virtualbox.org/virtualbox/


Expand Down
3 changes: 2 additions & 1 deletion lib/veewee/command.rb
Expand Up @@ -70,9 +70,10 @@ def export(boxname)
end

desc "validate [NAME]", "Validates a box against vagrant compliancy rules"
method_option :user,:default => "vagrant", :aliases => "-u", :desc => "user to login with"
def validate(boxname)
if (!boxname.nil?)
Veewee::Session.validate_box(boxname)
Veewee::Session.validate_box(boxname,options)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/veewee/session.rb
Expand Up @@ -696,13 +696,13 @@ def self.local_ip
Socket.do_not_reverse_lookup = orig
end

def self.validate_box(boxname)
def self.validate_box(boxname,options)
require 'cucumber'

require 'cucumber/rspec/disable_option_parser'
require 'cucumber/cli/main'


ENV['veewee_user']=options[:user]
feature_path=File.join(File.dirname(__FILE__),"..","..","validation","vagrant.feature")

features=Array.new
Expand Down
2 changes: 1 addition & 1 deletion templates/openindiana-148-ai-x86/definition.rb
Expand Up @@ -44,7 +44,7 @@
:ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
:ssh_host_port => "7222", :ssh_guest_port => "22",
:sudo_cmd => "echo '%p'|sudo -S bash ./%f",
:shutdown_cmd => "/sbin/halt -h -p",
:shutdown_cmd => "/usr/sbin/halt",
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
})

Expand Down
4 changes: 4 additions & 0 deletions templates/openindiana-148-ai-x86/postinstall.sh
Expand Up @@ -70,6 +70,10 @@ yes|/usr/sbin/pkgadd -d . SUNWvbox
echo "export PATH=/opt/csw/bin:/opt/csw/sbin:$PATH" >> /root/.profile
echo "export PATH=/opt/csw/bin:/opt/csw/sbin:$PATH" >> /export/home/vagrant/.profile

# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY

echo "Note: validation of this box wil fail, as it's not linux based, working on that"

exit
Expand Down
2 changes: 1 addition & 1 deletion templates/solaris-11-express-i386/definition.rb
Expand Up @@ -50,7 +50,7 @@
:ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
:ssh_host_port => "7222", :ssh_guest_port => "22",
:sudo_cmd => "echo '%p'|sudo -S bash ./%f",
:shutdown_cmd => "/sbin/halt -h -p",
:shutdown_cmd => "/usr/sbin/halt",
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
})

Expand Down

0 comments on commit 3ac0ba4

Please sign in to comment.