Sha256: 1ba8d55cf33a19bb6e6e2cc23e209f7d8c4ef061d5dd9a6022487dd5d758146b

Contents?: true

Size: 1.6 KB

Versions: 4

Compression:

Stored size: 1.6 KB

Contents

group "Metadata"
library :rudy, 'lib'

tryout "Disk Volume API" do
  
  set :test_domain, 'test_' #<< Rudy::Utils.strand(4)
  set :test_env, 'stage' << Rudy::Utils.strand(4)
  
  setup do
    Rudy.enable_debug
    Rudy::Huxtable.global.offline = true
    Rudy::Huxtable.update_config          # Read config files
    global = Rudy::Huxtable.global
    global.environment = test_env
    akey, skey, region = global.accesskey, global.secretkey, global.region
    Rudy::Metadata.connect akey, skey, region
    Rudy::AWS::EC2.connect akey, skey, region
  end
  
  clean do
    if Rudy.debug?
      puts $/, "Rudy Debugging:"
      Rudy::Huxtable.logger.rewind
      puts Rudy::Huxtable.logger.read unless Rudy::Huxtable.logger.closed_read?
    end
  end
  
  dream :volid, nil
  drill "disk volid is nil by default" do
    Rudy::Disk.new '/any/path'
  end
  
  dream :nil?, false
  dream :class, String
  drill "create disk instance with volume" do
    disk = Rudy::Disk.new '/sergeant/disk'
    disk.create
    disk.volid
  end
  
  dream :nil?, false
  drill "refresh disk" do
    disk = Rudy::Disk.new '/sergeant/disk'
    disk.refresh!
    disk.volid
  end
  
  xdrill "can attach volume to instance"
  xdrill "can mount volume"
  xdrill "can detach volume from instance"
  
  dream [true, false, false]
  drill "knows about the state of the volume" do
    disk = Rudy::Disk.new '/sergeant/disk'
    disk.refresh!
    [disk.volume_exists?, disk.volume_attached?, disk.volume_in_use?]
  end
  
  dream true
  drill "destroy disk with volume" do
    disk = Rudy::Disk.new '/sergeant/disk'
    disk.refresh!
    disk.destroy
  end
  
  
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
solutious-rudy-0.9.0 tryouts/30_metadata/56_disk_volume_tryouts.rb
solutious-rudy-0.9.1 tryouts/30_metadata/56_disk_volume_tryouts.rb
rudy-0.9.0 tryouts/30_metadata/56_disk_volume_tryouts.rb
rudy-0.9.1 tryouts/30_metadata/56_disk_volume_tryouts.rb