puppet-tripleo/spec/classes/tripleo_certmonger_rabbitmq_spec.rb
Michele Baldessari 1e65c3f4fc Make puppet-tripleo compatible with latest puppet-rabbitmq
https://review.opendev.org/#/c/677082/ merged today and moved puppet-rabbitmq to 9.1.0
which is breaking our spec tests:

https://zuul.opendev.org/t/openstack/build/e767db93fe214514bebc065a64288548/log/job-output.txt

So we error out with things like:
2019-08-19 07:19:37.527187 | centos-7 | 1) tripleo::certmonger::rabbitmq on redhat-7-x86_64 behaves like tripleo::certmonger::rabbitmq should include the base for using certmonger
2019-08-19 07:19:37.527435 | centos-7 | Failure/Error: include ::rabbitmq::params
2019-08-19 07:19:37.527713 | centos-7 | Puppet::PreformattedError:
2019-08-19 07:19:37.528769 | centos-7 | Evaluation Error: Error while evaluating a Function Call, Could not find class ::rabbitmq::params for centos-7-rax-ord-0010255916 (file: /home/zuul/workspace/spec/fixtures/modules/tripleo/manifests/certmonger/rabbitmq.pp, line: 51, column: 3) on node centos-7-rax-ord-0010255916

Let's remove any reference to rabbitmq::params and also the following
two notifies:
  File[$service_certificate] ~> Service<| title == $::rabbitmq::service_name |>
  File[$service_key] ~> Service<| title == $::rabbitmq::service_name |>

They do nothing in a containerized deployment anyway.

Tested as follows:
- Full downstream OSP15 HA deploy

Change-Id: Ib7c373c10ff7bcd8ec33cb912a8a0a4a32a196e2
Closes-Bug: #1840641
2019-08-19 21:27:33 +02:00

61 lines
1.7 KiB
Ruby

#
# Copyright (C) 2017 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for tripleo
#
require 'spec_helper'
describe 'tripleo::certmonger::rabbitmq' do
shared_examples_for 'tripleo::certmonger::rabbitmq' do
let :params do
{
:hostname => 'localhost',
:service_certificate => '/etc/pki/cert.crt',
:service_key => '/etc/pki/key.pem',
}
end
it 'should include the base for using certmonger' do
is_expected.to contain_class('certmonger')
end
it 'should request a certificate' do
is_expected.to contain_certmonger_certificate('rabbitmq').with(
:ensure => 'present',
:certfile => '/etc/pki/cert.crt',
:keyfile => '/etc/pki/key.pem',
:hostname => 'localhost',
:dnsname => 'localhost',
:ca => 'local',
:wait => true,
)
is_expected.to contain_file('/etc/pki/cert.crt')
is_expected.to contain_file('/etc/pki/key.pem')
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
end
it_behaves_like 'tripleo::certmonger::rabbitmq'
end
end
end