deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [1/3] git commit: Server tests - fixes openstack driver instances test - broken build
Date Tue, 11 Dec 2012 12:50:48 GMT
Updated Branches:
  refs/heads/master ad3195d8a -> a6626df52


Server tests - fixes openstack driver instances test - broken build

https://travis-ci.org/mifo/deltacloud/jobs/3591100


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a6626df5
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a6626df5
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a6626df5

Branch: refs/heads/master
Commit: a6626df527f0e43c924b22a8cdf8456c3523bf97
Parents: ae631c6
Author: marios <marios@redhat.com>
Authored: Tue Dec 11 14:49:10 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Tue Dec 11 14:49:10 2012 +0200

----------------------------------------------------------------------
 server/tests/drivers/openstack/common.rb         |    2 +-
 server/tests/drivers/openstack/instances_test.rb |   35 +++++++++--------
 2 files changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a6626df5/server/tests/drivers/openstack/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/common.rb b/server/tests/drivers/openstack/common.rb
index a452cc2..ad587e8 100644
--- a/server/tests/drivers/openstack/common.rb
+++ b/server/tests/drivers/openstack/common.rb
@@ -22,5 +22,5 @@ VCR.configure do |c|
   c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures')
   c.hook_into :webmock
   # Set this to :new_episodes when you want to 're-record'
-  c.default_cassette_options = { :record => :new_episodes }
+  c.default_cassette_options = { :record => :none }
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a6626df5/server/tests/drivers/openstack/instances_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/instances_test.rb b/server/tests/drivers/openstack/instances_test.rb
index e391a2a..66ff0ea 100644
--- a/server/tests/drivers/openstack/instances_test.rb
+++ b/server/tests/drivers/openstack/instances_test.rb
@@ -1,10 +1,17 @@
 require 'minitest/autorun'
-
 require_relative File.join('..', '..', '..', 'lib', 'deltacloud', 'api.rb')
 require_relative 'common.rb'
 
 describe 'OpenStackDriver Instances' do
 
+  def credentials
+  {
+    :user => "foo@fakedomain.eu+foo@fakedomain.eu-default-tenant",
+    :password => "1234fake56789",
+    :provider => "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/"
+  }
+  end
+
   before do
     @driver = Deltacloud::new(:openstack, credentials)
     VCR.insert_cassette __name__
@@ -14,9 +21,9 @@ describe 'OpenStackDriver Instances' do
     VCR.eject_cassette
   end
 
-  it 'must throw error when wrong credentials' do
+  it 'must throw error when GET instances with wrong credentials' do
     Proc.new do
-      @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
+      @driver.backend.instances(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
     end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
@@ -25,28 +32,23 @@ describe 'OpenStackDriver Instances' do
     @driver.instances.first.must_be_kind_of Instance
   end
 
-# FIXME: The tests above will fail because of incompatibility
-#        in a way how OpenStack handle uuid/id.
-#        Please uncomment these tests if that will be fixed.
-
-=begin
   it 'must allow to filter instances' do
-    instances = @driver.instances :id => 'fef00348-9991-404c-b0d4-655d18f84345'
+    instances = @driver.instances :id => '806837'
     instances.wont_be_empty
     instances.must_be_kind_of Array
     instances.size.must_equal 1
     puts instances.inspect
-    instances.first.id.must_equal 'fef00348-9991-404c-b0d4-655d18f84345'
+    instances.first.id.must_equal '806837'
     @driver.instances(:id => 'unknown').must_be_empty
   end
 
   it 'must allow to retrieve single instance' do
-    instance = @driver.instance :id => 'fef00348-9991-404c-b0d4-655d18f84345'
+    instance = @driver.instance :id => '806837'
     instance.wont_be_nil
-    instance.id.must_equal 'fef00348-9991-404c-b0d4-655d18f84345'
-    instance.name.must_equal 'test-3'
+    instance.id.must_equal '806837'
+    instance.name.must_equal 'Server-1355225740-az-2-region-a-geo-1'
     instance.state.wont_be_empty
-    instance.owner_id.must_equal 'admin'
+    instance.owner_id.must_equal 'foo@fakedomain.eu'
     instance.realm_id.wont_be_empty
     instance.image_id.wont_be_empty
     instance.instance_profile.wont_be_nil
@@ -54,13 +56,12 @@ describe 'OpenStackDriver Instances' do
   end
 
   it 'must allow to create and destroy an instance' do
-    instance = @driver.create_instance 'bf7ce59a-d9f9-45d4-9313-f45b16436602', :hwp_id =>
'1'
+    instance = @driver.create_instance '47940', :hwp_id => '100'
     instance.wont_be_nil
-    instance.image_id.must_equal 'bf7ce59a-d9f9-45d4-9313-f45b16436602'
+    instance.image_id.must_equal '47940'
     instance.name.wont_be_empty
     instance.wait_for!(@driver, record_retries('inst_launch')) { |i| i.is_running? }
     puts @driver.destroy_instance(instance.id).inspect
   end
-=end
 
 end


Mime
View raw message