summaryrefslogtreecommitdiff
path: root/spec/support/shared/functional/securable_resource_with_reporting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared/functional/securable_resource_with_reporting.rb')
-rw-r--r--spec/support/shared/functional/securable_resource_with_reporting.rb30
1 files changed, 2 insertions, 28 deletions
diff --git a/spec/support/shared/functional/securable_resource_with_reporting.rb b/spec/support/shared/functional/securable_resource_with_reporting.rb
index c9b5bae465..4d37efd9c2 100644
--- a/spec/support/shared/functional/securable_resource_with_reporting.rb
+++ b/spec/support/shared/functional/securable_resource_with_reporting.rb
@@ -21,9 +21,7 @@ ALL_EXPANDED_PERMISSIONS = ["generic read",
"read attributes",
"write attributes"]
-
shared_examples_for "a securable resource with reporting" do
-
include_context "diff disabled"
let(:current_resource) do
@@ -72,7 +70,6 @@ shared_examples_for "a securable resource with reporting" do
end
context "and owner is specified with a String (username) in new_resource", :requires_root => true do
-
# TODO/bug: duplicated from the "securable resource" tests
if ohai[:platform] == "aix"
@@ -89,11 +86,9 @@ shared_examples_for "a securable resource with reporting" do
it "sets the owner on new_resource to the username (String) of the desired owner" do
expect(resource.owner).to eq(expected_user_name)
end
-
end
context "and owner is specified with an Integer (uid) in new_resource", :requires_root => true do
-
# TODO: duplicated from "securable resource"
if ohai[:platform] == "aix"
let(:expected_user_name) { "guest" }
@@ -115,7 +110,6 @@ shared_examples_for "a securable resource with reporting" do
end
context "and group is specified with a String (group name)", :requires_root => true do
-
let(:expected_group_name) { Etc.getgrent.name }
before do
@@ -126,7 +120,6 @@ shared_examples_for "a securable resource with reporting" do
it "sets the group on new_resource to the group name (String) of the group" do
expect(resource.group).to eq(expected_group_name)
end
-
end
context "and group is specified with an Integer (gid)", :requires_root => true do
@@ -140,7 +133,6 @@ shared_examples_for "a securable resource with reporting" do
it "sets the group on new_resource to the gid (Integer)" do
expect(resource.group).to eq(expected_gid)
end
-
end
context "and mode is specified as a String" do
@@ -190,7 +182,6 @@ shared_examples_for "a securable resource with reporting" do
end
context "and owner is specified with a String (username) in new_resource" do
-
let(:expected_user_name) { Etc.getpwuid(Process.uid).name }
before do
@@ -200,11 +191,9 @@ shared_examples_for "a securable resource with reporting" do
it "sets the owner on new_resource to the username (String) of the desired owner" do
expect(current_resource.owner).to eq(expected_user_name)
end
-
end
context "and owner is specified with an Integer (uid) in new_resource" do
-
let(:expected_uid) { Process.uid }
before do
@@ -224,7 +213,6 @@ shared_examples_for "a securable resource with reporting" do
it "sets the group on new_resource to the group name (String) of the group" do
expect(current_resource.group).to eq(@expected_group_name)
end
-
end
context "and group is specified with an Integer (gid)" do
@@ -235,7 +223,6 @@ shared_examples_for "a securable resource with reporting" do
it "sets the group on new_resource to the gid (Integer)" do
expect(current_resource.group).to eq(@expected_gid)
end
-
end
context "and mode is specified as a String" do
@@ -267,13 +254,10 @@ shared_examples_for "a securable resource with reporting" do
end
describe "reading file security metadata for reporting on windows", :windows_only do
-
context "when the target file doesn't exist" do
-
# Windows reporting data should look like this (+/- ish):
# { "owner" => "bob", "checksum" => "ffff", "access control" => { "bob" => { "permissions" => ["perm1", "perm2", ...], "flags" => [] }}}
-
before do
resource.action(:create)
end
@@ -293,15 +277,13 @@ shared_examples_for "a securable resource with reporting" do
resource.run_action(:create)
# TODO: most stable way to specify?
expect(resource.owner).to eq(etc.getpwuid(process.uid).name)
- expect(resource.state[:expanded_rights]).to eq({ "CURRENTUSER" => { "permissions" => ALL_EXPANDED_PERMISSIONS, "flags" => [] }})
+ expect(resource.state[:expanded_rights]).to eq({ "CURRENTUSER" => { "permissions" => ALL_EXPANDED_PERMISSIONS, "flags" => [] } })
expect(resource.state[:expanded_deny_rights]).to eq({})
expect(resource.state[:inherits]).to be_truthy
end
end
-
- context "and owner is specified with a string (username) in new_resource" do
-
+ context "and owner is specified with a string (username) in new_resource" do
# TODO/bug: duplicated from the "securable resource" tests
let(:expected_user_name) { "Guest" }
@@ -313,11 +295,9 @@ shared_examples_for "a securable resource with reporting" do
it "sets the owner on new_resource to the username (string) of the desired owner" do
expect(resource.owner).to eq(expected_user_name)
end
-
end
context "and owner is specified with a fully qualified domain user" do
-
# TODO: duplicated from "securable resource"
let(:expected_user_name) { 'domain\user' }
@@ -331,7 +311,6 @@ shared_examples_for "a securable resource with reporting" do
expect(resource.owner).to eq(expected_user_name)
end
end
-
end
context "when the target file exists" do
@@ -350,7 +329,6 @@ shared_examples_for "a securable resource with reporting" do
end
context "and owner is specified with a string (username) in new_resource" do
-
let(:expected_user_name) { etc.getpwuid(process.uid).name }
before do
@@ -360,11 +338,9 @@ shared_examples_for "a securable resource with reporting" do
it "sets the owner on current_resource to the username (string) of the desired owner" do
expect(current_resource.owner).to eq(expected_user_name)
end
-
end
context "and owner is specified as a fully qualified 'domain\\user' in new_resource" do
-
let(:expected_user_name) { 'domain\user' }
before do
@@ -391,8 +367,6 @@ shared_examples_for "a securable resource with reporting" do
skip
end
end
-
-
end
end
end