mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
correct issues in previous commit
This commit is contained in:
parent
3532335485
commit
bba30d0244
4 changed files with 5 additions and 12 deletions
|
@ -1,5 +1,3 @@
|
||||||
require 'rubygems'
|
|
||||||
require 'fog'
|
|
||||||
def test
|
def test
|
||||||
connection = Fog::Compute.new({ :provider => "Google" })
|
connection = Fog::Compute.new({ :provider => "Google" })
|
||||||
|
|
||||||
|
@ -18,6 +16,8 @@ def test
|
||||||
:name => "fog-smoke-test-#{Time.now.to_i}",
|
:name => "fog-smoke-test-#{Time.now.to_i}",
|
||||||
:disks => [disk],
|
:disks => [disk],
|
||||||
:machine_type => "n1-standard-1",
|
:machine_type => "n1-standard-1",
|
||||||
|
:private_key_path => File.expand_path("~/.ssh/id_rsa"),
|
||||||
|
:public_key_path => File.expand_path("~/.ssh/id_rsa.pub"),
|
||||||
:zone_name => "us-central1-a",
|
:zone_name => "us-central1-a",
|
||||||
:user => ENV['USER'],
|
:user => ENV['USER'],
|
||||||
:tags => ["fog"]
|
:tags => ["fog"]
|
||||||
|
@ -47,4 +47,3 @@ def test
|
||||||
raise "Could not bootstrap sshable server." unless server.ssh("whoami")
|
raise "Could not bootstrap sshable server." unless server.ssh("whoami")
|
||||||
raise "Could not delete server." unless server.destroy
|
raise "Could not delete server." unless server.destroy
|
||||||
end
|
end
|
||||||
test
|
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
require 'pry-nav'
|
|
||||||
require 'rubygems'
|
|
||||||
require 'fog'
|
|
||||||
def test
|
def test
|
||||||
connection = Fog::Compute.new({ :provider => "Google" })
|
connection = Fog::Compute.new({ :provider => "Google" })
|
||||||
|
|
||||||
rawdisk = {
|
rawdisk = {
|
||||||
:source => 'https://www.googleapis.com/compute/v1/projects/graphite-demos/zones/us-central1-a/disks/fog-smoke-test-1406777369', # 'http://some_valid_url_to_rootfs_tarball'
|
:source => nil, # 'http://some_valid_url_to_rootfs_tarball'
|
||||||
:container_type => 'TAR',
|
:container_type => 'TAR',
|
||||||
}
|
}
|
||||||
|
|
||||||
# Can't test this unless the 'source' points to a valid URL
|
# Can't test this unless the 'source' points to a valid URL
|
||||||
return if rawdisk[:source].nil?
|
return if rawdisk[:source].nil?
|
||||||
binding.pry
|
|
||||||
img = connection.images.create(:name => 'test-image',
|
img = connection.images.create(:name => 'test-image',
|
||||||
:description => 'Test image (via fog)',
|
:description => 'Test image (via fog)',
|
||||||
:raw_disk => rawdisk)
|
:raw_disk => rawdisk)
|
||||||
|
|
||||||
img.reload # will raise if image was not saved correctly
|
img.reload # will raise if image was not saved correctly
|
||||||
end
|
end
|
||||||
test
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
def model_tests(collection, params = {}, mocks_implemented = true)
|
def model_tests(collection, params = {}, mocks_implemented = true)
|
||||||
tests('success') do
|
tests('success') do
|
||||||
|
|
||||||
|
@ -17,6 +16,7 @@ def model_tests(collection, params = {}, mocks_implemented = true)
|
||||||
pending if Fog.mocking? && !mocks_implemented
|
pending if Fog.mocking? && !mocks_implemented
|
||||||
@instance.destroy
|
@instance.destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
ENV['FOG_MOCK'] ||= 'true'
|
ENV['FOG_MOCK'] ||= 'true'
|
||||||
ENV['AUTOTEST'] = 'true'
|
ENV['AUTOTEST'] = 'true'
|
||||||
ENV['WATCHR'] = '1'
|
ENV['WATCHR'] = '1'
|
||||||
require 'pry-nav'
|
|
||||||
|
|
||||||
def file2shindo(file)
|
def file2shindo(file)
|
||||||
result = file.sub('lib/fog/', 'tests/').gsub(/\.rb$/, '_tests.rb')
|
result = file.sub('lib/fog/', 'tests/').gsub(/\.rb$/, '_tests.rb')
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_shindo_test(file)
|
def run_shindo_test(file)
|
||||||
binding.pry
|
|
||||||
if File.exist? file
|
if File.exist? file
|
||||||
system("shindont #{file}")
|
system("shindont #{file}")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue