Debian Codegraph @

spec/classes/nova_db_sync_api_spec.rb

raw
1 require 'spec_helper'
2
3 describe 'nova::db::sync_api' do
4
5 shared_examples_for 'nova-dbsync-api' do
6 context 'with defaults' do
7 it {
8 is_expected.to contain_exec('nova-db-sync-api').with(
9 :command => '/usr/bin/nova-manage api_db sync',
10 :user => 'nova',
11 :refreshonly => 'true',
12 :timeout => 300,
13 :logoutput => 'on_failure',
14 :subscribe => ['Anchor[nova::install::end]',
15 'Anchor[nova::config::end]',
16 'Anchor[nova::dbsync_api::begin]'],
17 :notify => 'Anchor[nova::dbsync_api::end]',
18 :tag => 'openstack-db',
19 )
20 }
21 it { is_expected.to_not contain_class('nova::cell_v2::simple_setup') }
22 end
23
24 context "overriding extra_params" do
25 let :params do
26 {
27 :extra_params => '--config-file /etc/nova/nova.conf',
28 :cellv2_setup => false
29 }
30 end
31
32 it {
33 is_expected.to contain_exec('nova-db-sync-api').with(
34 :command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf api_db sync',
35 :user => 'nova',
36 :refreshonly => 'true',
37 :timeout => 300,
38 :logoutput => 'on_failure',
39 :subscribe => ['Anchor[nova::install::end]',
40 'Anchor[nova::config::end]',
41 'Anchor[nova::dbsync_api::begin]'],
42 :notify => 'Anchor[nova::dbsync_api::end]',
43 :tag => 'openstack-db',
44 )
45 }
46 it { is_expected.to_not contain_class('nova::cell_v2::simple_setup') }
47 end
48
49 context "overriding db_sync_timeout" do
50 let :params do
51 {
52 :db_sync_timeout => 750
53 }
54 end
55
56 it {
57 is_expected.to contain_exec('nova-db-sync-api').with(
58 :command => '/usr/bin/nova-manage api_db sync',
59 :user => 'nova',
60 :refreshonly => 'true',
61 :timeout => 750,
62 :logoutput => 'on_failure',
63 :subscribe => ['Anchor[nova::install::end]',
64 'Anchor[nova::config::end]',
65 'Anchor[nova::dbsync_api::begin]'],
66 :notify => 'Anchor[nova::dbsync_api::end]',
67 :tag => 'openstack-db',
68 )
69 }
70 end
71 end
72
73
74 on_supported_os({
75 :supported_os => OSDefaults.get_supported_os
76 }).each do |os,facts|
77 context "on #{os}" do
78 let (:facts) do
79 facts.merge(OSDefaults.get_facts())
80 end
81
82 it_configures 'nova-dbsync-api'
83 end
84 end
85
86 end