cookbook-openstack-identity/spec/fernet_tokens_spec.rb

34 lines
803 B
Ruby

# encoding: UTF-8
#
require_relative 'spec_helper'
describe 'openstack-identity::_fernet_tokens' do
describe 'ubuntu' do
include_context 'identity_stubs'
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
runner.converge(described_recipe)
end
it do
expect(chef_run).to create_directory('/etc/keystone/fernet-tokens')
.with(owner: 'keystone', user: 'keystone', mode: 00700)
end
[0, 1].each do |key_index|
it do
expect(chef_run).to create_file("/etc/keystone/fernet-tokens/#{key_index}")
.with(
content: "thisisfernetkey#{key_index}",
owner: 'keystone',
group: 'keystone',
mode: 00400
)
end
end
end
end