add path for grep command

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-02-04 15:04:28 +01:00
parent 5653e58523
commit 82a32eaee0
13 changed files with 56 additions and 6 deletions

View File

@ -96,7 +96,7 @@ class cloud::compute(
# It's a hack to fit with our setup where we run MySQL/Galera
exec {'nova_db_sync':
command => '/usr/bin/nova-manage db sync',
unless => "/usr/bin/mysql nova -h ${nova_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables"
unless => "/usr/bin/mysql nova -h ${nova_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}
}

View File

@ -530,7 +530,7 @@ class cloud::identity (
# It's a hack to fit with our setup where we run MySQL/Galera
exec {'keystone_db_sync':
command => '/usr/bin/keystone-manage db_sync',
unless => "/usr/bin/mysql keystone -h ${keystone_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables"
unless => "/usr/bin/mysql keystone -h ${keystone_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}
@@haproxy::balancermember{"${::fqdn}-keystone_api":

View File

@ -50,7 +50,7 @@ class cloud::network::controller(
# It's a hack to fit with our setup where we run MySQL/Galera
exec {'neutron_db_sync':
command => '/usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head',
unless => "/usr/bin/mysql neutron -h ${neutron_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables"
unless => "/usr/bin/mysql neutron -h ${neutron_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}
@@haproxy::balancermember{"${::fqdn}-neutron_api":

View File

@ -57,7 +57,7 @@ class cloud::orchestration(
# It's a hack to fit with our setup where we run MySQL/Galera
exec {'heat_db_sync':
command => '/usr/bin/heat-manage --config-file /etc/heat/heat.conf db_sync',
unless => "/usr/bin/mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables"
unless => "/usr/bin/mysql heat -h ${heat_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}
}

View File

@ -51,7 +51,7 @@ class cloud::volume(
# It's a hack to fit with our setup where we run MySQL/Galera
exec {'cinder_db_sync':
command => '/usr/bin/cinder-manage db sync',
unless => "/usr/bin/mysql cinder -h ${cinder_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | grep Tables"
unless => "/usr/bin/mysql cinder -h ${cinder_db_host} -u ${encoded_user} -p${encoded_password} -e \"show tables\" | /bin/grep Tables"
}
}

View File

@ -60,6 +60,13 @@ describe 'cloud::compute::controller' do
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
end
it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with(
:command => '/usr/bin/nova-manage db sync',
:unless => '/usr/bin/mysql nova -h 10.0.0.1 -u nova -psecrete -e "show tables" | /bin/grep Tables'
)
end
it 'configure nova-scheduler' do
should contain_class('nova::scheduler').with(:enabled => true)
end

View File

@ -59,6 +59,13 @@ describe 'cloud::compute::hypervisor' do
should contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with('value' => true)
end
it 'checks if Nova DB is populated' do
should contain_exec('nova_db_sync').with(
:command => '/usr/bin/nova-manage db sync',
:unless => '/usr/bin/mysql nova -h 10.0.0.1 -u nova -psecrete -e "show tables" | /bin/grep Tables'
)
end
it 'insert and activate nbd module' do
should contain_exec('insert_module_nbd').with('command' => '/bin/echo "nbd" > /etc/modules', 'unless' => '/bin/grep "nbd" /etc/modules')
should contain_exec('/sbin/modprobe nbd').with('unless' => '/bin/grep -q "^nbd " "/proc/modules"')

View File

@ -110,6 +110,13 @@ describe 'cloud::identity' do
should contain_keystone_config('ec2/driver').with('value' => 'keystone.contrib.ec2.backends.sql.Ec2')
end
it 'checks if Keystone DB is populated' do
should contain_exec('keystone_db_sync').with(
:command => '/usr/bin/keystone-manage db_sync',
:unless => '/usr/bin/mysql keystone -h 10.0.0.1 -u keystone -psecrete -e "show tables" | /bin/grep Tables'
)
end
it 'configure keystone admin role' do
should contain_class('keystone::roles::admin').with(
:email => 'admin@openstack.org',

View File

@ -98,7 +98,7 @@ describe 'cloud::image' do
it 'checks if Glance DB is populated' do
should contain_exec('glance_db_sync').with(
:command => '/usr/bin/glance-manage db_sync',
:unless => '/usr/bin/mysql glance -e "show tables" | /bin/grep Tables'
:unless => '/usr/bin/mysql glance -h 10.0.0.1 -u glance -psecrete -e "show tables" | /bin/grep Tables'
)
end
end

View File

@ -80,6 +80,14 @@ describe 'cloud::network::controller' do
:api_workers => '2'
)
end
it 'checks if Neutron DB is populated' do
should contain_exec('neutron_db_sync').with(
:command => '/usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head',
:unless => '/usr/bin/mysql neutron -h 10.0.0.1 -u neutron -psecrete -e "show tables" | /bin/grep Tables'
)
end
end
context 'on Debian platforms' do

View File

@ -80,6 +80,13 @@ describe 'cloud::orchestration::api' do
)
end
it 'checks if Heat DB is populated' do
should contain_exec('heat_db_sync').with(
:command => '/usr/bin/heat-manage --config-file /etc/heat/heat.conf db_sync',
:unless => '/usr/bin/mysql heat -h 10.0.0.1 -u heat -psecrete -e "show tables" | /bin/grep Tables'
)
end
end
context 'on Debian platforms' do

View File

@ -60,6 +60,13 @@ describe 'cloud::volume::controller' do
should contain_class('cinder::ceilometer')
end
it 'checks if Cinder DB is populated' do
should contain_exec('cinder_db_sync').with(
:command => '/usr/bin/cinder-manage db sync',
:unless => '/usr/bin/mysql cinder -h 10.0.0.1 -u cinder -psecrete -e "show tables" | /bin/grep Tables'
)
end
it 'configure cinder scheduler' do
should contain_class('cinder::scheduler')
end

View File

@ -58,6 +58,13 @@ describe 'cloud::volume::storage' do
end
it 'checks if Cinder DB is populated' do
should contain_exec('cinder_db_sync').with(
:command => '/usr/bin/cinder-manage db sync',
:unless => '/usr/bin/mysql cinder -h 10.0.0.1 -u cinder -psecrete -e "show tables" | /bin/grep Tables'
)
end
it 'configure cinder volume with rbd backend' do
should include_class('cinder::volume')