1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[bluebox|blb] more request tests, missing comma

This commit is contained in:
Josh Yotty 2013-03-04 16:21:37 -08:00
parent f837f6f644
commit 44ac2274d5
4 changed files with 53 additions and 1 deletions

View file

@ -24,6 +24,7 @@ module Fog
:expects => 200,
:method => 'GET',
:path => "api/lb_applications/#{lb_application_id}/lb_services/#{lb_service_id}.json"
:parser => Fog::Parsers::Bluebox::BLB::LbService.new
)
end
end

View file

@ -16,7 +16,7 @@ module Fog
request(
:expects => 200,
:method => 'PUT',
:path => "/api/lb_backends/#{lb_backend_id}/lb_machines/#{lb_machine_id}"
:path => "/api/lb_backends/#{lb_backend_id}/lb_machines/#{lb_machine_id}",
:body => options.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v.to_s)}"}.join('&')
)
end

View file

@ -10,6 +10,23 @@ class Bluebox
'source_ip_v4' => Fog::Nullable::String,
}
LB_APPLICATIONS = [LB_APPLICATION]
LB_SERVICE = {
'name' => String,
'port' => Integer,
'private' => Fog::Boolean,
'status_username' => String,
'status_password' => String,
'status_url' => String,
'service_type' => String,
'created' => DateTime,
'lb_backends' => Array,
'pem_file_uploaded?' => Fog::Nullable::Boolean,
}
LB_SERVICES = [LB_SERVICE]
ADD_MACHINE_TO_LB = {
'status' => String,
'text' => String,

View file

@ -1,7 +1,41 @@
require 'securerandom'
Shindo.tests('Bluebox::BLB | lb_tests', ['bluebox']) do
pending if Fog.mocking?
tests('success') do
@flavor_id = compute_providers[:bluebox][:server_attributes][:flavor_id]
@image_id = compute_providers[:bluebox][:server_attributes][:image_id]
@location_id = compute_providers[:bluebox][:server_attributes][:location_id]
@password = SecureRandom.base64(18)
@lb_applications = nil
tests("get_lb_applications").formats(Bluebox::BLB::Formats::LB_APPLICATIONS) do
@lb_applications = Fog::Bluebox[:blb].get_lb_applications.body
end
tests("get_lb_application").formats(Bluebox::BLB::Formats::LB_APPLICATION) do
Fog::Bluebox[:blb].get_lb_application(@lb_applications.first['id']).body
end
tests("get_lb_services").formats(Bluebox::BLB::Formats::LB_SERVICES) do
@lb_services = Fog::Bluebox[:blb].get_lb_services(@lb_applications.first['id']).body
end
tests("get_lb_service").formats(Bluebox::BLB::Formats::LB_SERVICE) do
Fog::Bluebox[:blb].get_lb_service(@lb_applications.first['id'], @lb_services.first['id']).body
end
tests("get_lb_backends").formats(Bluebox::BLB::Formats::LB_BACKEND) do
end
tests("get_lb_backend").formats(Bluebox::BLB::Formats::LB_BACKEND) do
end
#data = Fog::Compute[:bluebox].create_block(@flavor_id, @image_id, @location_id, {'password' => @password}).body
#@block_id = data['id']
#Fog::Compute[:bluebox].servers.get(@block_id).wait_for { ready? }
#Fog::Compute[:bluebox].destroy_block(@block_id).body
end
tests('failure') do