Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 48012F60A for ; Fri, 12 Apr 2013 14:52:18 +0000 (UTC) Received: (qmail 34830 invoked by uid 500); 12 Apr 2013 14:52:17 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 34762 invoked by uid 500); 12 Apr 2013 14:52:17 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 34653 invoked by uid 99); 12 Apr 2013 14:52:17 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 14:52:17 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 181F8819948; Fri, 12 Apr 2013 14:52:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: marios@apache.org To: commits@deltacloud.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: Deltacloud Tests - adding load balancer for testing Date: Fri, 12 Apr 2013 14:52:17 +0000 (UTC) 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 Authored: Fri Apr 12 09:41:51 2013 -0400 Committer: marios 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")