File: openstack_extras_repo_spec.rb

package info (click to toggle)
puppet-module-openstack-extras 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 524 kB
  • sloc: ruby: 951; sh: 62; python: 31; makefile: 10
file content (30 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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(command('apt-get install -y python-openstackclient').exit_code).to be_zero
        expect(command('apt-cache policy python-openstackclient | grep -A 1 \*\*\*').stdout).to match(/#{release}/)
      elsif os[:family] == 'RedHat'
        expect(command('dnf install -y python-openstackclient').exit_code).to be_zero
        expect(command('dnf list python-openstackclient | grep -A 1 "Installed Packages"').stdout).to match(/@rdo-release/)
      end
    end
  end
end