Debian Codegraph @

spec/classes/nova_compute_image_cache_spec.rb

raw
1 require 'spec_helper'
2
3 describe 'nova::compute::image_cache' do
4
5 shared_examples 'nova::compute::image_cache' do
6 context 'with no parameters' do
7
8 it 'configures image cache in nova.conf' do
9 should contain_nova_config('image_cache/manager_interval').with_value('<SERVICE DEFAULT>')
10 should contain_nova_config('image_cache/subdirectory_name').with_value('<SERVICE DEFAULT>')
11 should contain_nova_config('image_cache/remove_unused_base_images').with_value('<SERVICE DEFAULT>')
12 should contain_nova_config('image_cache/remove_unused_original_minimum_age_seconds').with_value('<SERVICE DEFAULT>')
13 should contain_nova_config('image_cache/remove_unused_resized_minimum_age_seconds').with_value('<SERVICE DEFAULT>')
14 should contain_nova_config('image_cache/precache_concurrency').with_value('<SERVICE DEFAULT>')
15 end
16 end
17
18 context 'when specified parameters' do
19 let :params do
20 {
21 :manager_interval => 2400,
22 :subdirectory_name => '_base',
23 :remove_unused_base_images => true,
24 :remove_unused_original_minimum_age_seconds => 86400,
25 :remove_unused_resized_minimum_age_seconds => 3600,
26 :precache_concurrency => 1,
27 }
28 end
29
30 it 'configures image cache in nova.conf' do
31 should contain_nova_config('image_cache/manager_interval').with_value(2400)
32 should contain_nova_config('image_cache/subdirectory_name').with_value('_base')
33 should contain_nova_config('image_cache/remove_unused_base_images').with_value(true)
34 should contain_nova_config('image_cache/remove_unused_original_minimum_age_seconds').with_value(86400)
35 should contain_nova_config('image_cache/remove_unused_resized_minimum_age_seconds').with_value(3600)
36 should contain_nova_config('image_cache/precache_concurrency').with_value(1)
37 end
38 end
39 end
40
41 on_supported_os({
42 :supported_os => OSDefaults.get_supported_os
43 }).each do |os,facts|
44 context "on #{os}" do
45 let (:facts) do
46 facts.merge(OSDefaults.get_facts())
47 end
48
49 it_behaves_like 'nova::compute::image_cache'
50 end
51 end
52 end