Sha256: 71591ac671db877866eedfd20a8a770c231a6046cb4e30ac544bb36b73cd2364

Contents?: true

Size: 1.24 KB

Versions: 32

Compression:

Stored size: 1.24 KB

Contents

group "EC2"
library :rudy, 'lib'


tryouts "Keypairs" do
  set :global, Rudy::Huxtable.global
  set :keypair_name, 'key-' << Rudy::Utils.strand
  
  setup do
    Rudy::Huxtable.update_config
    #Rudy::Huxtable.global.region = :'eu-west-1'
    Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
  end
  
  drill "no existing keypairs", false do
    Rudy::AWS::EC2::Keypairs.any?
  end
  
  dream [Rudy::AWS::EC2::Keypair, false]
  drill "create keypair" do
    k = Rudy::AWS::EC2::Keypairs.create keypair_name
    [k.class, k.private_key.nil?]
  end
  
  drill "get keypair", :class, Rudy::AWS::EC2::Keypair do
    Rudy::AWS::EC2::Keypairs.get keypair_name
  end
  
  drill "has fingerprint", :empty?, false do
    k = Rudy::AWS::EC2::Keypairs.get keypair_name
    k.fingerprint
  end
  
  drill "private key is not available later", nil do
    k = Rudy::AWS::EC2::Keypairs.get keypair_name
    k.private_key
  end
  
  dream :class, Array
  dream :empty?, false
  drill "list keypairs" do
    Rudy::AWS::EC2::Keypairs.list
  end
  
  drill "destroy keypairs", nil do
    keypairs = Rudy::AWS::EC2::Keypairs.list
    keypairs.each do |kp|
      Rudy::AWS::EC2::Keypairs.destroy kp.name
    end
    Rudy::AWS::EC2::Keypairs.list
  end
  
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
solutious-rudy-0.9.2 tryouts/25_ec2/10_keypairs_tryouts.rb
solutious-rudy-0.9.3 tryouts/25_ec2/10_keypairs_tryouts.rb
solutious-rudy-0.9.4 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.020 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.019 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.018 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.017 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.016 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.015 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.014 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.013 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.012 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.011 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.010 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.009 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.008 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.007 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.006 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.005 tryouts/25_ec2/10_keypairs_tryouts.rb
rudy-0.9.8.004 tryouts/25_ec2/10_keypairs_tryouts.rb