From b29265941368be620863770845a29ee72a56046e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Tue, 20 Dec 2011 15:07:11 +0100 Subject: [PATCH] test: invoke fab --- doc/linux_kvm.md | 4 ++-- test/test_biolinux | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/linux_kvm.md b/doc/linux_kvm.md index 93267a50b..4c6c54031 100644 --- a/doc/linux_kvm.md +++ b/doc/linux_kvm.md @@ -39,7 +39,7 @@ the smaller net install of Debian Linux: hit ESC and type 'install fb=false'. This will fire up the installer. With the base install, boot the new system - qemu-system-x86_64 -enable-kvm -redir tcp:22000::22 -hda hda.img + qemu-system-x86_64 -enable-kvm -redir tcp:2222::22 -hda hda.img and set up ssh on the VM @@ -47,7 +47,7 @@ and set up ssh on the VM so this works - ssh -p 22000 biolinux@localhost + ssh -p 2222 biolinux@localhost so it can be used on a user without a password (preferably using a key with empty password). Also give that use 'sudo bash'. This ssh and sudo diff --git a/test/test_biolinux b/test/test_biolinux index 1fd438290..40a96a856 100755 --- a/test/test_biolinux +++ b/test/test_biolinux @@ -93,6 +93,7 @@ if ARGV.size == 0 or ARGV.index('-h') or ARGV.index('--help') --continue Continue install on an already running VM (no VM setup) -i ssh key (passwordless) -p ssh port (default 22) + --password use password -u ssh user login (user should have sudo bash) --list List Flavors available for testing --help Print this info @@ -132,6 +133,7 @@ $hostname = ARGV.shift $flavor = ARGV.shift # default values $hostname = 'localhost' if not $hostname +$user = 'biolinux' if not $user $flavor = 'Minimal' if not $flavor $port = 22 if not $port @@ -139,11 +141,19 @@ print "Testing #{$flavor} (#{$user}@#{$hostname})\n" # Fire up the CloudBioLinux fab file - this installs the software # on the VM -srcpath = File.dirname(File.dirname(__FILE__)) -fabricrc = config[$flavor][:fabricrc] -packagelist = config[$flavor][:packagelist] +srcpath = File.join(File.dirname(__FILE__),"..") +fabricrc = srcpath + '/' + config[$flavor][:fabricrc] +packagelist = srcpath + '/' + config[$flavor][:packagelist] -run "fab -f #{srcpath}/fabfile.py -H #{$hostname} -c #{fabricrc} install_biolinux:packagelist=#{packagelist},environment=biolinux-test" +fab_opts = "" +fab_opts += " -p #{$pwd}" if $pwd +fab_opts += " -u #{$user}" if $user +fab_opts += " -i #{$sshkey}" if $sshkey +fab_opts += " -H #{$hostname}" +fab_opts += ":#{$port}" if $port + + +run "fab #{fab_opts} -f #{srcpath}/fabfile.py -c #{fabricrc} install_biolinux:packagelist=#{packagelist},environment=biolinux-test" Net::SSH.start($hostname, $user, :password => $pwd, :keys => [$sshkey], :port => $port) do |ssh| @ssh = ssh