Browse files

Added -user option to the validate command.

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...
1 parent 2b5d758 commit 3ac0ba4d20c478086fd3db5da03e0896f74e2f47 @jedi4ever jedi4ever committed Jul 1, 2011
View
1 README.md
@@ -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/
View
3 lib/veewee/command.rb
@@ -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
View
4 lib/veewee/session.rb
@@ -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
View
2 templates/openindiana-148-ai-x86/definition.rb
@@ -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
})
View
4 templates/openindiana-148-ai-x86/postinstall.sh
@@ -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
View
2 templates/solaris-11-express-i386/definition.rb
@@ -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
})

0 comments on commit 3ac0ba4

Please sign in to comment.