fix test failures

The tests were failing b/c they assume a hash would
be processed in order.

The tests have been updated to check the expected keys
individually.
This commit is contained in:
Dan Bode
2012-11-02 10:46:09 -07:00
parent 6f76b4f979
commit ad142c3ee3

View File

@@ -62,11 +62,12 @@ describe 'openstack::controller' do
) )
end end
it { should contain_class('mysql::server').with( it 'should configure mysql server' do
:config_hash => {'bind_address' => '0.0.0.0', 'root_password' => 'sql_pass' }, param_value(subject, 'class', 'mysql::server', 'enabled').should be_true
:enabled => true config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash')
) config_hash['bind_address'].should == '0.0.0.0'
} config_hash['root_password'].should == 'sql_pass'
end
it 'should contain openstack db config' do it 'should contain openstack db config' do
should contain_class('keystone::db::mysql').with( should contain_class('keystone::db::mysql').with(
@@ -129,11 +130,12 @@ describe 'openstack::controller' do
) )
end end
it { should contain_class('mysql::server').with( it 'should configure mysql server' do
:config_hash => {'bind_address' => '0.0.0.0', 'root_password' => 'sql_pass' }, param_value(subject, 'class', 'mysql::server', 'enabled').should be_false
:enabled => false config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash')
) config_hash['bind_address'].should == '0.0.0.0'
} config_hash['root_password'].should == 'sql_pass'
end
['keystone', 'nova', 'glance', 'cinder', 'quantum'].each do |x| ['keystone', 'nova', 'glance', 'cinder', 'quantum'].each do |x|
it { should_not contain_class("#{x}::db::mysql") } it { should_not contain_class("#{x}::db::mysql") }