deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Deltacloud Tests - adding load balancer for testing
Date Fri, 12 Apr 2013 14:52:17 GMT
Updated Branches:
  refs/heads/master 9061a503e -> f72b496d8


Deltacloud Tests - adding load balancer for testing


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

Branch: refs/heads/master
Commit: f72b496d8292dfe567b67b3ba1090f63dbae4c5a
Parents: 9061a50
Author: Ronelle Landy <rlandy@redhat.com>
Authored: Fri Apr 12 09:41:51 2013 -0400
Committer: marios <marios@redhat.com>
Committed: Fri Apr 12 17:45:07 2013 +0300

----------------------------------------------------------------------
 tests/deltacloud/load_balancers_test.rb |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/f72b496d/tests/deltacloud/load_balancers_test.rb
----------------------------------------------------------------------
diff --git a/tests/deltacloud/load_balancers_test.rb b/tests/deltacloud/load_balancers_test.rb
index f975be8..b995caf 100644
--- a/tests/deltacloud/load_balancers_test.rb
+++ b/tests/deltacloud/load_balancers_test.rb
@@ -22,6 +22,31 @@ describe 'Deltacloud API load_balancers collection' do
 
   need_collection :load_balancers
 
+  LOAD_BALANCERS = "/load_balancers"
+
+  if collection_supported :load_balancers
+    #Create a load_balancer
+    res = post(LOAD_BALANCERS, :name => "loadBalancerForTest",
+       :listener_protocol => "HTTP",
+       :listener_balancer_port => "80",
+       :listener_instance_port => "3010",
+       :realm_id => get_a("realm"))
+
+    unless res.code == 201
+      raise Exception.new("Failed to create load balancer")
+    end
+  end
+
+  #Delete the load_balancer we created for the tests
+  MiniTest::Unit.after_tests {
+  if collection_supported :load_balancers
+    res = delete(LOAD_BALANCERS + "/loadBalancerForTest")
+    unless res.code == 204
+     raise Exception.new("Failed to delete load balancer")
+    end
+  end
+  }
+
   #Run the 'common' tests for all collections defined in common_tests_collections.rb
   CommonCollectionsTest::run_collection_and_member_tests_for("load_balancers")
 


Mime
View raw message