File: removal_shared_examples.rb

package info (click to toggle)
puppet-module-voxpupuli-elasticsearch 9.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,496 kB
  • sloc: ruby: 9,906; sh: 392; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 801 bytes parent folder | download
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
31
32
# frozen_string_literal: true

shared_examples 'module removal' do |es_config|
  describe 'uninstalling' do
    let(:manifest) do
      <<-MANIFEST
        class { 'elasticsearch': ensure => 'absent', oss => #{v[:oss]} }
      MANIFEST
    end

    it 'runs successfully' do
      apply_manifest(manifest, catch_failures: true, debug: v[:puppet_debug])
    end

    describe package("elasticsearch#{v[:oss] ? '-oss' : ''}") do
      it { is_expected.not_to be_installed }
    end

    describe service('elasticsearch') do
      it { is_expected.not_to be_enabled }
      it { is_expected.not_to be_running }
    end

    unless es_config.empty?
      describe port(es_config['http.port']) do
        it 'closed' do
          expect(subject).not_to be_listening
        end
      end
    end
  end
end