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
This commit is contained in:
Alex Schultz 2016-06-29 14:41:22 -06:00
parent 256d8d3be7
commit 7c15f3039f
2 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,11 @@
HOSTS:
ubuntu-server-16.04-amd64:
roles:
- master
platform: ubuntu-16.04-amd64
box: puppetlabs/ubuntu-16.04-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-16.04-64-nocm
hypervisor: vagrant
CONFIG:
log_level: debug
type: foss

View File

@ -18,11 +18,10 @@ describe 'openstack_extras::repo::*' do
end
it 'should be able to install openstack packages' do
case fact('osfamily')
when 'Debian'
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}/)
when 'Redhat'
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