diff options
author | sdelano <stephen@opscode.com> | 2012-12-04 10:16:17 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2012-12-25 08:50:49 -0800 |
commit | edead51e01b5aedc8ab9499f0fae7f61e2924f05 (patch) | |
tree | 4a0abd504e4d14692c11ea831099aa9d473381a9 | |
parent | 84dcb7768d2d31ab0d3fa703e77e98b3dee2f38c (diff) | |
download | chef-edead51e01b5aedc8ab9499f0fae7f61e2924f05.tar.gz |
CHEF-3660: add functional tests for executing FileUtils.cp_r(:preserve) on symlinks
-rw-r--r-- | chef/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle | bin | 0 -> 2330 bytes | |||
-rw-r--r-- | chef/spec/functional/resource/deploy_revision_spec.rb | 18 |
2 files changed, 17 insertions, 1 deletions
diff --git a/chef/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle b/chef/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle Binary files differnew file mode 100644 index 0000000000..0a96fbb24f --- /dev/null +++ b/chef/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle diff --git a/chef/spec/functional/resource/deploy_revision_spec.rb b/chef/spec/functional/resource/deploy_revision_spec.rb index cbe308c635..633546539a 100644 --- a/chef/spec/functional/resource/deploy_revision_spec.rb +++ b/chef/spec/functional/resource/deploy_revision_spec.rb @@ -69,16 +69,20 @@ describe Chef::Resource::DeployRevision, :unix_only => true do let(:git_bundle_with_in_repo_callbacks) { File.expand_path("git_bundles/sinatra-test-app-with-callback-files.gitbundle", CHEF_SPEC_DATA) } + let(:git_bundle_with_in_repo_symlinks) { File.expand_path("git_bundles/sinatra-test-app-with-symlinks.gitbundle", CHEF_SPEC_DATA) } + # This is the fourth version let(:latest_rev) { "3eb5ca6c353c83d9179dd3b29347539829b401f3" } # This is the third version let(:previous_rev) { "6d19a6dbecc8e37f5b2277345885c0c783eb8fb1" } - # This is the sixth version, it is on the "with-deploy-scripts" branch let(:rev_with_in_repo_callbacks) { "2404d015882659754bdb93ad6e4b4d3d02691a82" } + # This is the fifth version in the "with-symlinks" branch + let(:rev_with_in_repo_symlinks) { "5a4748c52aaea8250b4346a9b8ede95ee3755e28" } + # Read values from the +observe_order_file+ and split each line. This way you # can see in which order things really happened. def actual_operations_order @@ -494,6 +498,18 @@ describe Chef::Resource::DeployRevision, :unix_only => true do end end + context "when deploying an app with in-repo symlinks" do + let(:deploy_with_in_repo_symlinks) do + basic_deploy_resource.dup.tap do |r| + r.repo git_bundle_with_in_repo_symlinks + r.revision rev_with_in_repo_symlinks + end + end + + it "should not raise an exception calling File.utime on symlinks" do + lambda { deploy_with_in_repo_symlinks.run_action(:deploy) }.should_not raise_error + end + end end |