Sha256: 0a033764339694928f7793ad55ddf2514379ad3b26ff65fcce1496718d3a1d20

Contents?: true

Size: 810 Bytes

Versions: 25

Compression:

Stored size: 810 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.select { |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

25 entries across 25 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/xenserver/helper.rb
fog-1.34.0 tests/xenserver/helper.rb
fog-1.33.0 tests/xenserver/helper.rb
fog-1.32.0 tests/xenserver/helper.rb
fog-1.31.0 tests/xenserver/helper.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/xenserver/helper.rb
fog-1.30.0 tests/xenserver/helper.rb
fog-1.29.0 tests/xenserver/helper.rb
fog-1.28.0 tests/xenserver/helper.rb
fog-1.27.0 tests/xenserver/helper.rb
fog-1.26.0 tests/xenserver/helper.rb
fog-1.25.0 tests/xenserver/helper.rb
nsidc-fog-1.24.1 tests/xenserver/helper.rb
fog-1.24.0 tests/xenserver/helper.rb
ns-fog-1.22.11 tests/xenserver/helper.rb
ns-fog-1.22.10 tests/xenserver/helper.rb
ns-fog-1.22.9 tests/xenserver/helper.rb
ns-fog-1.22.8 tests/xenserver/helper.rb
ns-fog-1.22.7 tests/xenserver/helper.rb
ns-fog-1.22.6 tests/xenserver/helper.rb