diff options
8 files changed, 55 insertions, 1 deletions
@@ -419,6 +419,10 @@ namespace :features do t.profile = "provider_template" end + Cucumber::Rake::Task.new(:remote_directory) do |t| + t.profile = "provider_remote_directory" + end + Cucumber::Rake::Task.new(:git) do |t| t.profile = "provider_git" end diff --git a/cucumber.yml b/cucumber.yml index 1f534db25e..50eeaf820d 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -46,6 +46,7 @@ recipe_inclusion: --tags recipe_inclusion --format pretty -r features/steps -r f attribute_inclusion: --tags @attribute_inclusion --format pretty -r features/steps -r features/support features cookbooks: --tags @cookbooks --format pretty -r features/steps -r features/support features provider_remote_file: --tags provider,remote_file --format pretty -r features/steps -r features/support features +provider_remote_directory: --tags @remote_directory --format pretty -r features/steps -r features/support features provider_git: --tags provider,git --format pretty -r features/steps -r features/support features provider_template: --tags template --format pretty -r features/steps -r features/support features provider_package_macports: --tags macports --format pretty -r features/steps -r features/support features diff --git a/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/bar.txt b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/bar.txt new file mode 100644 index 0000000000..3567f3874e --- /dev/null +++ b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/bar.txt @@ -0,0 +1 @@ +Space Manoeuvres stage 1
\ No newline at end of file diff --git a/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/baz.txt b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/baz.txt new file mode 100644 index 0000000000..63c03878e1 --- /dev/null +++ b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/baz.txt @@ -0,0 +1 @@ +micromega
\ No newline at end of file diff --git a/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/foo.txt b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/foo.txt new file mode 100644 index 0000000000..c964b2828b --- /dev/null +++ b/features/data/cookbooks/transfer_remote_directories/files/default/transfer_directory_feature/foo.txt @@ -0,0 +1 @@ +tyrantanic
\ No newline at end of file diff --git a/features/data/cookbooks/transfer_remote_directories/recipes/transfer_directory.rb b/features/data/cookbooks/transfer_remote_directories/recipes/transfer_directory.rb new file mode 100644 index 0000000000..5333236508 --- /dev/null +++ b/features/data/cookbooks/transfer_remote_directories/recipes/transfer_directory.rb @@ -0,0 +1,29 @@ +# +# Cookbook Name:: transfer_remote_directories +# Recipe:: transfer_directory +# +# Copyright 2009, Daniel DeLeo +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +remote_directory "#{node[:tmpdir]}/transfer_directory" do + source "transfer_directory_feature" + files_backup 10 + files_owner "root" + files_group "staff" + files_mode "0644" + owner "nobody" + group "nobody" + mode "0755" +end
\ No newline at end of file diff --git a/features/provider/remote_directory/transfer_remote_directories.feature b/features/provider/remote_directory/transfer_remote_directories.feature new file mode 100644 index 0000000000..c474a686bc --- /dev/null +++ b/features/provider/remote_directory/transfer_remote_directories.feature @@ -0,0 +1,18 @@ +@provider @remote_directory +Feature: Transfer remote directories + In order to install copies of many files to many hosts + As an OpsDev + I want to transfer directories from remote locations + + Scenario: Transfer a directory from a cookbook + Given a validated node + And it includes the recipe 'transfer_remote_directories::transfer_directory' + When I run the chef-client + Then the run should exit '0' + And a file named 'transfer_directory/foo.txt' should contain 'tyrantanic' + And a file named 'transfer_directory/bar.txt' should contain 'Space Manoeuvres stage 1' + And a file named 'transfer_directory/baz.txt' should contain 'micromega' + + + + diff --git a/features/steps/run_client_steps.rb b/features/steps/run_client_steps.rb index ccfd72986e..cec003b671 100644 --- a/features/steps/run_client_steps.rb +++ b/features/steps/run_client_steps.rb @@ -153,4 +153,3 @@ Then /^'(.+)' should appear on '(.+)' '(.+)' times$/ do |to_match, which, count| end seen_count.should == count.to_i end - |