File: selinux_spec.rb

package info (click to toggle)
puppet-agent 7.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,092 kB
  • sloc: ruby: 245,074; sh: 456; makefile: 38; xml: 33
file content (27 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (2)
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
require 'spec_helper'

describe Puppet::Type.type(:file), " when manipulating file contexts" do
  include PuppetSpec::Files

  before :each do

    @file = Puppet::Type::File.new(
      :name => make_absolute("/tmp/foo"),
      :ensure => "file",
      :seluser => "user_u",
      :selrole => "role_r",
      :seltype => "type_t")
  end

  it "should use :seluser to get/set an SELinux user file context attribute" do
    expect(@file[:seluser]).to eq("user_u")
  end

  it "should use :selrole to get/set an SELinux role file context attribute" do
    expect(@file[:selrole]).to eq("role_r")
  end

  it "should use :seltype to get/set an SELinux user file context attribute" do
    expect(@file[:seltype]).to eq("type_t")
  end
end