puppet-openstack_extras/spec/acceptance/openstack_extras_repo_spec.rb
Alex Schultz 7c15f3039f Rework os check
This change updates the way we do the os check to use the
os facts rather than running facter via beaker.

Change-Id: Iaee0ad6252b44ad2e2b5e6478957084c5aa18c05
2016-07-05 10:56:30 -06:00

31 lines
1004 B
Ruby

require 'spec_helper_acceptance'
describe 'openstack_extras::repo::*' do
context 'default parameters' do
release = 'mitaka'
it 'should work with no errors' do
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
it 'should be able to install openstack packages' do
if os[:family] == 'Debian'
expect(shell('apt-get install -y python-openstackclient').exit_code).to be_zero
expect(shell('apt-cache policy python-openstackclient | grep -A 1 \*\*\*').stdout).to match(/#{release}/)
elsif os[:family] == 'RedHat'
expect(shell('yum install -y python-openstackclient').exit_code).to be_zero
expect(shell('yum list python-openstackclient | grep -A 1 "Installed Packages"').stdout).to match(/@rdo-release/)
end
end
end
end