On Tue, 2012-12-11 at 18:09 -0500, [email protected] wrote:
> From: Ronelle Landy <[email protected]>
> 
> ---
>  tests/cimi/test_helper.rb |   23 +++++++++++++----------
>  tests/config.yaml         |   18 +++++++-----------
>  2 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/tests/cimi/test_helper.rb b/tests/cimi/test_helper.rb
> index 025a705..ad74cd2 100644
> --- a/tests/cimi/test_helper.rb
> +++ b/tests/cimi/test_helper.rb
> @@ -32,12 +32,19 @@ module CIMI
>        include Singleton
>  
>        def initialize
> -        @hash = Deltacloud::Test::yaml_config
> -        @cimi = @hash["cimi"]
> +       @hash = Deltacloud::Test::yaml_config
> +      end
> +
> +      def driver
> +        xml.xpath("/c:CloudEntryPoint/c:name", ns).text
> +      end

The problem with this is that talking about a driver only makes sense in
the context of Deltacloud, but nor for CIMI providers in general. For
the CIMI tests, we should not have any mention of drivers anywhere.

Instead of introducing that notion, how about supporting a 'copy_from'
setting in the CIMI block, so that you can reuse settings for a
Deltacloud driver without needing to talk about drivers explicitly:

        mock:
          user: ...
          ...
        cimi:
          cep: http://...
          copy_from: mock

In terms of code, when we load the config, just do something like

        if from = @hash["cimi"]["copy_from"]
          @hash["cimi"].update(@hash[from])
        end

David


Reply via email to