mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
4c2736d0c2
Simplify attachment of boot disk, get_as_boot_disk no longer needed Add missing Disk.get_object method Allow setting deviceName when attaching a disk Add disks mocks
17 lines
557 B
Ruby
17 lines
557 B
Ruby
def test
|
|
connection = Fog::Compute.new({ :provider => "Google" })
|
|
|
|
rawdisk = {
|
|
:source => nil, # 'http://some_valid_url_to_rootfs_tarball'
|
|
:container_type => 'TAR',
|
|
}
|
|
|
|
# Can't test this unless the 'source' points to a valid URL
|
|
return if rawdisk[:source].nil?
|
|
|
|
img = connection.image.create(:name => 'test-image',
|
|
:description => 'Test image (via fog)',
|
|
:raw_disk => rawdisk)
|
|
|
|
img.reload # will raise if image was not saved correctly
|
|
end
|