Debian Codegraph @

spec/classes/cloudkitty_db_sync_spec.rb

raw
1 require 'spec_helper'
2
3 describe 'cloudkitty::db::sync' do
4
5 shared_examples_for 'cloudkitty-dbsync' do
6
7 it { is_expected.to contain_class('cloudkitty::deps') }
8
9 it 'runs cloudkitty-db-sync' do
10 is_expected.to contain_exec('cloudkitty-db-sync').with(
11 :command => 'cloudkitty-dbsync upgrade ',
12 :path => [ '/bin', '/usr/bin', ],
13 :refreshonly => 'true',
14 :user => 'cloudkitty',
15 :try_sleep => 5,
16 :tries => 10,
17 :timeout => 300,
18 :logoutput => 'on_failure',
19 :subscribe => ['Anchor[cloudkitty::install::end]',
20 'Anchor[cloudkitty::config::end]',
21 'Anchor[cloudkitty::dbsync::begin]'],
22 :notify => 'Anchor[cloudkitty::dbsync::end]',
23 :tag => 'openstack-db',
24 )
25 end
26
27 describe "overriding db_sync_timeout" do
28 let :params do
29 {
30 :db_sync_timeout => 750,
31 }
32 end
33
34 it {
35 is_expected.to contain_exec('cloudkitty-db-sync').with(
36 :command => 'cloudkitty-dbsync upgrade ',
37 :path => [ '/bin', '/usr/bin', ],
38 :refreshonly => 'true',
39 :user => 'cloudkitty',
40 :try_sleep => 5,
41 :tries => 10,
42 :timeout => 750,
43 :logoutput => 'on_failure',
44 :subscribe => ['Anchor[cloudkitty::install::end]',
45 'Anchor[cloudkitty::config::end]',
46 'Anchor[cloudkitty::dbsync::begin]'],
47 :notify => 'Anchor[cloudkitty::dbsync::end]',
48 :tag => 'openstack-db',
49 )
50 }
51 end
52
53 end
54
55 on_supported_os({
56 :supported_os => OSDefaults.get_supported_os
57 }).each do |os,facts|
58 context "on #{os}" do
59 let (:facts) do
60 facts.merge(OSDefaults.get_facts())
61 end
62
63 it_configures 'cloudkitty-dbsync'
64 end
65 end
66
67 end