a00bfa3642
This change introduces a new gnocchi::storage::incoming::driver class so that users can configure the file incoming driver of Gnocchi, which stores incoming data in local (or shared) filesystem. Change-Id: Ibf79b167a9d193974180949c95557d77ca495499
48 lines
1.1 KiB
Ruby
48 lines
1.1 KiB
Ruby
#
|
|
# Unit tests for gnocchi::storage::incoming::file
|
|
#
|
|
|
|
require 'spec_helper'
|
|
|
|
describe 'gnocchi::storage::incoming::file' do
|
|
|
|
let :params do
|
|
{}
|
|
end
|
|
|
|
shared_examples_for 'gnocchi storage file' do
|
|
|
|
context 'with file' do
|
|
it 'configures gnocchi incoming driver with file' do
|
|
is_expected.to contain_class('gnocchi::deps')
|
|
is_expected.to contain_gnocchi_config('incoming/driver').with_value('file')
|
|
is_expected.to_not contain_gnocchi_config('storage/file_basepath')
|
|
end
|
|
end
|
|
|
|
context 'with file_basepath' do
|
|
let :params do
|
|
{ :file_basepath => '/var/lib/gnocchi' }
|
|
end
|
|
|
|
it 'configures gnocchi incoming driver with file' do
|
|
is_expected.to contain_gnocchi_config('incoming/driver').with_value('file')
|
|
is_expected.to contain_gnocchi_config('storage/file_basepath').with_value('/var/lib/gnocchi')
|
|
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 'gnocchi storage file'
|
|
end
|
|
end
|
|
|
|
end
|