You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:48:55 UTC

svn commit: r962355 - in /incubator/deltacloud/trunk/client/specs: instances_spec.rb realms_spec.rb spec_helper.rb storage_volume_spec.rb

Author: lutter
Date: Thu Jul  8 23:48:55 2010
New Revision: 962355

URL: http://svn.apache.org/viewvc?rev=962355&view=rev
Log:
Fixed wrong values and class names in RSpec files

Modified:
    incubator/deltacloud/trunk/client/specs/instances_spec.rb
    incubator/deltacloud/trunk/client/specs/realms_spec.rb
    incubator/deltacloud/trunk/client/specs/spec_helper.rb
    incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb

Modified: incubator/deltacloud/trunk/client/specs/instances_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/instances_spec.rb?rev=962355&r1=962354&r2=962355&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/instances_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/instances_spec.rb Thu Jul  8 23:48:55 2010
@@ -32,9 +32,9 @@ describe "instances" do
         instance.owner_id.should_not be_nil
         instance.owner_id.should be_a( String )
         instance.image.should_not be_nil
-        instance.image.should be_a( DCloud::Image )
-        instance.instance_profile.should_not be_nil
-        instance.instance_profile.should be_a( DCloud::InstanceProfile )
+        instance.image.should be_a( DeltaCloud::Image )
+        instance.hardware_profile.should_not be_nil
+        instance.hardware_profile.should be_a( DeltaCloud::HardwareProfile )
         instance.state.should_not be_nil
         instance.state.should be_a( String )
         instance.public_addresses.should_not be_nil
@@ -70,11 +70,11 @@ describe "instances" do
       instance.public_addresses.first.should eql( "img1.inst0.public.com" )
       instance.image.should_not be_nil
       instance.image.uri.should eql( API_URL + "/images/img1" )
-      instance.instance_profile.should_not be_nil
-      instance.instance_profile.hardware_profile.should_not be_nil
-      instance.instance_profile.hardware_profile.uri.should eql( API_URL + "/hardware_profiles/m1-large" )
-      instance.instance_profile[:memory].should eql( "12288" )
-      instance.instance_profile[:storage].should be_nil
+      instance.hardware_profile.should_not be_nil
+      instance.hardware_profile.should_not be_nil
+      instance.hardware_profile.uri.should eql( API_URL + "/hardware_profiles/m1-large" )
+      instance.hardware_profile.memory.value.should eql(10240.0)
+      instance.hardware_profile.storage.value.should eql(850.0)
       instance.state.should eql( "RUNNING" )
       instance.actions.should_not be_nil
     end
@@ -88,7 +88,7 @@ describe "instances" do
       instance.id.should match( /inst[0-9]+/ )
       instance.name.should eql( 'TestInstance' )
       instance.image.id.should eql( 'img1' )
-      instance.instance_profile.id.should eql( 'm1-large' )
+      instance.hardware_profile.id.should eql( 'm1-large' )
       instance.realm.id.should eql( 'us' )
     end
   end
@@ -100,7 +100,7 @@ describe "instances" do
       instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
       instance.id.should match( /inst[0-9]+/ )
       instance.image.id.should eql( 'img1' )
-      instance.instance_profile.id.should eql( 'm1-large' )
+      instance.hardware_profile.id.should eql( 'm1-large' )
       instance.realm.id.should eql( 'eu' )
     end
   end
@@ -113,7 +113,7 @@ describe "instances" do
       instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
       instance.id.should match( /inst[0-9]+/ )
       instance.image.id.should eql( 'img1' )
-      instance.instance_profile.id.should eql( 'm1-xlarge' )
+      instance.hardware_profile.id.should eql( 'm1-xlarge' )
       instance.realm.id.should eql( 'us' )
     end
   end
@@ -126,8 +126,8 @@ describe "instances" do
       instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
       instance.id.should match( /inst[0-9]+/ )
       instance.image.id.should eql( 'img1' )
-      instance.instance_profile.id.should eql( 'm1-xlarge' )
-      instance.instance_profile[:memory].should eql( "32768" )
+      instance.hardware_profile.id.should eql( 'm1-xlarge' )
+      instance.hardware_profile.memory.value.should eql(12288.0)
       instance.realm.id.should eql( 'us' )
     end
   end
@@ -140,7 +140,7 @@ describe "instances" do
       instance.uri.should match( %r{#{API_URL}/instances/inst[0-9]+} )
       instance.id.should match( /inst[0-9]+/ )
       instance.image.id.should eql( 'img1' )
-      instance.instance_profile.id.should eql( 'm1-xlarge' )
+      instance.hardware_profile.id.should eql( 'm1-xlarge' )
       instance.realm.id.should eql( 'eu' )
     end
   end

Modified: incubator/deltacloud/trunk/client/specs/realms_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/realms_spec.rb?rev=962355&r1=962354&r2=962355&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/realms_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/realms_spec.rb Thu Jul  8 23:48:55 2010
@@ -44,13 +44,11 @@ describe "realms" do
       realm.id.should eql( 'us' )
       realm.name.should eql( 'United States' )
       realm.state.should eql( 'AVAILABLE' )
-      realm.limit.should eql( :unlimited )
       realm = client.realm( 'eu' )
       realm.should_not be_nil
       realm.id.should eql( 'eu' )
       realm.name.should eql( 'Europe' )
       realm.state.should eql( 'AVAILABLE' )
-      realm.limit.should eql( :unlimited )
     end
   end
 

Modified: incubator/deltacloud/trunk/client/specs/spec_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/spec_helper.rb?rev=962355&r1=962354&r2=962355&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/spec_helper.rb (original)
+++ incubator/deltacloud/trunk/client/specs/spec_helper.rb Thu Jul  8 23:48:55 2010
@@ -32,11 +32,8 @@ API_PORT = api_port
 API_PATH = '/api'
 
 API_URL = "http://#{API_HOST}:#{API_PORT}#{API_PATH}"
-
-credentials = YAML.load( File.read( File.dirname( __FILE__ ) + '/../credentials.yml' ) )
-
-API_NAME     = credentials['name']
-API_PASSWORD = credentials['password']
+API_NAME     = 'mockuser'
+API_PASSWORD = 'mockpassword'
 
 $: << File.dirname( __FILE__ ) + '/../lib'
 require 'deltacloud'

Modified: incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb?rev=962355&r1=962354&r2=962355&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb (original)
+++ incubator/deltacloud/trunk/client/specs/storage_volume_spec.rb Thu Jul  8 23:48:55 2010
@@ -46,7 +46,7 @@ describe "storage volumes" do
       storage_volume.device.should eql( '/dev/sda1' )
       storage_volume.instance.should_not be_nil
       storage_volume.instance.id.should eql( 'inst1' )
-      ip = storage_volume.instance.instance_profile
+      ip = storage_volume.instance
       ip.hardware_profile.architecture.value.should eql( 'i386' )
     end
   end
@@ -63,7 +63,7 @@ describe "storage volumes" do
       storage_volume.device.should eql( '/dev/sda1' )
       storage_volume.instance.should_not be_nil
       storage_volume.instance.id.should eql( 'inst1' )
-      ip = storage_volume.instance.instance_profile
+      ip = storage_volume.instance
       ip.hardware_profile.architecture.value.should eql( 'i386' )
     end
   end