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 7133CF36E for ; Tue, 9 Apr 2013 10:27:32 +0000 (UTC) Received: (qmail 80105 invoked by uid 500); 9 Apr 2013 10:27:32 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 80076 invoked by uid 500); 9 Apr 2013 10:27:31 -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 80042 invoked by uid 99); 9 Apr 2013 10:27:30 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 10:27:30 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 87E17817285; Tue, 9 Apr 2013 10:27:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mfojtik@apache.org To: commits@deltacloud.apache.org Date: Tue, 09 Apr 2013 10:27:30 -0000 Message-Id: <9c43b50fab964e7195049701309b8291@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: CIMI - Tests - modfiying test_helper.rb cleanup code to work with Openstack provider Updated Branches: refs/remotes/apache/master 3d6e08c08 -> ca47929c0 CIMI - Tests - modfiying test_helper.rb cleanup code to work with Openstack provider TrackedAt: http://tracker.deltacloud.org/patch/1e5a6656b4f4eeaf278bf60efd812b9bf9682611 Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8dfb3405 Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8dfb3405 Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8dfb3405 Branch: refs/remotes/apache/master Commit: 8dfb3405e093bccc142c08ed058b8b3ec30edbc3 Parents: 3d6e08c Author: Ronelle Landy Authored: Thu Apr 4 13:15:39 2013 -0400 Committer: marios Committed: Tue Apr 9 12:42:00 2013 +0300 ---------------------------------------------------------------------- tests/cimi/test_helper.rb | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8dfb3405/tests/cimi/test_helper.rb ---------------------------------------------------------------------- diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb index 5cfceb6..19f0b2c 100644 --- a/tests/cimi/test_helper.rb +++ b/tests/cimi/test_helper.rb @@ -346,17 +346,24 @@ module CIMI::Test::Methods machine = get(machine.json["id"], :accept => :json) end - while not machine.json["state"].upcase.eql?("STOPPED") + cep_json = cep(:accept => :json) + while (get(cep_json.json["machines"]["href"], {:accept=>:json}).include?(machine.json["id"]) && (not machine.json["state"].upcase.eql?("STOPPED")) puts 'waiting for machine to be STOPPED' - sleep(1) - machine = get(machine.json["id"], :accept => :json) + sleep(3) + unless (not get(cep_json.json["machines"]["href"], {:accept=>:json}).include?(machine.json["id"])) + machine = get(machine.json["id"], :accept => :json) + end end - delete_op = machine.json["operations"].find { |op| op["rel"] =~ /delete$/ } - if delete_op - delete_res = RestClient.delete( delete_op["href"], - {'Authorization' => api_basic_auth, :accept => :json} ) - @@created_resources[:machines][i] = nil if (200..207).include? delete_res.code + if get(cep_json.json["machines"]["href"], {:accept=>:json}).include?(machine.json["id"]) + delete_op = machine.json["operations"].find { |op| op["rel"] =~ /delete$/ } + if delete_op + delete_res = RestClient.delete( delete_op["href"], + {'Authorization' => api_basic_auth, :accept => :json} ) + @@created_resources[:machines][i] = nil if (200..207).include? delete_res.code + end + else + @@created_resources[:machines][i] = nil end end