File: manila_data_backup_nfs_spec.rb

package info (click to toggle)
puppet-module-manila 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,852 kB
  • sloc: ruby: 5,060; python: 33; makefile: 10; sh: 10
file content (56 lines) | stat: -rw-r--r-- 1,999 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'spec_helper'

describe 'manila::data::backup::nfs' do

  shared_examples_for 'manila::data::backup::nfs' do

    let :params do
      {
        :backup_mount_export => '192.0.2.1:/backup',
      }
    end

    context 'with default parameters' do

      it 'should configure manila-data options' do
        is_expected.to contain_manila_config('DEFAULT/backup_mount_template').with_value('<SERVICE DEFAULT>')
        is_expected.to contain_manila_config('DEFAULT/backup_unmount_template').with_value('<SERVICE DEFAULT>')
        is_expected.to contain_manila_config('DEFAULT/backup_mount_export').with_value('192.0.2.1:/backup')
        is_expected.to contain_manila_config('DEFAULT/backup_mount_proto').with_value('<SERVICE DEFAULT>')
        is_expected.to contain_manila_config('DEFAULT/backup_mount_options').with_value('<SERVICE DEFAULT>')
      end

    end

    context 'with parameters' do
      before :each do
        params.merge!({
          :backup_mount_template   => 'mount -vt %(proto)s %(options)s %(export)s %(path)s',
          :backup_unmount_template => 'umount -v %(path)s',
          :backup_mount_proto      => 'nfs',
          :backup_mount_options    => '',
        })
      end

      it 'should configure manila-data options' do
        is_expected.to contain_manila_config('DEFAULT/backup_mount_template').with_value('mount -vt %(proto)s %(options)s %(export)s %(path)s')
        is_expected.to contain_manila_config('DEFAULT/backup_unmount_template').with_value('umount -v %(path)s')
        is_expected.to contain_manila_config('DEFAULT/backup_mount_proto').with_value('nfs')
        is_expected.to contain_manila_config('DEFAULT/backup_mount_options').with_value('')
      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 'manila::data::backup::nfs'
    end
  end

end