Sha256: 435c864bc833eb13bc8644e1bb85b646bffc61045841cfc38b4947180bce130d

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

module Veewee
  module Provider
    module Kvm
      module BoxCommand

        def validate_kvm(options)
          require 'cucumber'

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

          # Passing ssh options via ENV varialbles to cucumber
          # VEEWEE_SSH_USER, VEEWEE_SSH_PASSWORD ,VEEWEE_SSH_PORT
          cucumber_vars=ssh_options
          cucumber_vars.each do |key,value|
            ENV['VEEWEE_'+key.to_s.upcase]=cucumber_vars[key].to_s
          end

          # Pass the name of the box
          ENV['VEEWEE_BOXNAME']=@name
          ENV['VEEWEE_PROVIDER']="kvm"

          feature_path=File.join(File.dirname(__FILE__),"..","..","..","..","..","validation","veewee.feature")

          features=Array.new
          features[0]=feature_path
          features[1]="--tags"
          features[2]="@kvm"

          begin
            # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
            failure = Cucumber::Cli::Main.execute(features.dup)
            Kernel.exit(failure ? 1 : 0)
          rescue SystemExit => e
            Kernel.exit(e.status)
          rescue Exception => e
            ui.error("#{e.message} (#{e.class})")
            ui.error(e.backtrace.join("\n"))
            Kernel.exit(1)
          end

        end
      end #Module

    end #Module
  end #Module
end #Module

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veewee-0.3.0.beta1 lib/veewee/provider/kvm/box/validate_kvm.rb
veewee-0.3.0.alpha9 lib/veewee/provider/kvm/box/validate_kvm.rb
veewee-0.3.0.alpha8 lib/veewee/provider/kvm/box/validate_kvm.rb
veewee-0.3.0.alpha7 lib/veewee/provider/kvm/box/validate_kvm.rb