You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by rl...@redhat.com on 2012/12/12 23:41:28 UTC

CIMI - tests - adding provider detection

Includes the cleanup changes from http://tracker.deltacloud.org/set/202.

Re: [PATCH] CIMI - tests - adding provider detection

Posted by David Lutterkort <lu...@redhat.com>.
On Wed, 2012-12-12 at 17:41 -0500, rlandy@redhat.com wrote:
> From: Ronelle Landy <rl...@redhat.com>
> 
> ---
>  tests/cimi/part2_test.rb  |    2 +-
>  tests/cimi/part3_test.rb  |    2 +-
>  tests/cimi/test_helper.rb |    7 +++++++
>  tests/config.yaml         |   10 ++++------
>  4 files changed, 13 insertions(+), 8 deletions(-)

ACK & pushed. Thanks for cleaning up my mess.

BTW, something weird happened with the patches in tracker, as the first
two were empty for me. Had to manually apply yours on top of mine.

David



[PATCH] CIMI - tests - adding provider detection

Posted by rl...@redhat.com.
From: Ronelle Landy <rl...@redhat.com>

---
 tests/cimi/part2_test.rb  |    2 +-
 tests/cimi/part3_test.rb  |    2 +-
 tests/cimi/test_helper.rb |    7 +++++++
 tests/config.yaml         |   10 ++++------
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/tests/cimi/part2_test.rb b/tests/cimi/part2_test.rb
index 1be48f0..9bb0b94 100644
--- a/tests/cimi/part2_test.rb
+++ b/tests/cimi/part2_test.rb
@@ -76,6 +76,6 @@ end
     else
       machine = CIMI::Model::Machinemachine.new(:id => resp.headers[:location])
     end
-    @@created_resources[:machines] << machine
+    @@created_resources[:machines] << machine[:id]
   end
 end
diff --git a/tests/cimi/part3_test.rb b/tests/cimi/part3_test.rb
index 0cf80d7..50e7aae 100644
--- a/tests/cimi/part3_test.rb
+++ b/tests/cimi/part3_test.rb
@@ -95,7 +95,7 @@ class CreateNewMachineFromMachineTemplate < CIMI::Test::Spec
     else
       machine = CIMI::Model::Machinemachine.new(:id => resp.headers[:location])
     end
-    @@created_resources[:machines] << machine
+    @@created_resources[:machines] << machine[:id]
   end
 
 end
diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
index 45ff6a3..6cdb3fa 100644
--- a/tests/cimi/test_helper.rb
+++ b/tests/cimi/test_helper.rb
@@ -34,6 +34,9 @@ module CIMI
       def initialize
         @hash = Deltacloud::Test::yaml_config
         @cimi = @hash["cimi"]
+        if (not name.nil?) && @hash.include?(name)
+          @hash["cimi"].update(@hash[name])
+        end
       end
 
       def cep_url
@@ -44,6 +47,10 @@ module CIMI
         xml.xpath("/c:CloudEntryPoint/c:baseURI", ns).text
       end
 
+      def name
+        xml.xpath("/c:CloudEntryPoint/c:name", ns).text
+      end
+
       def basic_auth(u = nil, p = nil)
         u ||= @cimi["user"]
         p ||= @cimi["password"]
diff --git a/tests/config.yaml b/tests/config.yaml
index b567923..8c90dc6 100644
--- a/tests/config.yaml
+++ b/tests/config.yaml
@@ -4,6 +4,10 @@ api_url: "http://localhost:3001/api"
 mock:
   user: "mockuser"
   password: "mockpassword"
+  preferred:
+    machineImage: "img2"
+    machineConfig: "m1-small"
+    volumeConfig: "2"
 #OPENSTACK DRIVER CONFIG
 openstack:
   user:
@@ -44,9 +48,3 @@ fgcp:
 # CIMI testing
 cimi:
   cep: "http://localhost:3001/cimi/cloudEntryPoint"
-  user: "mockuser"
-  password: "mockpassword"
-  preferred:
-   machineImage: "img2"
-   machineConfig: "m1-small"
-   volumeConfig: "2"
-- 
1.7.7.6