Sha256: 787778e76372fb63839918de3dda5c1d9b072a971c6f66285ead5f018c192b85

Contents?: true

Size: 813 Bytes

Versions: 78

Compression:

Stored size: 813 Bytes

Contents

def test_template_name
  ENV['FOG_XENSERVER_TEMPLATE'] || 'squeeze-test'
end

def test_ephemeral_vm_name
  'fog-test-server-shindo'
end

def valid_ref?(ref)
  (ref =~ /OpaqueRef:/) and \
    (ref != "OpaqueRef:NULL" )
end

def create_ephemeral_vm
  Fog::Compute[:xenserver].servers.create(:name => test_ephemeral_vm_name, 
                                          :template_name => test_template_name)
end

def create_ephemeral_server
  create_ephemeral_vm
end

def destroy_ephemeral_servers
  servers = Fog::Compute[:xenserver].servers
  # Teardown cleanup
  (servers.all :name_matches => test_ephemeral_vm_name).each do |s|
    s.destroy
  end
  (servers.templates.find_all { |t| t.name == test_ephemeral_vm_name}).each do |s|
    s.destroy
  end
end

def destroy_ephemeral_vms
  destroy_ephemeral_servers
end

Version data entries

78 entries across 78 versions & 11 rubygems

Version Path
fog-1.22.0 tests/xenserver/helper.rb
fog-1.21.0 tests/xenserver/helper.rb
fog-maestrodev-1.20.0.20140305101839 tests/xenserver/helper.rb
fog-maestrodev-1.20.0.20140305101305 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140212012611 tests/xenserver/helper.rb
fog-1.20.0 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140110004459 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140110003812 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140109202555 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140107192102 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20140107142106 tests/xenserver/helper.rb
fog-maestrodev-1.19.0.20131219203941 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131219193542 tests/xenserver/helper.rb
fog-1.19.0 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131219033443 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131219032002 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131219030716 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131219022322 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131218202447 tests/xenserver/helper.rb
fog-maestrodev-1.18.0.20131209091424 tests/xenserver/helper.rb