Skip to content

Commit

Permalink
test: invoke fab
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Dec 20, 2011
1 parent e928dde commit b292659
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/linux_kvm.md
Expand Up @@ -39,15 +39,15 @@ 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

apt-get install openssh-server

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
Expand Down
18 changes: 14 additions & 4 deletions test/test_biolinux
Expand Up @@ -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
Expand Down Expand Up @@ -132,18 +133,27 @@ $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

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
Expand Down

0 comments on commit b292659

Please sign in to comment.