puppet-midonet/spec/classes/midonet_cluster_run_spec.rb
Alex Ruiz Estradera a6f5b2bdd8 Fix Some Bugs on Puppet Midonet
- Pin version of package elasticsearh
- Send proper format to midonet config
- Check for duplicate midonet.conf file creation

Change-Id: I8b13dcb1c82be3fa6d61daad1ddcad664420f2e2
2016-12-13 16:53:56 +01:00

35 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'midonet::cluster::run' do
context 'with parameters' do
let :facts do
{
:osfamily => 'Debian',
:lsbdistid => 'Ubuntu',
:lsbdistrelease => '16.04',
:puppetversion => Puppet.version
}
end
let :params do
{
:zookeeper_hosts => ['{ "ip" => "127.0.0.1", "port" => "2181" }'],
:cassandra_servers => [ '127.0.0.1' ],
:cassandra_rep_factor => '3',
:keystone_admin_token => 'ADMIN_TOKEN',
:keystone_host => '127.0.0.1',
}
end
it { is_expected.to contain_exec('/bin/bash /tmp/mn-cluster_config.sh') }
it { is_expected.to contain_file('/tmp/mn-cluster_config.sh').with_ensure('present') }
it { is_expected.to contain_file('set_config').with(
'ensure' => 'present',
'path' => '/etc/midonet/midonet.conf',
) }
it { is_expected.to contain_service('midonet-cluster').with(
'ensure' => 'running',
'enable' => 'true',
'name' => 'midonet-cluster'
) }
end
end