Colleen Murphy c30510ad2f Add beaker tests
Add tests to ensure the manifests apply cleanly and a kerberos ticket
can be granted.

The krb5-admin-server service won't start without the realm being
manually set up, so add those steps in between running the manifest once
and checking for idempotency. Once the realm is set up, the service will
automatically start and puppet shouldn't try to start it again.

Change-Id: I7f8aea80ea40bf4ff28fafa6a53c9d26e9c303ec
2018-07-12 15:57:21 +02:00

36 lines
994 B
Ruby
Executable File

require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
describe 'kerberos', if: os[:family] == 'ubuntu' do
def pp_path
base_path = File.dirname(__FILE__)
File.join(base_path, 'fixtures')
end
def puppet_manifest
manifest_path = File.join(pp_path, 'default.pp')
File.read(manifest_path)
end
it 'should work with no errors' do
apply_manifest(puppet_manifest, catch_failures: true)
end
# Realm needs to be manually set up before admin service will start
it 'set up the kerberos realm' do
shell('yes krbpass | krb5_newrealm')
shell('echo "addprinc -randkey host/krbtest.openstack.ci" | kadmin.local')
shell('echo "ktadd host/krbtest.openstack.ci" | kadmin.local')
shell('echo "addprinc -pw rootpw root@OPENSTACK.CI" | kadmin.local')
end
it 'should be idempotent' do
apply_manifest(puppet_manifest, catch_changes: true)
end
describe command('echo rootpw | kinit') do
its(:exit_status) { should eq 0 }
end
end