summaryrefslogtreecommitdiffstats
path: root/components/congress/puppet/spec
diff options
context:
space:
mode:
Diffstat (limited to 'components/congress/puppet/spec')
-rw-r--r--components/congress/puppet/spec/classes/congress_db_mysql_spec.rb62
-rw-r--r--components/congress/puppet/spec/classes/congress_db_postgresql_spec.rb58
-rw-r--r--components/congress/puppet/spec/classes/congress_db_spec.rb78
-rw-r--r--components/congress/puppet/spec/classes/congress_keystone_auth_spec.rb123
-rw-r--r--components/congress/puppet/spec/classes/congress_logging_spec.rb144
-rw-r--r--components/congress/puppet/spec/classes/congress_policy_spec.rb41
-rw-r--r--components/congress/puppet/spec/shared_examples.rb5
-rw-r--r--components/congress/puppet/spec/unit/provider/congress_config/ini_setting_spec.rb68
-rw-r--r--components/congress/puppet/spec/unit/type/congress_config_spec.rb64
9 files changed, 643 insertions, 0 deletions
diff --git a/components/congress/puppet/spec/classes/congress_db_mysql_spec.rb b/components/congress/puppet/spec/classes/congress_db_mysql_spec.rb
new file mode 100644
index 0000000..6370bac
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_db_mysql_spec.rb
@@ -0,0 +1,62 @@
+require 'spec_helper'
+
+describe 'congress::db::mysql' do
+
+ let :pre_condition do
+ [
+ 'include mysql::server',
+ 'include congress::db::sync'
+ ]
+ end
+
+ let :facts do
+ { :osfamily => 'Debian' }
+ end
+
+ let :params do
+ {
+ 'password' => 'fooboozoo_default_password',
+ }
+ end
+
+ describe 'with only required params' do
+ it { is_expected.to contain_openstacklib__db__mysql('congress').with(
+ 'user' => 'congress',
+ 'password_hash' => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
+ 'dbname' => 'congress',
+ 'host' => '127.0.0.1',
+ 'charset' => 'utf8',
+ :collate => 'utf8_general_ci',
+ )}
+ end
+
+ describe "overriding allowed_hosts param to array" do
+ let :params do
+ {
+ :password => 'congresspass',
+ :allowed_hosts => ['127.0.0.1','%']
+ }
+ end
+
+ end
+ describe "overriding allowed_hosts param to string" do
+ let :params do
+ {
+ :password => 'congresspass2',
+ :allowed_hosts => '192.168.1.1'
+ }
+ end
+
+ end
+
+ describe "overriding allowed_hosts param equals to host param " do
+ let :params do
+ {
+ :password => 'congresspass2',
+ :allowed_hosts => '127.0.0.1'
+ }
+ end
+
+ end
+
+end
diff --git a/components/congress/puppet/spec/classes/congress_db_postgresql_spec.rb b/components/congress/puppet/spec/classes/congress_db_postgresql_spec.rb
new file mode 100644
index 0000000..74abbdb
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_db_postgresql_spec.rb
@@ -0,0 +1,58 @@
+require 'spec_helper'
+
+describe 'congress::db::postgresql' do
+
+ let :req_params do
+ { :password => 'pw' }
+ end
+
+ let :pre_condition do
+ 'include postgresql::server'
+ end
+
+ context 'on a RedHat osfamily' do
+ let :facts do
+ {
+ :osfamily => 'RedHat',
+ :operatingsystemrelease => '7.0',
+ :concat_basedir => '/var/lib/puppet/concat'
+ }
+ end
+
+ context 'with only required parameters' do
+ let :params do
+ req_params
+ end
+
+ it { is_expected.to contain_postgresql__server__db('congress').with(
+ :user => 'congress',
+ :password => 'md5c530c33636c58ae83ca933f39319273e'
+ )}
+ end
+
+ end
+
+ context 'on a Debian osfamily' do
+ let :facts do
+ {
+ :operatingsystemrelease => '7.8',
+ :operatingsystem => 'Debian',
+ :osfamily => 'Debian',
+ :concat_basedir => '/var/lib/puppet/concat'
+ }
+ end
+
+ context 'with only required parameters' do
+ let :params do
+ req_params
+ end
+
+ it { is_expected.to contain_postgresql__server__db('congress').with(
+ :user => 'congress',
+ :password => 'md5c530c33636c58ae83ca933f39319273e'
+ )}
+ end
+
+ end
+
+end
diff --git a/components/congress/puppet/spec/classes/congress_db_spec.rb b/components/congress/puppet/spec/classes/congress_db_spec.rb
new file mode 100644
index 0000000..3b84993
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_db_spec.rb
@@ -0,0 +1,78 @@
+require 'spec_helper'
+
+describe 'congress::db' do
+
+ shared_examples 'congress::db' do
+ context 'with default parameters' do
+ it { is_expected.to contain_congress_config('database/connection').with_value('mysql://congress:secrete@localhost:3306/congress') }
+ it { is_expected.to contain_congress_config('database/idle_timeout').with_value('3600') }
+ it { is_expected.to contain_congress_config('database/min_pool_size').with_value('1') }
+ it { is_expected.to contain_congress_config('database/max_retries').with_value('10') }
+ it { is_expected.to contain_congress_config('database/retry_interval').with_value('10') }
+ it { is_expected.to contain_congress_config('database/max_pool_size').with_value('10') }
+ it { is_expected.to contain_congress_config('database/max_overflow').with_value('20') }
+ end
+
+ context 'with specific parameters' do
+ let :params do
+ { :database_connection => 'mysql://congress:congress@localhost/congress',
+ :database_idle_timeout => '3601',
+ :database_min_pool_size => '2',
+ :database_max_retries => '11',
+ :database_retry_interval => '11',
+ :database_max_pool_size => '11',
+ :database_max_overflow => '21',
+ }
+ end
+
+ it { is_expected.to contain_congress_config('database/connection').with_value('mysql://congress:congress@localhost/congress') }
+ it { is_expected.to contain_congress_config('database/idle_timeout').with_value('3601') }
+ it { is_expected.to contain_congress_config('database/min_pool_size').with_value('2') }
+ it { is_expected.to contain_congress_config('database/max_retries').with_value('11') }
+ it { is_expected.to contain_congress_config('database/retry_interval').with_value('11') }
+ it { is_expected.to contain_congress_config('database/max_pool_size').with_value('11') }
+ it { is_expected.to contain_congress_config('database/max_overflow').with_value('21') }
+ end
+
+ context 'with postgresql backend' do
+ let :params do
+ { :database_connection => 'postgresql://congress:congress@localhost/congress', }
+ end
+
+ it 'install the proper backend package' do
+ is_expected.to contain_package('python-psycopg2').with(:ensure => 'present')
+ end
+
+ end
+
+ context 'with incorrect database_connection string' do
+ let :params do
+ { :database_connection => 'sqlite://congress:congress@localhost/congress', }
+ end
+
+ it_raises 'a Puppet::Error', /validate_re/
+ end
+ end
+
+ context 'on Debian platforms' do
+ let :facts do
+ { :osfamily => 'Debian',
+ :operatingsystem => 'Debian',
+ :operatingsystemrelease => 'jessie',
+ }
+ end
+
+ it_configures 'congress::db'
+ end
+
+ context 'on Redhat platforms' do
+ let :facts do
+ { :osfamily => 'RedHat',
+ :operatingsystemrelease => '7.1',
+ }
+ end
+
+ it_configures 'congress::db'
+ end
+
+end
diff --git a/components/congress/puppet/spec/classes/congress_keystone_auth_spec.rb b/components/congress/puppet/spec/classes/congress_keystone_auth_spec.rb
new file mode 100644
index 0000000..3cb7e59
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_keystone_auth_spec.rb
@@ -0,0 +1,123 @@
+#
+# Unit tests for congress::keystone::auth
+#
+
+require 'spec_helper'
+
+describe 'congress::keystone::auth' do
+
+ let :facts do
+ { :osfamily => 'Debian' }
+ end
+
+ describe 'with default class parameters' do
+ let :params do
+ { :password => 'congress_password',
+ :tenant => 'foobar' }
+ end
+
+ it { is_expected.to contain_keystone_user('congress').with(
+ :ensure => 'present',
+ :password => 'congress_password',
+ ) }
+
+ it { is_expected.to contain_keystone_user_role('congress@foobar').with(
+ :ensure => 'present',
+ :roles => ['admin']
+ )}
+
+ it { is_expected.to contain_keystone_service('congress').with(
+ :ensure => 'present',
+ :type => 'FIXME',
+ :description => 'congress FIXME Service'
+ ) }
+
+ it { is_expected.to contain_keystone_endpoint('RegionOne/congress').with(
+ :ensure => 'present',
+ :public_url => 'http://127.0.0.1:FIXME',
+ :admin_url => 'http://127.0.0.1:FIXME',
+ :internal_url => 'http://127.0.0.1:FIXME',
+ ) }
+ end
+
+ describe 'when overriding URL paramaters' do
+ let :params do
+ { :password => 'congress_password',
+ :public_url => 'https://10.10.10.10:80',
+ :internal_url => 'http://10.10.10.11:81',
+ :admin_url => 'http://10.10.10.12:81', }
+ end
+
+ it { is_expected.to contain_keystone_endpoint('RegionOne/congress').with(
+ :ensure => 'present',
+ :public_url => 'https://10.10.10.10:80',
+ :internal_url => 'http://10.10.10.11:81',
+ :admin_url => 'http://10.10.10.12:81',
+ ) }
+ end
+
+ describe 'when overriding auth name' do
+ let :params do
+ { :password => 'foo',
+ :auth_name => 'congressy' }
+ end
+
+ it { is_expected.to contain_keystone_user('congressy') }
+ it { is_expected.to contain_keystone_user_role('congressy@services') }
+ it { is_expected.to contain_keystone_service('congressy') }
+ it { is_expected.to contain_keystone_endpoint('RegionOne/congressy') }
+ end
+
+ describe 'when overriding service name' do
+ let :params do
+ { :service_name => 'congress_service',
+ :auth_name => 'congress',
+ :password => 'congress_password' }
+ end
+
+ it { is_expected.to contain_keystone_user('congress') }
+ it { is_expected.to contain_keystone_user_role('congress@services') }
+ it { is_expected.to contain_keystone_service('congress_service') }
+ it { is_expected.to contain_keystone_endpoint('RegionOne/congress_service') }
+ end
+
+ describe 'when disabling user configuration' do
+
+ let :params do
+ {
+ :password => 'congress_password',
+ :configure_user => false
+ }
+ end
+
+ it { is_expected.not_to contain_keystone_user('congress') }
+ it { is_expected.to contain_keystone_user_role('congress@services') }
+ it { is_expected.to contain_keystone_service('congress').with(
+ :ensure => 'present',
+ :type => 'FIXME',
+ :description => 'congress FIXME Service'
+ ) }
+
+ end
+
+ describe 'when disabling user and user role configuration' do
+
+ let :params do
+ {
+ :password => 'congress_password',
+ :configure_user => false,
+ :configure_user_role => false
+ }
+ end
+
+ it { is_expected.not_to contain_keystone_user('congress') }
+ it { is_expected.not_to contain_keystone_user_role('congress@services') }
+ it { is_expected.to contain_keystone_service('congress').with(
+ :ensure => 'present',
+ :type => 'FIXME',
+ :description => 'congress FIXME Service'
+ ) }
+
+ end
+
+end
diff --git a/components/congress/puppet/spec/classes/congress_logging_spec.rb b/components/congress/puppet/spec/classes/congress_logging_spec.rb
new file mode 100644
index 0000000..0bfb994
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_logging_spec.rb
@@ -0,0 +1,144 @@
+require 'spec_helper'
+
+describe 'congress::logging' do
+
+ let :params do
+ {
+ }
+ end
+
+ let :log_params do
+ {
+ :logging_context_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s',
+ :logging_default_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s',
+ :logging_debug_format_suffix => '%(funcName)s %(pathname)s:%(lineno)d',
+ :logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
+ :log_config_append => '/etc/congress/logging.conf',
+ :publish_errors => true,
+ :default_log_levels => {
+ 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
+ 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
+ 'iso8601' => 'WARN',
+ 'requests.packages.urllib3.connectionpool' => 'WARN' },
+ :fatal_deprecations => true,
+ :instance_format => '[instance: %(uuid)s] ',
+ :instance_uuid_format => '[instance: %(uuid)s] ',
+ :log_date_format => '%Y-%m-%d %H:%M:%S',
+ :use_syslog => true,
+ :use_stderr => false,
+ :log_facility => 'LOG_FOO',
+ :log_dir => '/var/log',
+ :verbose => true,
+ :debug => true,
+ }
+ end
+
+ shared_examples_for 'congress-logging' do
+
+ context 'with basic logging options and default settings' do
+ it_configures 'basic default logging settings'
+ end
+
+ context 'with basic logging options and non-default settings' do
+ before { params.merge!( log_params ) }
+ it_configures 'basic non-default logging settings'
+ end
+
+ context 'with extended logging options' do
+ before { params.merge!( log_params ) }
+ it_configures 'logging params set'
+ end
+
+ context 'without extended logging options' do
+ it_configures 'logging params unset'
+ end
+
+ end
+
+ shared_examples 'basic default logging settings' do
+ it 'configures ceilometer logging settins with default values' do
+ is_expected.to contain_ceilometer_config('DEFAULT/use_syslog').with(:value => 'false')
+ is_expected.to contain_ceilometer_config('DEFAULT/use_stderr').with(:value => 'true')
+ is_expected.to contain_ceilometer_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER')
+ is_expected.to contain_ceilometer_config('DEFAULT/log_dir').with(:value => '/var/log/congress')
+ is_expected.to contain_ceilometer_config('DEFAULT/verbose').with(:value => 'false')
+ is_expected.to contain_ceilometer_config('DEFAULT/debug').with(:value => 'false')
+ end
+ end
+
+ shared_examples 'basic non-default logging settings' do
+ it 'configures ceilometer logging settins with non-default values' do
+ is_expected.to contain_ceilometer_config('DEFAULT/use_syslog').with(:value => 'true')
+ is_expected.to contain_ceilometer_config('DEFAULT/use_stderr').with(:value => 'false')
+ is_expected.to contain_ceilometer_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
+ is_expected.to contain_ceilometer_config('DEFAULT/log_dir').with(:value => '/var/log')
+ is_expected.to contain_ceilometer_config('DEFAULT/verbose').with(:value => 'true')
+ is_expected.to contain_ceilometer_config('DEFAULT/debug').with(:value => 'true')
+ end
+ end
+
+ shared_examples_for 'logging params set' do
+ it 'enables logging params' do
+ is_expected.to contain_congress_config('DEFAULT/logging_context_format_string').with_value(
+ '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s')
+
+ is_expected.to contain_congress_config('DEFAULT/logging_default_format_string').with_value(
+ '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s')
+
+ is_expected.to contain_congress_config('DEFAULT/logging_debug_format_suffix').with_value(
+ '%(funcName)s %(pathname)s:%(lineno)d')
+
+ is_expected.to contain_congress_config('DEFAULT/logging_exception_prefix').with_value(
+ '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s')
+
+ is_expected.to contain_congress_config('DEFAULT/log_config_append').with_value(
+ '/etc/congress/logging.conf')
+ is_expected.to contain_congress_config('DEFAULT/publish_errors').with_value(
+ true)
+
+ is_expected.to contain_congress_config('DEFAULT/default_log_levels').with_value(
+ 'amqp=WARN,amqplib=WARN,boto=WARN,iso8601=WARN,qpid=WARN,requests.packages.urllib3.connectionpool=WARN,sqlalchemy=WARN,suds=INFO')
+
+ is_expected.to contain_congress_config('DEFAULT/fatal_deprecations').with_value(
+ true)
+
+ is_expected.to contain_congress_config('DEFAULT/instance_format').with_value(
+ '[instance: %(uuid)s] ')
+
+ is_expected.to contain_congress_config('DEFAULT/instance_uuid_format').with_value(
+ '[instance: %(uuid)s] ')
+
+ is_expected.to contain_congress_config('DEFAULT/log_date_format').with_value(
+ '%Y-%m-%d %H:%M:%S')
+ end
+ end
+
+
+ shared_examples_for 'logging params unset' do
+ [ :logging_context_format_string, :logging_default_format_string,
+ :logging_debug_format_suffix, :logging_exception_prefix,
+ :log_config_append, :publish_errors,
+ :default_log_levels, :fatal_deprecations,
+ :instance_format, :instance_uuid_format,
+ :log_date_format, ].each { |param|
+ it { is_expected.to contain_congress_config("DEFAULT/#{param}").with_ensure('absent') }
+ }
+ end
+
+ context 'on Debian platforms' do
+ let :facts do
+ { :osfamily => 'Debian' }
+ end
+
+ it_configures 'congress-logging'
+ end
+
+ context 'on RedHat platforms' do
+ let :facts do
+ { :osfamily => 'RedHat' }
+ end
+
+ it_configures 'congress-logging'
+ end
+
+end
diff --git a/components/congress/puppet/spec/classes/congress_policy_spec.rb b/components/congress/puppet/spec/classes/congress_policy_spec.rb
new file mode 100644
index 0000000..d4e08ca
--- /dev/null
+++ b/components/congress/puppet/spec/classes/congress_policy_spec.rb
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+describe 'congress::policy' do
+
+ shared_examples_for 'congress policies' do
+ let :params do
+ {
+ :policy_path => '/etc/congress/policy.json',
+ :policies => {
+ 'context_is_admin' => {
+ 'key' => 'context_is_admin',
+ 'value' => 'foo:bar'
+ }
+ }
+ }
+ end
+
+ it 'set up the policies' do
+ is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
+ :key => 'context_is_admin',
+ :value => 'foo:bar'
+ })
+ end
+ end
+
+ context 'on Debian platforms' do
+ let :facts do
+ { :osfamily => 'Debian' }
+ end
+
+ it_configures 'congress policies'
+ end
+
+ context 'on RedHat platforms' do
+ let :facts do
+ { :osfamily => 'RedHat' }
+ end
+
+ it_configures 'congress policies'
+ end
+end
diff --git a/components/congress/puppet/spec/shared_examples.rb b/components/congress/puppet/spec/shared_examples.rb
new file mode 100644
index 0000000..fec0eac
--- /dev/null
+++ b/components/congress/puppet/spec/shared_examples.rb
@@ -0,0 +1,5 @@
+shared_examples_for "a Puppet::Error" do |description|
+ it "with message matching #{description.inspect}" do
+ expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
+ end
+end
diff --git a/components/congress/puppet/spec/unit/provider/congress_config/ini_setting_spec.rb b/components/congress/puppet/spec/unit/provider/congress_config/ini_setting_spec.rb
new file mode 100644
index 0000000..0c4b9fa
--- /dev/null
+++ b/components/congress/puppet/spec/unit/provider/congress_config/ini_setting_spec.rb
@@ -0,0 +1,68 @@
+#
+# these tests are a little concerning b/c they are hacking around the
+# modulepath, so these tests will not catch issues that may eventually arise
+# related to loading these plugins.
+# I could not, for the life of me, figure out how to programatcally set the modulepath
+$LOAD_PATH.push(
+ File.join(
+ File.dirname(__FILE__),
+ '..',
+ '..',
+ '..',
+ 'fixtures',
+ 'modules',
+ 'inifile',
+ 'lib')
+)
+$LOAD_PATH.push(
+ File.join(
+ File.dirname(__FILE__),
+ '..',
+ '..',
+ '..',
+ 'fixtures',
+ 'modules',
+ 'openstacklib',
+ 'lib')
+)
+require 'spec_helper'
+provider_class = Puppet::Type.type(:congress_config).provider(:ini_setting)
+describe provider_class do
+
+ it 'should default to the default setting when no other one is specified' do
+ resource = Puppet::Type::congress_config.new(
+ {:name => 'DEFAULT/foo', :value => 'bar'}
+ )
+ provider = provider_class.new(resource)
+ expect(provider.section).to eq('DEFAULT')
+ expect(provider.setting).to eq('foo')
+ end
+
+ it 'should allow setting to be set explicitly' do
+ resource = Puppet::Type::congress_config.new(
+ {:name => 'dude/foo', :value => 'bar'}
+ )
+ provider = provider_class.new(resource)
+ expect(provider.section).to eq('dude')
+ expect(provider.setting).to eq('foo')
+ end
+
+ it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
+ resource = Puppet::Type::congress_config.new(
+ {:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
+ )
+ provider = provider_class.new(resource)
+ provider.exists?
+ expect(resource[:ensure]).to eq :absent
+ end
+
+ it 'should ensure absent when value matches ensure_absent_val' do
+ resource = Puppet::Type::congress_config.new(
+ {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
+ )
+ provider = provider_class.new(resource)
+ provider.exists?
+ expect(resource[:ensure]).to eq :absent
+ end
+
+end
diff --git a/components/congress/puppet/spec/unit/type/congress_config_spec.rb b/components/congress/puppet/spec/unit/type/congress_config_spec.rb
new file mode 100644
index 0000000..22a70a1
--- /dev/null
+++ b/components/congress/puppet/spec/unit/type/congress_config_spec.rb
@@ -0,0 +1,64 @@
+require 'puppet'
+require 'puppet/type/congress_config'
+describe 'Puppet::Type.type(:congress_config)' do
+ before :each do
+ @congress_config = Puppet::Type.type(:congress_config).new(:name => 'DEFAULT/foo', :value => 'bar')
+ end
+
+ it 'should require a name' do
+ expect {
+ Puppet::Type.type(:congress_config).new({})
+ }.to raise_error(Puppet::Error, 'Title or name must be provided')
+ end
+
+ it 'should not expect a name with whitespace' do
+ expect {
+ Puppet::Type.type(:congress_config).new(:name => 'f oo')
+ }.to raise_error(Puppet::Error, /Parameter name failed/)
+ end
+
+ it 'should fail when there is no section' do
+ expect {
+ Puppet::Type.type(:congress_config).new(:name => 'foo')
+ }.to raise_error(Puppet::Error, /Parameter name failed/)
+ end
+
+ it 'should not require a value when ensure is absent' do
+ Puppet::Type.type(:congress_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
+ end
+
+ it 'should accept a valid value' do
+ @congress_config[:value] = 'bar'
+ expect(@congress_config[:value]).to eq('bar')
+ end
+
+ it 'should not accept a value with whitespace' do
+ @congress_config[:value] = 'b ar'
+ expect(@congress_config[:value]).to eq('b ar')
+ end
+
+ it 'should accept valid ensure values' do
+ @congress_config[:ensure] = :present
+ expect(@congress_config[:ensure]).to eq(:present)
+ @congress_config[:ensure] = :absent
+ expect(@congress_config[:ensure]).to eq(:absent)
+ end
+
+ it 'should not accept invalid ensure values' do
+ expect {
+ @congress_config[:ensure] = :latest
+ }.to raise_error(Puppet::Error, /Invalid value/)
+ end
+
+ it 'should autorequire the package that install the file' do
+ catalog = Puppet::Resource::Catalog.new
+ package = Puppet::Type.type(:package).new(:name => 'congress-common')
+ catalog.add_resource package, @congress_config
+ dependency = @congress_config.autorequire
+ expect(dependency.size).to eq(1)
+ expect(dependency[0].target).to eq(@congress_config)
+ expect(dependency[0].source).to eq(package)
+ end
+
+
+end