File: systemd_spec.rb

package info (click to toggle)
puppet 5.5.22-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,316 kB
  • sloc: ruby: 254,925; sh: 1,608; xml: 219; makefile: 153; sql: 103
file content (21 lines) | stat: -rw-r--r-- 918 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
require 'spec_helper'

describe Puppet::Type.type(:service).provider(:systemd), '(integration)' do
  # TODO: Unfortunately there does not seem a way to stub the executable
  #       checks in the systemd provider because they happen at load time.

  it "should be considered suitable if /proc/1/comm is present and contains 'systemd'",
    :if => File.exist?('/proc/1/comm') && Puppet::FileSystem.read('/proc/1/comm').include?('systemd') do
    expect(described_class).to be_suitable
  end

  it "should not be considered suitable if /proc/1/comm is present it does not contain 'systemd'",
    :if => File.exist?('/proc/1/comm') && !Puppet::FileSystem.read('/proc/1/comm').include?('systemd') do
    expect(described_class).not_to be_suitable
  end

  it "should not be considered suitable if /proc/1/comm is absent",
    :if => !File.exist?('/proc/1/comm') do
    expect(described_class).not_to be_suitable
  end
end