Sha256: f7d3ca1aed6ca7bc79d5f749be7ad498de85fb7c2db418c41ac0745d0a9df486

Contents?: true

Size: 1.2 KB

Versions: 35

Compression:

Stored size: 1.2 KB

Contents

module Rudy::Test
  
  class Case_25_EC2
    
    context "#{name}_10 KeyPairs" do
      setup do
        @@test_name ||= 'test-' << Rudy::Utils.strand
        @ec2key = Rudy::AWS::EC2::KeyPairs.new(@@global.accesskey, @@global.secretkey, @@global.region)
        #@ami = @@config.machines.find(@@zone.to_sym, :ami)
      end
      
      
      should "(10) create keypair" do
        keypair = @ec2key.create(@@test_name)
        assert keypair.is_a?(Rudy::AWS::EC2::KeyPair), "Not a KeyPair"
        assert !keypair.name.empty?, "No name"
        assert !keypair.fingerprint.empty?, "No fingerprint"
        assert !keypair.private_key.empty?, "No private key"
      end
      
      should "(20) list keypairs" do
        keypairs = @ec2key.list || []
        assert keypairs.size > 0, "No keypairs"
      end
      
      should "(21) get specific keypair" do
        assert @ec2key.get(@@test_name).is_a?(Rudy::AWS::EC2::KeyPair), "Not a KeyPair (#{@@test_name})"
      end
      
      should "(50) destroy keypairs" do
        keypairs = @ec2key.list || []
        assert keypairs.size > 0, "No keypairs"
        keypairs.each do |kp|
          @ec2key.destroy(kp.name)
        end
      end
    end
    
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
sabat-rudy-0.8.0 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.0 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.1 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.2 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.3 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.4 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.5 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.6 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.7 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.6.8 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.0 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.1 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.2 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.3 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.4 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.5 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.7.6 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.8.0 test/25_ec2/10_keypairs_test.rb
solutious-rudy-0.8.1 test/25_ec2/10_keypairs_test.rb
rudy-0.6.1 test/25_ec2/10_keypairs_test.rb