2011-01-10 01:12:48 -05:00
|
|
|
require 'fog'
|
2011-09-15 09:01:03 -04:00
|
|
|
require 'fog/bin' # for available_providers
|
2010-11-04 14:12:44 -04:00
|
|
|
|
2011-02-05 12:28:36 -05:00
|
|
|
require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'mock_helper'))
|
2010-11-21 09:02:34 -05:00
|
|
|
|
2011-01-21 20:42:56 -05:00
|
|
|
def lorem_file
|
|
|
|
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
|
2011-01-14 14:01:02 -05:00
|
|
|
end
|
|
|
|
|
2011-10-26 10:08:48 -04:00
|
|
|
def array_differences(array_a, array_b)
|
|
|
|
(array_a - array_b) | (array_b - array_a)
|
|
|
|
end
|
|
|
|
|
2010-11-22 20:49:27 -05:00
|
|
|
# check to see which credentials are available and add others to the skipped tags list
|
2012-07-28 11:53:15 -04:00
|
|
|
all_providers = ['aws', 'bare_metal_cloud', 'bluebox', 'brightbox', 'cloudstack', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'hp', 'linode', 'local', 'ninefold', 'openstack', 'rackspace', 'stormondemand', 'voxel', 'xenserver', 'zerigo']
|
2011-05-24 20:31:05 -04:00
|
|
|
available_providers = Fog.available_providers.map {|provider| provider.downcase}
|
2010-11-22 20:49:27 -05:00
|
|
|
for provider in (all_providers - available_providers)
|
|
|
|
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")
|
|
|
|
Thread.current[:tags] << ('-' << provider)
|
|
|
|
end
|
2012-05-28 14:06:46 -04:00
|
|
|
|
|
|
|
# mark libvirt tests pending if not setup
|
|
|
|
begin
|
|
|
|
require('ruby-libvirt')
|
|
|
|
rescue LoadError
|
2012-05-28 16:17:12 -04:00
|
|
|
Formatador.display_line("[yellow]Skipping tests for [bold]libvirt[/] [yellow]due to missing `ruby-libvirt` gem.[/]")
|
2012-05-28 14:06:46 -04:00
|
|
|
Thread.current[:tags] << '-libvirt'
|
|
|
|
end
|