diff options
author | Tim Smith <tsmith@chef.io> | 2018-10-16 09:28:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-16 09:28:26 +0100 |
commit | ab0b4d5bbddc916f347911fea5d7de5459e83e96 (patch) | |
tree | 42085b1ff59e9a794590aa35806e6ae9104d9467 /spec | |
parent | f0085ff663c8857ef9d0aef08ee9c4b74ebd8946 (diff) | |
parent | 4aa73c6d0e04b293d63ea7cc15773033c010f000 (diff) | |
download | chef-ab0b4d5bbddc916f347911fea5d7de5459e83e96.tar.gz |
Merge pull request #7753 from chef/lcg/fix-sticky-bits
File provider: fix sticky bits management / preservation
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/file_content_management/deploy/mv_unix_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb index 6c8736ae38..a31074e4bd 100644 --- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb @@ -1,6 +1,6 @@ # # Author:: Daniel DeLeo (<dan@chef.io>) -# Copyright:: Copyright 2013-2016, Chef Software Inc. +# Copyright:: Copyright 2013-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -98,4 +98,16 @@ describe Chef::FileContentManagement::Deploy::MvUnix do end end + + describe "when testing against real files", unix_only: true do + it "preserves sticky bits" do + staging_file = Tempfile.new("staging_file") + target_file = Tempfile.new("target_file") + File.chmod(04755, target_file.path) + content_deployer.deploy(staging_file.path, target_file.path) + expect(::File.stat(target_file.path).mode & 07777).to eql(04755) + staging_file.unlink + target_file.unlink + end + end end |