1 require 'spec_helper_acceptance'
3 describe 'basic keystone server with resources' do
5 context 'default parameters' do
7 it 'should work with no errors' do
9 Exec { logoutput => 'on_failure' }
15 class { '::openstack_extras::repo::debian::ubuntu':
17 package_require => true,
21 class { '::openstack_extras::repo::redhat::redhat':
24 package { 'openstack-selinux': ensure => 'latest' }
27 fail("Unsupported osfamily (${::osfamily})")
31 class { '::mysql::server': }
34 class { '::keystone::client': }
35 class { '::keystone::cron::token_flush': }
36 class { '::keystone::db::mysql':
37 password => 'keystone',
42 database_connection => 'mysql://keystone:keystone@127.0.0.1/keystone',
43 admin_token => 'admin_token',
46 class { '::keystone::roles::admin':
47 email => 'test@example.tld',
48 password => 'a_big_secret',
50 class { '::keystone::endpoint':
51 public_url => "http://127.0.0.1:5000/",
52 admin_url => "http://127.0.0.1:35357/",
54 ::keystone::resource::service_identity { 'beaker-ci':
55 service_type => 'beaker',
56 service_description => 'beaker service',
57 service_name => 'beaker',
59 public_url => 'http://127.0.0.1:1234',
60 admin_url => 'http://127.0.0.1:1234',
61 internal_url => 'http://127.0.0.1:1234',
66 # Run it twice and test for idempotency
67 apply_manifest(pp, :catch_failures => true)
68 apply_manifest(pp, :catch_changes => true)
71 describe port(5000) do
72 it { is_expected.to be_listening.with('tcp') }
75 describe port(35357) do
76 it { is_expected.to be_listening.with('tcp') }
80 it { should have_entry('1 0 * * * keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1').with_user('keystone') }
83 describe 'test keystone user/tenant/service/role/endpoint resources' do
84 it 'should find beaker user' do
85 shell('openstack --os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url http://127.0.0.1:5000/v2.0 user list') do |r|
86 expect(r.stdout).to match(/beaker/)
87 expect(r.stderr).to be_empty
90 it 'should find services tenant' do
91 shell('openstack --os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url http://127.0.0.1:5000/v2.0 project list') do |r|
92 expect(r.stdout).to match(/services/)
93 expect(r.stderr).to be_empty
96 it 'should find beaker service' do
97 shell('openstack --os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url http://127.0.0.1:5000/v2.0 service list') do |r|
98 expect(r.stdout).to match(/beaker/)
99 expect(r.stderr).to be_empty
102 it 'should find admin role' do
103 shell('openstack --os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url http://127.0.0.1:5000/v2.0 role list') do |r|
104 expect(r.stdout).to match(/admin/)
105 expect(r.stderr).to be_empty
108 it 'should find beaker endpoints' do
109 shell('openstack --os-username admin --os-password a_big_secret --os-tenant-name openstack --os-auth-url http://127.0.0.1:5000/v2.0 endpoint list --long') do |r|
110 expect(r.stdout).to match(/1234/)
111 expect(r.stderr).to be_empty