diff options
author | Thom May <thom@may.lt> | 2018-02-14 09:07:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 09:07:39 +0000 |
commit | b89bbe9fced92791da5cd647490bb31d55ac49df (patch) | |
tree | 0ec735196540da74e7516f13d504f0a40a748fd3 /spec/integration | |
parent | c01afe14ed1411017ee10c0133d8176e36256e28 (diff) | |
parent | 29748ede0cd6fa3799a2f8c4912f037a31f1eeea (diff) | |
download | chef-b89bbe9fced92791da5cd647490bb31d55ac49df.tar.gz |
Merge pull request #6471 from dimsh99/fix_for_4816
Fix to use cookbook name in local mode or chef-zero
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/knife/chef_fs_data_store_spec.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb index 02508b799d..ff674082b7 100644 --- a/spec/integration/knife/chef_fs_data_store_spec.rb +++ b/spec/integration/knife/chef_fs_data_store_spec.rb @@ -28,6 +28,7 @@ describe "ChefFSDataStore tests", :workstation do let(:cookbook_x_100_metadata_rb) { cb_metadata("x", "1.0.0") } let(:cookbook_z_100_metadata_rb) { cb_metadata("z", "1.0.0") } + let(:cookbook_y_102_metadata_rb) { cb_metadata("z", "1.0.2") } describe "with repo mode 'hosted_everything' (default)" do before do @@ -39,6 +40,8 @@ describe "ChefFSDataStore tests", :workstation do file "clients/x.json", {} file "cookbook_artifacts/x-111/metadata.rb", cookbook_x_100_metadata_rb file "cookbooks/x/metadata.rb", cookbook_x_100_metadata_rb + file "cookbooks/y/metadata.rb", cookbook_y_102_metadata_rb + file "cookbooks/z/metadata.rb", cookbook_z_100_metadata_rb file "data_bags/x/y.json", {} file "environments/x.json", {} file "nodes/x.json", {} @@ -64,6 +67,7 @@ describe "ChefFSDataStore tests", :workstation do /acls/cookbook_artifacts/x.json /acls/cookbooks/ /acls/cookbooks/x.json +/acls/cookbooks/z.json /acls/data_bags/ /acls/data_bags/x.json /acls/environments/ @@ -84,11 +88,13 @@ describe "ChefFSDataStore tests", :workstation do /containers/ /containers/x.json /cookbook_artifacts/ -/cookbook_artifacts/x-111/ -/cookbook_artifacts/x-111/metadata.rb +/cookbook_artifacts/x-1.0.0/ +/cookbook_artifacts/x-1.0.0/metadata.rb /cookbooks/ /cookbooks/x/ /cookbooks/x/metadata.rb +/cookbooks/z/ +/cookbooks/z/metadata.rb /data_bags/ /data_bags/x/ /data_bags/x/y.json @@ -111,6 +117,12 @@ EOM end end + context "LIST /TYPE/NAME" do + it "knife cookbook show -z z" do + knife("cookbook show -z z").should_succeed "z 1.0.2 1.0.0\n" + end + end + context "DELETE /TYPE/NAME" do it "knife delete -z /clients/x.json works" do knife("delete -z /clients/x.json").should_succeed "Deleted /clients/x.json\n" @@ -119,7 +131,7 @@ EOM it "knife delete -z -r /cookbooks/x works" do knife("delete -z -r /cookbooks/x").should_succeed "Deleted /cookbooks/x\n" - knife("list -z -Rfp /cookbooks").should_succeed "" + knife("list -z -Rfp /cookbooks").should_succeed "/cookbooks/z/\n/cookbooks/z/metadata.rb\n" end it "knife delete -z -r /data_bags/x works" do @@ -194,7 +206,14 @@ EOM Uploading x [1.0.0] Uploaded 1 cookbook. EOM - knife("list --local -Rfp /cookbooks").should_succeed "/cookbooks/x/\n/cookbooks/x/metadata.rb\n" + knife("list --local -Rfp /cookbooks").should_succeed <<EOM +/cookbooks/x/ +/cookbooks/x/metadata.rb +/cookbooks/y/ +/cookbooks/y/metadata.rb +/cookbooks/z/ +/cookbooks/z/metadata.rb +EOM end it "knife raw -z -i empty.json -m PUT /data/x/y" do |