knife 17.0.244 → 17.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -5
- data/Rakefile +1 -6
- data/knife.gemspec +5 -5
- data/lib/chef/knife/ssl_fetch.rb +1 -1
- data/lib/chef/knife/version.rb +1 -1
- data/spec/data/apt/chef-integration-test-1.0/debian/changelog +5 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/compat +1 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/control +13 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/copyright +34 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/files +1 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/rules +13 -0
- data/spec/data/apt/chef-integration-test-1.0/debian/source/format +1 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/changelog +11 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/compat +1 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/control +13 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/copyright +34 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/files +1 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/rules +13 -0
- data/spec/data/apt/chef-integration-test-1.1/debian/source/format +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/changelog +5 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/conffiles +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/control +10 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/md5sums +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.debhelper.log +45 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.substvars +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/compat +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/conffiles +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/control +13 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +34 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/files +1 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/rules +13 -0
- data/spec/data/apt/chef-integration-test2-1.0/debian/source/format +1 -0
- data/spec/data/apt/chef-integration-test2_1.0-1.debian.tar.gz +0 -0
- data/spec/data/apt/chef-integration-test2_1.0-1.dsc +18 -0
- data/spec/data/apt/chef-integration-test2_1.0-1_amd64.build +91 -0
- data/spec/data/apt/chef-integration-test2_1.0-1_amd64.changes +31 -0
- data/spec/data/apt/chef-integration-test2_1.0-1_amd64.deb +0 -0
- data/spec/data/apt/chef-integration-test2_1.0.orig.tar.gz +0 -0
- data/spec/data/apt/chef-integration-test_1.0-1_amd64.changes +22 -0
- data/spec/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
- data/spec/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
- data/spec/data/apt/chef-integration-test_1.1-1_amd64.changes +22 -0
- data/spec/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
- data/spec/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
- data/spec/data/apt/var/www/apt/conf/distributions +7 -0
- data/spec/data/apt/var/www/apt/conf/incoming +4 -0
- data/spec/data/apt/var/www/apt/conf/pulls +3 -0
- data/spec/data/apt/var/www/apt/db/checksums.db +0 -0
- data/spec/data/apt/var/www/apt/db/contents.cache.db +0 -0
- data/spec/data/apt/var/www/apt/db/packages.db +0 -0
- data/spec/data/apt/var/www/apt/db/references.db +0 -0
- data/spec/data/apt/var/www/apt/db/release.caches.db +0 -0
- data/spec/data/apt/var/www/apt/db/version +4 -0
- data/spec/data/apt/var/www/apt/dists/sid/Release +19 -0
- data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +16 -0
- data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
- data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +5 -0
- data/spec/data/apt/var/www/apt/dists/sid/main/binary-i386/Packages +0 -0
- data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
- data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
- data/spec/data/bad-config.rb +1 -0
- data/spec/data/bootstrap/encrypted_data_bag_secret +1 -0
- data/spec/data/bootstrap/no_proxy.erb +2 -0
- data/spec/data/bootstrap/secret.erb +9 -0
- data/spec/data/bootstrap/test-hints.erb +12 -0
- data/spec/data/bootstrap/test.erb +1 -0
- data/spec/data/cb_version_cookbooks/cookbook2/files/test.txt +0 -0
- data/spec/data/cb_version_cookbooks/cookbook2/templates/test.erb +0 -0
- data/spec/data/cb_version_cookbooks/tatft/README.rdoc +3 -0
- data/spec/data/cb_version_cookbooks/tatft/attributes/default.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/definitions/runit_service.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/files/default/giant_blob.tgz +1 -0
- data/spec/data/cb_version_cookbooks/tatft/libraries/ownage.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/providers/lwp.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/recipes/default.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/resources/lwr.rb +1 -0
- data/spec/data/cb_version_cookbooks/tatft/templates/default/configuration.erb +0 -0
- data/spec/data/checksum/random.txt +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-600hhz-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-6m8zdk-0 +0 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ahd2gq-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-api8ux-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-b0r1m1-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-bfygsi-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-el14l6-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ivrl3y-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-kkbs85-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ory1ux-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-pgsq76-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ra8uim-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t7k1g-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t8g0sv-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ufy6g3-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-x2d6j9-0 +1 -0
- data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-xi0l6h-0 +1 -0
- data/spec/data/client.d_00/00-foo.rb +2 -0
- data/spec/data/client.d_00/01-bar.rb +1 -0
- data/spec/data/client.d_00/02-strings.rb +2 -0
- data/spec/data/client.d_00/bar +1 -0
- data/spec/data/client.d_01/foo/bar.rb +1 -0
- data/spec/data/client.d_02/foo.rb/foo.txt +1 -0
- data/spec/data/config.rb +6 -0
- data/spec/data/cookbooks/angrybash/metadata.rb +2 -0
- data/spec/data/cookbooks/angrybash/recipes/default.rb +8 -0
- data/spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +2 -0
- data/spec/data/cookbooks/apache2/metadata.json +33 -0
- data/spec/data/cookbooks/apache2/metadata.rb +2 -0
- data/spec/data/cookbooks/apache2/recipes/default.rb +3 -0
- data/spec/data/cookbooks/borken/metadata.rb +2 -0
- data/spec/data/cookbooks/borken/recipes/default.rb +2 -0
- data/spec/data/cookbooks/borken/templates/default/borken.erb +2 -0
- data/spec/data/cookbooks/chefignore +8 -0
- data/spec/data/cookbooks/ignorken/files/default/not_me.rb +2 -0
- data/spec/data/cookbooks/ignorken/metadata.rb +2 -0
- data/spec/data/cookbooks/ignorken/recipes/default.rb +1 -0
- data/spec/data/cookbooks/ignorken/recipes/ignoreme.rb +2 -0
- data/spec/data/cookbooks/ignorken/templates/ubuntu-12.10/not_me.rb +2 -0
- data/spec/data/cookbooks/irssi/files/default/irssi.response +2 -0
- data/spec/data/cookbooks/java/files/default/java.response +2 -0
- data/spec/data/cookbooks/java/metadata.json +33 -0
- data/spec/data/cookbooks/java/metadata.rb +2 -0
- data/spec/data/cookbooks/name-mismatch-versionnumber/README.md +4 -0
- data/spec/data/cookbooks/name-mismatch-versionnumber/metadata.rb +8 -0
- data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +8 -0
- data/spec/data/cookbooks/openldap/.root_dotfile +0 -0
- data/spec/data/cookbooks/openldap/attributes/default.rb +16 -0
- data/spec/data/cookbooks/openldap/attributes/smokey.rb +1 -0
- data/spec/data/cookbooks/openldap/definitions/client.rb +5 -0
- data/spec/data/cookbooks/openldap/definitions/server.rb +5 -0
- data/spec/data/cookbooks/openldap/files/default/.dotfile +1 -0
- data/spec/data/cookbooks/openldap/files/default/.ssh/id_rsa +1 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/.a_dotdir/.a_dotfile_in_a_dotdir +1 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/not_a_template.erb +2 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file1.txt +3 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt +3 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/.a_dotfile +1 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt +3 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt +3 -0
- data/spec/data/cookbooks/openldap/files/default/remotedir/subdir_with_no_file_just_a_subsubdir/the_subsubdir/some_file.txt +3 -0
- data/spec/data/cookbooks/openldap/libraries/openldap/version.rb +3 -0
- data/spec/data/cookbooks/openldap/libraries/openldap.rb +4 -0
- data/spec/data/cookbooks/openldap/metadata.rb +8 -0
- data/spec/data/cookbooks/openldap/recipes/default.rb +4 -0
- data/spec/data/cookbooks/openldap/recipes/gigantor.rb +3 -0
- data/spec/data/cookbooks/openldap/recipes/one.rb +15 -0
- data/spec/data/cookbooks/openldap/recipes/return.rb +2 -0
- data/spec/data/cookbooks/openldap/spec/spec_helper.rb +0 -0
- data/spec/data/cookbooks/openldap/templates/default/all_windows_line_endings.erb +4 -0
- data/spec/data/cookbooks/openldap/templates/default/helper_test.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/helpers.erb +14 -0
- data/spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/nested_openldap_partials.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/nested_partial.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/no_windows_line_endings.erb +4 -0
- data/spec/data/cookbooks/openldap/templates/default/openldap_nested_variable_stuff.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/openldap_stuff.conf.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/openldap_variable_stuff.conf.erb +1 -0
- data/spec/data/cookbooks/openldap/templates/default/some_windows_line_endings.erb +4 -0
- data/spec/data/cookbooks/openldap/templates/default/test.erb +1 -0
- data/spec/data/cookbooks/preseed/files/default/preseed-file.seed +1 -0
- data/spec/data/cookbooks/preseed/files/default/preseed-template.seed +4 -0
- data/spec/data/cookbooks/preseed/metadata.rb +2 -0
- data/spec/data/cookbooks/preseed/templates/default/preseed-template-variables.seed +1 -0
- data/spec/data/cookbooks/preseed/templates/default/preseed-template.seed +1 -0
- data/spec/data/cookbooks/starter/chefignore +8 -0
- data/spec/data/cookbooks/starter/files/sample.txt +1 -0
- data/spec/data/cookbooks/starter/metadata.rb +2 -0
- data/spec/data/cookbooks/starter/recipes/default.rb +4 -0
- data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
- data/spec/data/cookbooks/wget/files/default/wget.response +2 -0
- data/spec/data/definitions/test.rb +5 -0
- data/spec/data/dsc_lcm.pfx +0 -0
- data/spec/data/environment-config.rb +5 -0
- data/spec/data/file-providers-method-snapshot-chef-11-4.json +127 -0
- data/spec/data/fileedit/blank +0 -0
- data/spec/data/fileedit/hosts +4 -0
- data/spec/data/gems/chef-integration-test-0.1.0.gem +0 -0
- data/spec/data/git_bundles/example-repo.gitbundle +0 -0
- data/spec/data/git_bundles/sinatra-test-app-with-callback-files.gitbundle +0 -0
- data/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle +0 -0
- data/spec/data/git_bundles/sinatra-test-app.gitbundle +0 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/README.md +4 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/metadata.rb +13 -0
- data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +8 -0
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/README.md +4 -0
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +9 -0
- data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +8 -0
- data/spec/data/kitchen/chefignore +6 -0
- data/spec/data/kitchen/openldap/attributes/default.rb +3 -0
- data/spec/data/kitchen/openldap/attributes/robinson.rb +3 -0
- data/spec/data/kitchen/openldap/definitions/client.rb +3 -0
- data/spec/data/kitchen/openldap/definitions/drewbarrymore.rb +3 -0
- data/spec/data/kitchen/openldap/recipes/gigantor.rb +3 -0
- data/spec/data/kitchen/openldap/recipes/ignoreme.rb +3 -0
- data/spec/data/kitchen/openldap/recipes/woot.rb +3 -0
- data/spec/data/knife-home/.chef/plugins/knife/example_home_subcommand.rb +0 -0
- data/spec/data/knife-site-subcommands/plugins/knife/example_subcommand.rb +0 -0
- data/spec/data/knife_subcommand/test_explicit_category.rb +7 -0
- data/spec/data/knife_subcommand/test_name_mapping.rb +4 -0
- data/spec/data/knife_subcommand/test_yourself.rb +21 -0
- data/spec/data/lwrp/providers/buck_passer.rb +28 -0
- data/spec/data/lwrp/providers/buck_passer_2.rb +26 -0
- data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +28 -0
- data/spec/data/lwrp/providers/inline_compiler.rb +24 -0
- data/spec/data/lwrp/providers/monkey_name_printer.rb +5 -0
- data/spec/data/lwrp/providers/paint_drying_watcher.rb +7 -0
- data/spec/data/lwrp/providers/thumb_twiddler.rb +7 -0
- data/spec/data/lwrp/resources/bar.rb +4 -0
- data/spec/data/lwrp/resources/buck_passer.rb +6 -0
- data/spec/data/lwrp/resources/buck_passer_2.rb +4 -0
- data/spec/data/lwrp/resources/embedded_resource_accesses_providers_scope.rb +4 -0
- data/spec/data/lwrp/resources/foo.rb +6 -0
- data/spec/data/lwrp/resources/inline_compiler.rb +4 -0
- data/spec/data/lwrp/resources/monkey_name_printer.rb +6 -0
- data/spec/data/lwrp/resources/paint_drying_watcher.rb +4 -0
- data/spec/data/lwrp/resources/thumb_twiddler.rb +4 -0
- data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +3 -0
- data/spec/data/lwrp_const_scoping/resources/conflict.rb +1 -0
- data/spec/data/lwrp_override/providers/buck_passer.rb +5 -0
- data/spec/data/lwrp_override/resources/foo.rb +11 -0
- data/spec/data/mac_users/10.9.plist.xml +560 -0
- data/spec/data/mac_users/10.9.shadow.xml +21 -0
- data/spec/data/metadata/quick_start/metadata.rb +14 -0
- data/spec/data/mixin/invalid_data.rb +3 -0
- data/spec/data/mixin/real_data.rb +2 -0
- data/spec/data/nested.json +2 -0
- data/spec/data/nodes/default.rb +15 -0
- data/spec/data/nodes/test.example.com.rb +17 -0
- data/spec/data/nodes/test.rb +15 -0
- data/spec/data/null_config.rb +1 -0
- data/spec/data/object_loader/environments/test.json +7 -0
- data/spec/data/object_loader/environments/test.rb +2 -0
- data/spec/data/object_loader/environments/test_json_class.json +8 -0
- data/spec/data/object_loader/nodes/test.json +7 -0
- data/spec/data/object_loader/nodes/test.rb +2 -0
- data/spec/data/object_loader/nodes/test_json_class.json +8 -0
- data/spec/data/object_loader/roles/test.json +7 -0
- data/spec/data/object_loader/roles/test.rb +2 -0
- data/spec/data/object_loader/roles/test_json_class.json +8 -0
- data/spec/data/old_home_dir/my-dot-emacs +0 -0
- data/spec/data/old_home_dir/my-dot-vim +0 -0
- data/spec/data/partial_one.erb +1 -0
- data/spec/data/prefer_metadata_json/metadata.json +51 -0
- data/spec/data/prefer_metadata_json/metadata.rb +6 -0
- data/spec/data/prefer_metadata_json/recipes/default.rb +0 -0
- data/spec/data/recipes/test.rb +7 -0
- data/spec/data/recipes.tgz +0 -0
- data/spec/data/remote_directory_data/remote_dir_file.txt +1 -0
- data/spec/data/remote_directory_data/remote_subdirectory/remote_subdir_file.txt +1 -0
- data/spec/data/remote_file/nyan_cat.png +0 -0
- data/spec/data/remote_file/nyan_cat.png.gz +0 -0
- data/spec/data/root_alias_cookbooks/dup_attr/attributes/default.rb +1 -0
- data/spec/data/root_alias_cookbooks/dup_attr/attributes.rb +1 -0
- data/spec/data/root_alias_cookbooks/dup_attr/metadata.rb +2 -0
- data/spec/data/root_alias_cookbooks/dup_attr/recipe.rb +3 -0
- data/spec/data/root_alias_cookbooks/dup_recipe/attributes.rb +1 -0
- data/spec/data/root_alias_cookbooks/dup_recipe/metadata.rb +2 -0
- data/spec/data/root_alias_cookbooks/dup_recipe/recipe.rb +3 -0
- data/spec/data/root_alias_cookbooks/dup_recipe/recipes/default.rb +3 -0
- data/spec/data/root_alias_cookbooks/simple/attributes.rb +1 -0
- data/spec/data/root_alias_cookbooks/simple/metadata.rb +2 -0
- data/spec/data/root_alias_cookbooks/simple/recipe.rb +3 -0
- data/spec/data/rubygems.org/latest_specs.4.8.gz +0 -0
- data/spec/data/rubygems.org/nonexistent_gem +0 -0
- data/spec/data/rubygems.org/nonexistent_gem-info +1 -0
- data/spec/data/rubygems.org/sexp_processor +0 -0
- data/spec/data/rubygems.org/sexp_processor-4.15.1.gemspec.rz +0 -0
- data/spec/data/rubygems.org/sexp_processor-info +49 -0
- data/spec/data/run_context/cookbooks/circular-dep1/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep1/definitions/circular_dep1_res.rb +1 -0
- data/spec/data/run_context/cookbooks/circular-dep1/libraries/lib.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep1/metadata.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep1/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/circular-dep1/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep2/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep2/definitions/circular_dep2_res.rb +1 -0
- data/spec/data/run_context/cookbooks/circular-dep2/libraries/lib.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep2/metadata.rb +2 -0
- data/spec/data/run_context/cookbooks/circular-dep2/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/circular-dep2/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/attributes/aa_first.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency1/attributes/zz_last.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/definitions/dependency1_res.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency1/libraries/lib.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency1/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency1/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file +1 -0
- data/spec/data/run_context/cookbooks/dependency2/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency2/definitions/dependency2_res.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency2/libraries/lib.rb +2 -0
- data/spec/data/run_context/cookbooks/dependency2/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/dependency2/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/include/recipes/default.rb +24 -0
- data/spec/data/run_context/cookbooks/include/recipes/includee.rb +3 -0
- data/spec/data/run_context/cookbooks/no-default-attr/attributes/server.rb +2 -0
- data/spec/data/run_context/cookbooks/no-default-attr/definitions/no_default-attr_res.rb +1 -0
- data/spec/data/run_context/cookbooks/no-default-attr/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/no-default-attr/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +2 -0
- data/spec/data/run_context/cookbooks/test/attributes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/test/attributes/george.rb +1 -0
- data/spec/data/run_context/cookbooks/test/definitions/new_animals.rb +9 -0
- data/spec/data/run_context/cookbooks/test/definitions/new_cat.rb +5 -0
- data/spec/data/run_context/cookbooks/test/definitions/test_res.rb +1 -0
- data/spec/data/run_context/cookbooks/test/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/test/recipes/default.rb +5 -0
- data/spec/data/run_context/cookbooks/test/recipes/one.rb +7 -0
- data/spec/data/run_context/cookbooks/test/recipes/two.rb +7 -0
- data/spec/data/run_context/cookbooks/test/resources/resource.rb +3 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/definitions/test_with-circular-deps_res.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/libraries/lib.rb +2 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/metadata.rb +2 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +3 -0
- data/spec/data/run_context/cookbooks/test-with-deps/attributes/default.rb +2 -0
- data/spec/data/run_context/cookbooks/test-with-deps/definitions/test_with-deps_res.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-deps/libraries/lib.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-deps/metadata.rb +3 -0
- data/spec/data/run_context/cookbooks/test-with-deps/providers/provider.rb +1 -0
- data/spec/data/run_context/cookbooks/test-with-deps/recipes/default.rb +0 -0
- data/spec/data/run_context/cookbooks/test-with-deps/recipes/server.rb +0 -0
- data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +2 -0
- data/spec/data/run_context/nodes/run_context.rb +5 -0
- data/spec/data/sample_msu1.xml +10 -0
- data/spec/data/sample_msu2.xml +14 -0
- data/spec/data/sample_msu3.xml +16 -0
- data/spec/data/search_queries_to_transform.txt +98 -0
- data/spec/data/shef-config.rb +11 -0
- data/spec/data/snap_package/async_result_success.json +6 -0
- data/spec/data/snap_package/change_id_result.json +175 -0
- data/spec/data/snap_package/find_result_failure.json +10 -0
- data/spec/data/snap_package/find_result_success.json +70 -0
- data/spec/data/snap_package/get_by_name_result_failure.json +10 -0
- data/spec/data/snap_package/get_by_name_result_success.json +38 -0
- data/spec/data/snap_package/get_conf_success.json +10 -0
- data/spec/data/snap_package/result_failure.json +9 -0
- data/spec/data/ssl/5e707473.0 +18 -0
- data/spec/data/ssl/binary/chef-rspec-der.cert +0 -0
- data/spec/data/ssl/binary/chef-rspec-der.key +0 -0
- data/spec/data/ssl/chef-rspec.cert +27 -0
- data/spec/data/ssl/chef-rspec.key +27 -0
- data/spec/data/ssl/key.pem +15 -0
- data/spec/data/ssl/private_key.pem +27 -0
- data/spec/data/ssl/private_key_with_whitespace.pem +32 -0
- data/spec/data/standalone_cookbook/Gemfile +1 -0
- data/spec/data/standalone_cookbook/chefignore +9 -0
- data/spec/data/standalone_cookbook/recipes/default.rb +3 -0
- data/spec/data/standalone_cookbook/vendor/bundle/ruby/2.0.0/gems/multi_json-1.9.0/lib/multi_json.rb +1 -0
- data/spec/data/templates/chef-seattle20160930-4388-1crv7ef.txt +1 -0
- data/spec/data/templates/chef-seattle20160930-4388-jjfoae.txt +1 -0
- data/spec/data/templates/chef-seattle20160930-4388-umeq2c.txt +1 -0
- data/spec/data/templates/failed.erb +5 -0
- data/spec/data/templates/seattle.txt +1 -0
- data/spec/data/trusted_certs/example.crt +22 -0
- data/spec/data/trusted_certs/example_no_cn.crt +36 -0
- data/spec/data/trusted_certs/intermediate.pem +27 -0
- data/spec/data/trusted_certs/opscode.pem +57 -0
- data/spec/data/trusted_certs/root.pem +22 -0
- data/spec/data/windows_certificates/base64_test.cer +20 -0
- data/spec/data/windows_certificates/othertest.cer +20 -0
- data/spec/data/windows_certificates/test.cer +20 -0
- data/spec/data/windows_certificates/test.p7b +0 -0
- data/spec/data/windows_certificates/test.pem +20 -0
- data/spec/data/windows_certificates/test.pfx +0 -0
- data/spec/functional/configure_spec.rb +33 -0
- data/spec/functional/cookbook_delete_spec.rb +156 -0
- data/spec/functional/exec_spec.rb +55 -0
- data/spec/functional/rehash_spec.rb +39 -0
- data/spec/functional/smoke_test.rb +42 -0
- data/spec/functional/ssh_spec.rb +352 -0
- data/spec/functional/version_spec.rb +26 -0
- data/spec/integration/chef_fs_data_store_spec.rb +557 -0
- data/spec/integration/chef_repo_path_spec.rb +962 -0
- data/spec/integration/chef_repository_file_system_spec.rb +200 -0
- data/spec/integration/chefignore_spec.rb +301 -0
- data/spec/integration/client_bulk_delete_spec.rb +131 -0
- data/spec/integration/client_create_spec.rb +70 -0
- data/spec/integration/client_delete_spec.rb +64 -0
- data/spec/integration/client_key_create_spec.rb +66 -0
- data/spec/integration/client_key_delete_spec.rb +43 -0
- data/spec/integration/client_key_list_spec.rb +61 -0
- data/spec/integration/client_key_show_spec.rb +45 -0
- data/spec/integration/client_list_spec.rb +49 -0
- data/spec/integration/client_show_spec.rb +37 -0
- data/spec/integration/common_options_spec.rb +174 -0
- data/spec/integration/config_list_spec.rb +220 -0
- data/spec/integration/config_show_spec.rb +192 -0
- data/spec/integration/config_use_spec.rb +198 -0
- data/spec/integration/cookbook_api_ipv6_spec.rb +113 -0
- data/spec/integration/cookbook_bulk_delete_spec.rb +65 -0
- data/spec/integration/cookbook_download_spec.rb +72 -0
- data/spec/integration/cookbook_list_spec.rb +55 -0
- data/spec/integration/cookbook_show_spec.rb +149 -0
- data/spec/integration/cookbook_upload_spec.rb +128 -0
- data/spec/integration/data_bag_create_spec.rb +125 -0
- data/spec/integration/data_bag_delete_spec.rb +59 -0
- data/spec/integration/data_bag_edit_spec.rb +105 -0
- data/spec/integration/data_bag_from_file_spec.rb +116 -0
- data/spec/integration/data_bag_list_spec.rb +44 -0
- data/spec/integration/data_bag_show_spec.rb +95 -0
- data/spec/integration/delete_spec.rb +1018 -0
- data/spec/integration/deps_spec.rb +703 -0
- data/spec/integration/diff_spec.rb +605 -0
- data/spec/integration/download_spec.rb +1336 -0
- data/spec/integration/environment_compare_spec.rb +75 -0
- data/spec/integration/environment_create_spec.rb +41 -0
- data/spec/integration/environment_delete_spec.rb +37 -0
- data/spec/integration/environment_from_file_spec.rb +116 -0
- data/spec/integration/environment_list_spec.rb +42 -0
- data/spec/integration/environment_show_spec.rb +77 -0
- data/spec/integration/list_spec.rb +1060 -0
- data/spec/integration/node_bulk_delete_spec.rb +52 -0
- data/spec/integration/node_create_spec.rb +47 -0
- data/spec/integration/node_delete_spec.rb +48 -0
- data/spec/integration/node_environment_set_spec.rb +46 -0
- data/spec/integration/node_from_file_spec.rb +59 -0
- data/spec/integration/node_list_spec.rb +45 -0
- data/spec/integration/node_run_list_add_spec.rb +54 -0
- data/spec/integration/node_run_list_remove_spec.rb +36 -0
- data/spec/integration/node_run_list_set_spec.rb +41 -0
- data/spec/integration/node_show_spec.rb +36 -0
- data/spec/integration/raw_spec.rb +297 -0
- data/spec/integration/redirection_spec.rb +64 -0
- data/spec/integration/role_bulk_delete_spec.rb +52 -0
- data/spec/integration/role_create_spec.rb +41 -0
- data/spec/integration/role_delete_spec.rb +48 -0
- data/spec/integration/role_from_file_spec.rb +96 -0
- data/spec/integration/role_list_spec.rb +45 -0
- data/spec/integration/role_show_spec.rb +51 -0
- data/spec/integration/search_node_spec.rb +40 -0
- data/spec/integration/serve_spec.rb +92 -0
- data/spec/integration/show_spec.rb +197 -0
- data/spec/integration/upload_spec.rb +1617 -0
- data/spec/knife_spec_helper.rb +241 -0
- data/spec/support/chef_helpers.rb +79 -0
- data/spec/support/key_helpers.rb +102 -0
- data/spec/support/platform_helpers.rb +251 -0
- data/spec/support/platforms/prof/gc.rb +51 -0
- data/spec/support/platforms/prof/win32.rb +45 -0
- data/spec/support/platforms/win32/spec_service.rb +57 -0
- data/spec/support/recipe_dsl_helper.rb +83 -0
- data/spec/support/shared/context/config.rb +18 -0
- data/spec/support/shared/functional/knife.rb +37 -0
- data/spec/support/shared/integration/integration_helper.rb +122 -0
- data/spec/support/shared/integration/knife_support.rb +192 -0
- data/spec/support/shared/matchers/exit_with_code.rb +32 -0
- data/spec/support/shared/matchers/match_environment_variable.rb +17 -0
- data/spec/support/shared/unit/knife_shared.rb +39 -0
- data/spec/support/shared/unit/mock_shellout.rb +49 -0
- data/spec/tiny_server.rb +190 -0
- data/spec/unit/application/knife_spec.rb +241 -0
- data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +152 -0
- data/spec/unit/knife/bootstrap/client_builder_spec.rb +207 -0
- data/spec/unit/knife/bootstrap/train_connector_spec.rb +244 -0
- data/spec/unit/knife/bootstrap_spec.rb +2220 -0
- data/spec/unit/knife/client_bulk_delete_spec.rb +166 -0
- data/spec/unit/knife/client_create_spec.rb +169 -0
- data/spec/unit/knife/client_delete_spec.rb +99 -0
- data/spec/unit/knife/client_edit_spec.rb +53 -0
- data/spec/unit/knife/client_list_spec.rb +34 -0
- data/spec/unit/knife/client_reregister_spec.rb +62 -0
- data/spec/unit/knife/client_show_spec.rb +52 -0
- data/spec/unit/knife/configure_client_spec.rb +81 -0
- data/spec/unit/knife/configure_spec.rb +190 -0
- data/spec/unit/knife/cookbook_bulk_delete_spec.rb +87 -0
- data/spec/unit/knife/cookbook_delete_spec.rb +239 -0
- data/spec/unit/knife/cookbook_download_spec.rb +255 -0
- data/spec/unit/knife/cookbook_list_spec.rb +88 -0
- data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +72 -0
- data/spec/unit/knife/cookbook_metadata_spec.rb +182 -0
- data/spec/unit/knife/cookbook_show_spec.rb +253 -0
- data/spec/unit/knife/cookbook_upload_spec.rb +364 -0
- data/spec/unit/knife/core/bootstrap_context_spec.rb +287 -0
- data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +187 -0
- data/spec/unit/knife/core/cookbook_site_streaming_uploader_spec.rb +198 -0
- data/spec/unit/knife/core/gem_glob_loader_spec.rb +242 -0
- data/spec/unit/knife/core/hashed_command_loader_spec.rb +112 -0
- data/spec/unit/knife/core/node_editor_spec.rb +211 -0
- data/spec/unit/knife/core/object_loader_spec.rb +81 -0
- data/spec/unit/knife/core/status_presenter_spec.rb +54 -0
- data/spec/unit/knife/core/subcommand_loader_spec.rb +64 -0
- data/spec/unit/knife/core/ui_spec.rb +656 -0
- data/spec/unit/knife/core/windows_bootstrap_context_spec.rb +238 -0
- data/spec/unit/knife/data_bag_create_spec.rb +175 -0
- data/spec/unit/knife/data_bag_edit_spec.rb +126 -0
- data/spec/unit/knife/data_bag_from_file_spec.rb +174 -0
- data/spec/unit/knife/data_bag_secret_options_spec.rb +173 -0
- data/spec/unit/knife/data_bag_show_spec.rb +139 -0
- data/spec/unit/knife/environment_compare_spec.rb +112 -0
- data/spec/unit/knife/environment_create_spec.rb +91 -0
- data/spec/unit/knife/environment_delete_spec.rb +71 -0
- data/spec/unit/knife/environment_edit_spec.rb +79 -0
- data/spec/unit/knife/environment_from_file_spec.rb +90 -0
- data/spec/unit/knife/environment_list_spec.rb +54 -0
- data/spec/unit/knife/environment_show_spec.rb +52 -0
- data/spec/unit/knife/key_create_spec.rb +223 -0
- data/spec/unit/knife/key_delete_spec.rb +133 -0
- data/spec/unit/knife/key_edit_spec.rb +264 -0
- data/spec/unit/knife/key_helper.rb +74 -0
- data/spec/unit/knife/key_list_spec.rb +216 -0
- data/spec/unit/knife/key_show_spec.rb +126 -0
- data/spec/unit/knife/node_bulk_delete_spec.rb +94 -0
- data/spec/unit/knife/node_delete_spec.rb +77 -0
- data/spec/unit/knife/node_edit_spec.rb +116 -0
- data/spec/unit/knife/node_environment_set_spec.rb +61 -0
- data/spec/unit/knife/node_from_file_spec.rb +59 -0
- data/spec/unit/knife/node_list_spec.rb +62 -0
- data/spec/unit/knife/node_policy_set_spec.rb +122 -0
- data/spec/unit/knife/node_run_list_add_spec.rb +145 -0
- data/spec/unit/knife/node_run_list_remove_spec.rb +106 -0
- data/spec/unit/knife/node_run_list_set_spec.rb +115 -0
- data/spec/unit/knife/node_show_spec.rb +65 -0
- data/spec/unit/knife/org_create_spec.rb +76 -0
- data/spec/unit/knife/org_delete_spec.rb +41 -0
- data/spec/unit/knife/org_edit_spec.rb +49 -0
- data/spec/unit/knife/org_list_spec.rb +58 -0
- data/spec/unit/knife/org_show_spec.rb +45 -0
- data/spec/unit/knife/org_user_add_spec.rb +39 -0
- data/spec/unit/knife/raw_spec.rb +43 -0
- data/spec/unit/knife/role_bulk_delete_spec.rb +80 -0
- data/spec/unit/knife/role_create_spec.rb +80 -0
- data/spec/unit/knife/role_delete_spec.rb +67 -0
- data/spec/unit/knife/role_edit_spec.rb +77 -0
- data/spec/unit/knife/role_env_run_list_add_spec.rb +217 -0
- data/spec/unit/knife/role_env_run_list_clear_spec.rb +94 -0
- data/spec/unit/knife/role_env_run_list_remove_spec.rb +102 -0
- data/spec/unit/knife/role_env_run_list_replace_spec.rb +105 -0
- data/spec/unit/knife/role_env_run_list_set_spec.rb +99 -0
- data/spec/unit/knife/role_from_file_spec.rb +69 -0
- data/spec/unit/knife/role_list_spec.rb +54 -0
- data/spec/unit/knife/role_run_list_add_spec.rb +179 -0
- data/spec/unit/knife/role_run_list_clear_spec.rb +84 -0
- data/spec/unit/knife/role_run_list_remove_spec.rb +92 -0
- data/spec/unit/knife/role_run_list_replace_spec.rb +98 -0
- data/spec/unit/knife/role_run_list_set_spec.rb +89 -0
- data/spec/unit/knife/role_show_spec.rb +59 -0
- data/spec/unit/knife/ssh_spec.rb +403 -0
- data/spec/unit/knife/ssl_check_spec.rb +256 -0
- data/spec/unit/knife/ssl_fetch_spec.rb +222 -0
- data/spec/unit/knife/status_spec.rb +112 -0
- data/spec/unit/knife/supermarket_download_spec.rb +152 -0
- data/spec/unit/knife/supermarket_install_spec.rb +203 -0
- data/spec/unit/knife/supermarket_list_spec.rb +70 -0
- data/spec/unit/knife/supermarket_search_spec.rb +85 -0
- data/spec/unit/knife/supermarket_share_spec.rb +208 -0
- data/spec/unit/knife/supermarket_unshare_spec.rb +78 -0
- data/spec/unit/knife/tag_create_spec.rb +23 -0
- data/spec/unit/knife/tag_delete_spec.rb +25 -0
- data/spec/unit/knife/tag_list_spec.rb +23 -0
- data/spec/unit/knife/user_create_spec.rb +256 -0
- data/spec/unit/knife/user_delete_spec.rb +171 -0
- data/spec/unit/knife/user_edit_spec.rb +54 -0
- data/spec/unit/knife/user_list_spec.rb +73 -0
- data/spec/unit/knife/user_password_spec.rb +64 -0
- data/spec/unit/knife/user_reregister_spec.rb +56 -0
- data/spec/unit/knife/user_show_spec.rb +91 -0
- data/spec/unit/knife_spec.rb +634 -0
- metadata +580 -22
@@ -0,0 +1,70 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
require "openssl"
|
21
|
+
|
22
|
+
describe "knife client create", :workstation do
|
23
|
+
include IntegrationSupport
|
24
|
+
include KnifeSupport
|
25
|
+
|
26
|
+
include_context "default config options"
|
27
|
+
|
28
|
+
let(:out) { "Created client[bah]\n" }
|
29
|
+
|
30
|
+
when_the_chef_server "is empty" do
|
31
|
+
it "creates a new client" do
|
32
|
+
knife("client create -k bah").should_succeed stderr: out
|
33
|
+
end
|
34
|
+
|
35
|
+
it "creates a new validator client" do
|
36
|
+
knife("client create -k --validator bah").should_succeed stderr: out
|
37
|
+
knife("client show bah").should_succeed <<~EOM
|
38
|
+
admin: false
|
39
|
+
chef_type: client
|
40
|
+
name: bah
|
41
|
+
validator: true
|
42
|
+
EOM
|
43
|
+
end
|
44
|
+
|
45
|
+
it "refuses to add an existing client" do
|
46
|
+
pending "Knife client create must not blindly overwrite an existing client"
|
47
|
+
knife("client create -k bah").should_succeed stderr: out
|
48
|
+
expect { knife("client create -k bah") }.to raise_error(Net::HTTPClientException)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "saves the private key to a file" do
|
52
|
+
Dir.mktmpdir do |tgt|
|
53
|
+
knife("client create -f #{tgt}/bah.pem bah").should_succeed stderr: out
|
54
|
+
expect(File).to exist("#{tgt}/bah.pem")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
it "reads the public key from a file" do
|
59
|
+
Dir.mktmpdir do |tgt|
|
60
|
+
key = OpenSSL::PKey::RSA.generate(1024)
|
61
|
+
File.open("#{tgt}/public.pem", "w") { |pub| pub.write(key.public_key.to_pem) }
|
62
|
+
knife("client create -p #{tgt}/public.pem bah").should_succeed stderr: out
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
it "refuses to run if conflicting options are passed" do
|
67
|
+
knife("client create -p public.pem --prevent-keygen blah").should_fail stderr: "FATAL: You cannot pass --public-key and --prevent-keygen\n", stdout: /^USAGE.*/
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
|
21
|
+
describe "knife client delete", :workstation do
|
22
|
+
include IntegrationSupport
|
23
|
+
include KnifeSupport
|
24
|
+
|
25
|
+
include_context "default config options"
|
26
|
+
|
27
|
+
when_the_chef_server "has some clients" do
|
28
|
+
before do
|
29
|
+
client "cons", {}
|
30
|
+
client "car", {}
|
31
|
+
client "car-validator", { validator: true }
|
32
|
+
client "cdr", {}
|
33
|
+
client "cat", {}
|
34
|
+
end
|
35
|
+
|
36
|
+
it "deletes a client" do
|
37
|
+
knife("client delete car", input: "Y").should_succeed <<~EOM
|
38
|
+
Do you really want to delete car? (Y/N) Deleted client[car]
|
39
|
+
EOM
|
40
|
+
|
41
|
+
knife("client list").should_succeed <<~EOM
|
42
|
+
car-validator
|
43
|
+
cat
|
44
|
+
cdr
|
45
|
+
chef-validator
|
46
|
+
chef-webui
|
47
|
+
cons
|
48
|
+
EOM
|
49
|
+
end
|
50
|
+
|
51
|
+
it "refuses to delete a validator normally" do
|
52
|
+
knife("client delete car-validator", input: "Y").should_fail exit_code: 2, stdout: "Do you really want to delete car-validator? (Y/N) ", stderr: <<~EOM
|
53
|
+
FATAL: You must specify --delete-validators to delete the validator client car-validator
|
54
|
+
EOM
|
55
|
+
end
|
56
|
+
|
57
|
+
it "deletes a validator correctly" do
|
58
|
+
knife("client delete car-validator -D", input: "Y").should_succeed <<~EOM
|
59
|
+
Do you really want to delete car-validator? (Y/N) Deleted client[car-validator]
|
60
|
+
EOM
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
require "openssl"
|
21
|
+
|
22
|
+
describe "knife client key create", :workstation do
|
23
|
+
include IntegrationSupport
|
24
|
+
include KnifeSupport
|
25
|
+
|
26
|
+
include_context "default config options"
|
27
|
+
|
28
|
+
let(:out) { "Created key: new" }
|
29
|
+
|
30
|
+
when_the_chef_server "has a client" do
|
31
|
+
before do
|
32
|
+
client "bah", {}
|
33
|
+
end
|
34
|
+
|
35
|
+
it "creates a new client key" do
|
36
|
+
knife("client key create -k new bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
|
37
|
+
end
|
38
|
+
|
39
|
+
it "creates a new client key with an expiration date" do
|
40
|
+
date = "2017-12-31T23:59:59Z"
|
41
|
+
knife("client key create -k new -e #{date} bah").should_succeed stderr: /^#{out}/, stdout: /.*BEGIN RSA PRIVATE KEY/
|
42
|
+
knife("client key show bah new").should_succeed(/expiration_date:.*#{date}/)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "refuses to add an already existing key" do
|
46
|
+
knife("client key create -k new bah")
|
47
|
+
expect { knife("client key create -k new bah") }.to raise_error(Net::HTTPClientException)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "saves the private key to a file" do
|
51
|
+
Dir.mktmpdir do |tgt|
|
52
|
+
knife("client key create -f #{tgt}/bah.pem -k new bah").should_succeed stderr: /^#{out}/
|
53
|
+
expect(File).to exist("#{tgt}/bah.pem")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "reads the public key from a file" do
|
58
|
+
Dir.mktmpdir do |tgt|
|
59
|
+
key = OpenSSL::PKey::RSA.generate(1024)
|
60
|
+
File.open("#{tgt}/public.pem", "w") { |pub| pub.write(key.public_key.to_pem) }
|
61
|
+
knife("client key create -p #{tgt}/public.pem -k new bah").should_succeed stderr: /^#{out}/
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
|
21
|
+
describe "knife client key delete", :workstation do
|
22
|
+
include IntegrationSupport
|
23
|
+
include KnifeSupport
|
24
|
+
|
25
|
+
include_context "default config options"
|
26
|
+
|
27
|
+
when_the_chef_server "has a client" do
|
28
|
+
before do
|
29
|
+
client "car", {}
|
30
|
+
end
|
31
|
+
|
32
|
+
it "deletes a client" do
|
33
|
+
out = "Do you really want to delete the key named new for the client named car? (Y/N) "
|
34
|
+
knife("client key create -k new car")
|
35
|
+
knife("client key delete car new", input: "Y").should_succeed stdout: out, stderr: <<~EOM
|
36
|
+
Deleted key named new for the client named car
|
37
|
+
EOM
|
38
|
+
|
39
|
+
knife("client key list car").should_succeed ""
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
require "date"
|
21
|
+
|
22
|
+
describe "knife client key list", :workstation do
|
23
|
+
include IntegrationSupport
|
24
|
+
include KnifeSupport
|
25
|
+
|
26
|
+
include_context "default config options"
|
27
|
+
|
28
|
+
let(:now) { DateTime.now }
|
29
|
+
let(:last_month) { (now << 1).strftime("%FT%TZ") }
|
30
|
+
let(:next_month) { (now >> 1).strftime("%FT%TZ") }
|
31
|
+
|
32
|
+
when_the_chef_server "has a client" do
|
33
|
+
before do
|
34
|
+
client "cons", {}
|
35
|
+
knife("client key create cons -k new")
|
36
|
+
knife("client key create cons -k next_month -e #{next_month}")
|
37
|
+
knife("client key create cons -k expired -e #{last_month}")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "lists the keys for a client" do
|
41
|
+
knife("client key list cons").should_succeed "expired\nnew\nnext_month\n"
|
42
|
+
end
|
43
|
+
|
44
|
+
it "shows detailed output" do
|
45
|
+
knife("client key list -w cons").should_succeed <<~EOM
|
46
|
+
expired: http://127.0.0.1:8900/clients/cons/keys/expired (expired)
|
47
|
+
new: http://127.0.0.1:8900/clients/cons/keys/new
|
48
|
+
next_month: http://127.0.0.1:8900/clients/cons/keys/next_month
|
49
|
+
EOM
|
50
|
+
end
|
51
|
+
|
52
|
+
it "lists the expired keys for a client" do
|
53
|
+
knife("client key list -e cons").should_succeed "expired\n"
|
54
|
+
end
|
55
|
+
|
56
|
+
it "lists the unexpired keys for a client" do
|
57
|
+
knife("client key list -n cons").should_succeed "new\nnext_month\n"
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
require "date"
|
21
|
+
|
22
|
+
describe "knife client key show", :workstation do
|
23
|
+
include IntegrationSupport
|
24
|
+
include KnifeSupport
|
25
|
+
|
26
|
+
include_context "default config options"
|
27
|
+
|
28
|
+
let(:now) { DateTime.now }
|
29
|
+
let(:last_month) { (now << 1).strftime("%FT%TZ") }
|
30
|
+
let(:next_month) { (now >> 1).strftime("%FT%TZ") }
|
31
|
+
|
32
|
+
when_the_chef_server "has a client" do
|
33
|
+
before do
|
34
|
+
client "cons", {}
|
35
|
+
knife("client key create cons -k new")
|
36
|
+
knife("client key create cons -k next_month -e #{next_month}")
|
37
|
+
knife("client key create cons -k expired -e #{last_month}")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "shows a key for a client" do
|
41
|
+
knife("client key show cons new").should_succeed stdout: /.*name:.*new/
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
|
21
|
+
describe "knife client list", :workstation do
|
22
|
+
include IntegrationSupport
|
23
|
+
include KnifeSupport
|
24
|
+
|
25
|
+
include_context "default config options"
|
26
|
+
|
27
|
+
when_the_chef_server "has some clients" do
|
28
|
+
before do
|
29
|
+
client "cons", {}
|
30
|
+
client "car", {}
|
31
|
+
client "car-validator", { validator: true }
|
32
|
+
client "cdr", {}
|
33
|
+
client "cat", {}
|
34
|
+
end
|
35
|
+
|
36
|
+
it "lists the clients" do
|
37
|
+
knife("client list").should_succeed <<~EOM
|
38
|
+
car
|
39
|
+
car-validator
|
40
|
+
cat
|
41
|
+
cdr
|
42
|
+
chef-validator
|
43
|
+
chef-webui
|
44
|
+
cons
|
45
|
+
EOM
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require "knife_spec_helper"
|
18
|
+
require "support/shared/integration/integration_helper"
|
19
|
+
require "support/shared/context/config"
|
20
|
+
|
21
|
+
describe "knife client show", :workstation do
|
22
|
+
include IntegrationSupport
|
23
|
+
include KnifeSupport
|
24
|
+
|
25
|
+
include_context "default config options"
|
26
|
+
|
27
|
+
when_the_chef_server "has a client" do
|
28
|
+
before do
|
29
|
+
client "cons", {}
|
30
|
+
end
|
31
|
+
|
32
|
+
it "shows a client" do
|
33
|
+
knife("client show cons").should_succeed stdout: /.*name:.*cons/
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,174 @@
|
|
1
|
+
#
|
2
|
+
# Author:: John Keiser (<jkeiser@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
18
|
+
require "knife_spec_helper"
|
19
|
+
require "support/shared/integration/integration_helper"
|
20
|
+
require "chef/knife/raw"
|
21
|
+
|
22
|
+
describe "knife common options", :workstation do
|
23
|
+
include IntegrationSupport
|
24
|
+
include KnifeSupport
|
25
|
+
|
26
|
+
before do
|
27
|
+
# Allow this for testing the various port binding stuffs. Remove when
|
28
|
+
# we kill off --listen.
|
29
|
+
Chef::Config.treat_deprecation_warnings_as_errors(false)
|
30
|
+
end
|
31
|
+
|
32
|
+
let(:local_listen_warning) { /\Awarn:.*local.*listen.*$/im }
|
33
|
+
|
34
|
+
when_the_repository "has a node" do
|
35
|
+
before { file "nodes/x.json", {} }
|
36
|
+
|
37
|
+
context "When chef_zero.enabled is true" do
|
38
|
+
before(:each) do
|
39
|
+
Chef::Config.chef_zero.enabled = true
|
40
|
+
end
|
41
|
+
|
42
|
+
it "knife raw /nodes/x should retrieve the node in socketless mode" do
|
43
|
+
Chef::Config.treat_deprecation_warnings_as_errors(true)
|
44
|
+
knife("raw /nodes/x").should_succeed( /"name": "x"/ )
|
45
|
+
end
|
46
|
+
|
47
|
+
it "knife raw /nodes/x should retrieve the node" do
|
48
|
+
knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
49
|
+
end
|
50
|
+
|
51
|
+
context "And chef_zero.port is 9999" do
|
52
|
+
before(:each) { Chef::Config.chef_zero.port = 9999 }
|
53
|
+
|
54
|
+
it "knife raw /nodes/x should retrieve the node" do
|
55
|
+
knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
56
|
+
expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# 0.0.0.0 is not a valid address to bind to on windows.
|
61
|
+
context "And chef_zero.host is 0.0.0.0", :unix_only do
|
62
|
+
before(:each) { Chef::Config.chef_zero.host = "0.0.0.0" }
|
63
|
+
|
64
|
+
it "knife raw /nodes/x should retrieve the role" do
|
65
|
+
knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "and there is a private key" do
|
70
|
+
before do
|
71
|
+
file "mykey.pem", <<~EOM
|
72
|
+
-----BEGIN RSA PRIVATE KEY-----
|
73
|
+
MIIEogIBAAKCAQEApubutqtYYQ5UiA9QhWP7UvSmsfHsAoPKEVVPdVW/e8Svwpyf
|
74
|
+
0Xef6OFWVmBE+W442ZjLOe2y6p2nSnaq4y7dg99NFz6X+16mcKiCbj0RCiGqCvCk
|
75
|
+
NftHhTgO9/RFvCbmKZ1RKNob1YzLrFpxBHaSh9po+DGWhApcd+I+op+ZzvDgXhNn
|
76
|
+
0nauZu3rZmApI/r7EEAOjFedAXs7VPNXhhtZAiLSAVIrwU3ZajtSzgXOxbNzgj5O
|
77
|
+
AAAMmThK+71qPdffAdO4J198H6/MY04qgtFo7vumzCq0UCaGZfmeI1UNE4+xQWwP
|
78
|
+
HJ3pDAP61C6Ebx2snI2kAd9QMx9Y78nIedRHPwIDAQABAoIBAHssRtPM1GacWsom
|
79
|
+
8zfeN6ZbI4KDlbetZz0vhnqDk9NVrpijWlcOP5dwZXVNitnB/HaqCqFvyPDY9JNB
|
80
|
+
zI/pEFW4QH59FVDP42mVEt0keCTP/1wfiDDGh1vLqVBYl/ZphscDcNgDTzNkuxMx
|
81
|
+
k+LFVxKnn3w7rGc59lALSkpeGvbbIDjp3LUMlUeCF8CIFyYZh9ZvXe4OCxYdyjxb
|
82
|
+
i8tnMLKvJ4Psbh5jMapsu3rHQkfPdqzztQUz8vs0NYwP5vWge46FUyk+WNm/IhbJ
|
83
|
+
G3YM22nwUS8Eu2bmTtADSJolATbCSkOwQ1D+Fybz/4obfYeGaCdOqB05ttubhenV
|
84
|
+
ShsAb7ECgYEA20ecRVxw2S7qA7sqJ4NuYOg9TpfGooptYNA1IP971eB6SaGAelEL
|
85
|
+
awYkGNuu2URmm5ElZpwJFFTDLGA7t2zB2xI1FeySPPIVPvJGSiZoFQOVlIg9WQzK
|
86
|
+
7jTtFQ/tOMrF+bigEUJh5bP1/7HzqSpuOsPjEUb2aoCTp+tpiRGL7TUCgYEAwtns
|
87
|
+
g3ysrSEcTzpSv7fQRJRk1lkBhatgNd0oc+ikzf74DaVLhBg1jvSThDhiDCdB59mr
|
88
|
+
Jh41cnR1XqE8jmdQbCDRiFrI1Pq6TPaDZFcovDVE1gue9x86v3FOH2ukPG4d2/Xy
|
89
|
+
HevXjThtpMMsWFi0JYXuzXuV5HOvLZiP8sN3lSMCgYANpdxdGM7RRbE9ADY0dWK2
|
90
|
+
V14ReTLcxP7fyrWz0xLzEeCqmomzkz3BsIUoouu0DCTSw+rvAwExqcDoDylIVlWO
|
91
|
+
fAifz7SeZHbcDxo+3TsXK7zwnLYsx7YNs2+aIv6hzUUbMNmNmXMcZ+IEwx+mRMTN
|
92
|
+
lYmZdrA5mr0V83oDFPt/jQKBgC74RVE03pMlZiObFZNtheDiPKSG9Bz6wMh7NWMr
|
93
|
+
c37MtZLkg52mEFMTlfPLe6ceV37CM8WOhqe+dwSGrYhOU06dYqUR7VOZ1Qr0aZvo
|
94
|
+
fsNPu/Y0+u7rMkgv0fs1AXQnvz7kvKaF0YITVirfeXMafuKEtJoH7owRbur42cpV
|
95
|
+
YCAtAoGAP1rHOc+w0RUcBK3sY7aErrih0OPh9U5bvJsrw1C0FIZhCEoDVA+fNIQL
|
96
|
+
syHLXYFNy0OxMtH/bBAXBGNHd9gf5uOnqh0pYcbe/uRAxumC7Rl0cL509eURiA2T
|
97
|
+
+vFmf54y9YdnLXaqv+FhJT6B6V7WX7IpU9BMqJY1cJYXHuHG2KA=
|
98
|
+
-----END RSA PRIVATE KEY-----
|
99
|
+
EOM
|
100
|
+
end
|
101
|
+
|
102
|
+
it "knife raw /nodes/x should retrieve the node" do
|
103
|
+
knife("raw --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
it "knife raw -z /nodes/x retrieves the node in socketless mode" do
|
109
|
+
Chef::Config.treat_deprecation_warnings_as_errors(true)
|
110
|
+
knife("raw -z /nodes/x").should_succeed( /"name": "x"/ )
|
111
|
+
end
|
112
|
+
|
113
|
+
it "knife raw -z /nodes/x retrieves the node" do
|
114
|
+
knife("raw -z --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
115
|
+
end
|
116
|
+
|
117
|
+
it "knife raw --local-mode /nodes/x retrieves the node" do
|
118
|
+
knife("raw --local-mode --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
119
|
+
end
|
120
|
+
|
121
|
+
it "knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node" do
|
122
|
+
knife("raw -z --chef-zero-port=9999 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
123
|
+
expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
|
124
|
+
end
|
125
|
+
|
126
|
+
context "when the default port (8889) is already bound" do
|
127
|
+
before :each do
|
128
|
+
|
129
|
+
@server = ChefZero::Server.new(host: "localhost", port: 8889)
|
130
|
+
@server.start_background
|
131
|
+
rescue Errno::EADDRINUSE
|
132
|
+
# OK. Don't care who has it in use, as long as *someone* does.
|
133
|
+
|
134
|
+
end
|
135
|
+
after :each do
|
136
|
+
@server.stop if @server
|
137
|
+
end
|
138
|
+
|
139
|
+
it "knife raw -z /nodes/x retrieves the node" do
|
140
|
+
knife("raw -z --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
141
|
+
expect(URI(Chef::Config.chef_server_url).port).to be > 8889
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context "when port 9999 is already bound" do
|
146
|
+
before :each do
|
147
|
+
|
148
|
+
@server = ChefZero::Server.new(host: "localhost", port: 9999)
|
149
|
+
@server.start_background
|
150
|
+
rescue Errno::EADDRINUSE
|
151
|
+
# OK. Don't care who has it in use, as long as *someone* does.
|
152
|
+
|
153
|
+
end
|
154
|
+
after :each do
|
155
|
+
@server.stop if @server
|
156
|
+
end
|
157
|
+
|
158
|
+
it "knife raw -z --chef-zero-port=9999-20000 /nodes/x" do
|
159
|
+
knife("raw -z --chef-zero-port=9999-20000 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
160
|
+
expect(URI(Chef::Config.chef_server_url).port).to be > 9999
|
161
|
+
end
|
162
|
+
|
163
|
+
it "knife raw -z --chef-zero-port=9999-9999,19423" do
|
164
|
+
knife("raw -z --chef-zero-port=9999-9999,19423 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
165
|
+
expect(URI(Chef::Config.chef_server_url).port).to be == 19423
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
it "knife raw -z --chef-zero-port=9999 /nodes/x retrieves the node" do
|
170
|
+
knife("raw -z --chef-zero-port=9999 --listen /nodes/x").should_succeed( /"name": "x"/, stderr: local_listen_warning )
|
171
|
+
expect(Chef::Config.chef_server_url).to eq("chefzero://localhost:9999")
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|