Permalink
Browse files

Add very specific Windows tests for mode

  • Loading branch information...
1 parent b66a43e commit 2438b2207c6112be5010ad86dabb2b49b5ae33ad @jkeiser jkeiser committed Mar 1, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 chef/spec/support/shared/functional/securable_resource.rb
@@ -309,6 +309,32 @@ def descriptor
explicit_aces.should == [ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE) ]
end
+
+ it "respects the owner, group and everyone bits of mode" do
+ resource.mode 0754
+ resource.owner 'Guest'
+ resource.group 'Administrators'
+ resource.run_action(:create)
+
+ explicit_aces.should == [
+ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_WRITE | Security::FILE_GENERIC_EXECUTE | Security::DELETE),
+ ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_READ | Security::FILE_GENERIC_EXECUTE),
+ ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_READ)
+ ]
+ end
+
+ it "respects the individual read, write and execute bits of mode" do
+ resource.mode 0421
+ resource.owner 'Guest'
+ resource.group 'Administrators'
+ resource.run_action(:create)
+
+ explicit_aces.should == [
+ ACE.access_allowed(SID.Guest, Security::FILE_GENERIC_READ),
+ ACE.access_allowed(SID.Administrators, Security::FILE_GENERIC_WRITE | Security::DELETE),
+ ACE.access_allowed(SID.Everyone, Security::FILE_GENERIC_EXECUTE)
+ ]
+ end
end
end

0 comments on commit 2438b22

Please sign in to comment.