File: openstacklib_clouds_spec.rb

package info (click to toggle)
puppet-module-openstacklib 25.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: ruby: 4,500; python: 38; sh: 22; makefile: 10
file content (41 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'spec_helper'

describe 'openstacklib::clouds' do
  shared_examples 'openstacklib::clouds' do
    let :title do
      '/etc/openstack/clouds.yaml'
    end

    context 'with the required parameters' do
      let :params do
        {
          :username     => 'admin',
          :password     => 'secrete',
          :auth_url     => 'http://127.0.0.1:5000/',
          :project_name => 'demo',
        }
      end

      it 'creates a clouds.yaml file' do
        should contain_file('/etc/openstack/clouds.yaml').with(
          :mode  => '0600',
          :owner => 'root',
          :group => 'root',
        )
      end
    end
  end

  on_supported_os({
    :supported_os => OSDefaults.get_supported_os
  }).each do |os,facts|
    context "on #{os}" do
      let (:facts) do
        facts.merge!(OSDefaults.get_facts())
      end

      it_behaves_like 'openstacklib::clouds'
    end
  end

end