Sha256: 51a78a90988a0bb23e9a6d573038c7086a612bb4e353eec6b76589348c490b89

Contents?: true

Size: 1.03 KB

Versions: 52

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

test_title = 'Integration Tests for Puppet::Type::Service::Provider::Systemd'

describe test_title, unless: Puppet::Util::Platform.jruby? do
  let(:provider_class) { Puppet::Type.type(:service).provider(:systemd) }

  # 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(provider_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(provider_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(provider_class).not_to be_suitable
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
puppet-6.17.0 spec/integration/provider/service/systemd_spec.rb
puppet-6.17.0-x86-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.17.0-x64-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.17.0-universal-darwin spec/integration/provider/service/systemd_spec.rb
puppet-6.16.0 spec/integration/provider/service/systemd_spec.rb
puppet-6.16.0-x86-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.16.0-x64-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.16.0-universal-darwin spec/integration/provider/service/systemd_spec.rb
puppet-6.15.0 spec/integration/provider/service/systemd_spec.rb
puppet-6.15.0-x86-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.15.0-x64-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.15.0-universal-darwin spec/integration/provider/service/systemd_spec.rb
puppet-6.14.0 spec/integration/provider/service/systemd_spec.rb
puppet-6.14.0-x86-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.14.0-x64-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.14.0-universal-darwin spec/integration/provider/service/systemd_spec.rb
puppet-6.13.0 spec/integration/provider/service/systemd_spec.rb
puppet-6.13.0-x86-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.13.0-x64-mingw32 spec/integration/provider/service/systemd_spec.rb
puppet-6.13.0-universal-darwin spec/integration/provider/service/systemd_spec.rb