vagrant-unbundled 2.1.4.0 → 2.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -1
- data/Gemfile.lock +9 -5
- data/contrib/bash/completion.sh +16 -2
- data/contrib/sudoers/osx +1 -1
- data/lib/vagrant/environment.rb +16 -21
- data/lib/vagrant/errors.rb +28 -0
- data/lib/vagrant/machine.rb +1 -1
- data/lib/vagrant/plugin/manager.rb +35 -1
- data/lib/vagrant/plugin/v2/trigger.rb +23 -0
- data/lib/vagrant/util/curl_helper.rb +96 -0
- data/lib/vagrant/util/downloader.rb +2 -79
- data/lib/vagrant/util/guest_inspection.rb +18 -5
- data/lib/vagrant/util/platform.rb +33 -8
- data/lib/vagrant/util/uploader.rb +103 -0
- data/lib/vagrant/vagrantfile.rb +5 -1
- data/lib/vagrant.rb +39 -13
- data/plugins/commands/cloud/auth/login.rb +90 -0
- data/plugins/commands/cloud/auth/logout.rb +42 -0
- data/plugins/commands/cloud/auth/plugin.rb +20 -0
- data/plugins/commands/cloud/auth/root.rb +73 -0
- data/plugins/commands/cloud/auth/whoami.rb +62 -0
- data/plugins/commands/cloud/box/create.rb +75 -0
- data/plugins/commands/cloud/box/delete.rb +65 -0
- data/plugins/commands/cloud/box/plugin.rb +19 -0
- data/plugins/commands/cloud/box/root.rb +77 -0
- data/plugins/commands/cloud/box/show.rb +74 -0
- data/plugins/commands/cloud/box/update.rb +71 -0
- data/plugins/commands/cloud/client/client.rb +264 -0
- data/plugins/commands/cloud/errors.rb +28 -0
- data/plugins/commands/cloud/list.rb +52 -0
- data/plugins/commands/cloud/locales/en.yml +159 -0
- data/plugins/commands/cloud/plugin.rb +30 -0
- data/plugins/commands/cloud/provider/create.rb +73 -0
- data/plugins/commands/cloud/provider/delete.rb +70 -0
- data/plugins/commands/cloud/provider/plugin.rb +19 -0
- data/plugins/commands/cloud/provider/root.rb +77 -0
- data/plugins/commands/cloud/provider/update.rb +73 -0
- data/plugins/commands/cloud/provider/upload.rb +75 -0
- data/plugins/commands/cloud/publish.rb +165 -0
- data/plugins/commands/cloud/root.rb +104 -0
- data/plugins/commands/cloud/search.rb +83 -0
- data/plugins/commands/cloud/util.rb +206 -0
- data/plugins/commands/cloud/version/create.rb +69 -0
- data/plugins/commands/cloud/version/delete.rb +68 -0
- data/plugins/commands/cloud/version/plugin.rb +19 -0
- data/plugins/commands/cloud/version/release.rb +69 -0
- data/plugins/commands/cloud/version/revoke.rb +69 -0
- data/plugins/commands/cloud/version/root.rb +81 -0
- data/plugins/commands/cloud/version/update.rb +69 -0
- data/plugins/commands/init/command.rb +1 -1
- data/plugins/commands/login/plugin.rb +4 -3
- data/plugins/commands/powershell/command.rb +3 -0
- data/plugins/commands/powershell/plugin.rb +1 -0
- data/plugins/commands/upload/command.rb +236 -0
- data/plugins/commands/upload/plugin.rb +17 -0
- data/plugins/commands/winrm/command.rb +69 -0
- data/plugins/commands/winrm/plugin.rb +17 -0
- data/plugins/commands/winrm_config/command.rb +125 -0
- data/plugins/commands/winrm_config/plugin.rb +17 -0
- data/plugins/guests/bsd/cap/file_system.rb +77 -0
- data/plugins/guests/bsd/plugin.rb +15 -0
- data/plugins/guests/linux/cap/file_system.rb +79 -0
- data/plugins/guests/linux/cap/network_interfaces.rb +13 -2
- data/plugins/guests/linux/plugin.rb +15 -0
- data/plugins/guests/redhat/cap/change_host_name.rb +21 -13
- data/plugins/guests/solaris/cap/file_system.rb +77 -0
- data/plugins/guests/solaris/plugin.rb +15 -0
- data/plugins/guests/windows/cap/file_system.rb +65 -0
- data/plugins/guests/windows/cap/mount_shared_folder.rb +1 -1
- data/plugins/guests/windows/plugin.rb +10 -0
- data/plugins/kernel_v2/config/vm.rb +3 -0
- data/plugins/kernel_v2/config/vm_trigger.rb +49 -1
- data/plugins/providers/docker/action/build.rb +23 -8
- data/plugins/providers/docker/action/is_build.rb +1 -1
- data/plugins/providers/docker/config.rb +50 -10
- data/plugins/providers/hyperv/scripts/configure_vm.ps1 +16 -2
- data/plugins/providers/virtualbox/action/match_mac_address.rb +8 -5
- data/plugins/providers/virtualbox/driver/version_5_0.rb +1 -0
- data/plugins/provisioners/ansible/provisioner/guest.rb +2 -8
- data/plugins/provisioners/puppet/provisioner/puppet.rb +4 -2
- data/plugins/provisioners/salt/bootstrap-salt.sh +1 -1
- data/plugins/provisioners/salt/provisioner.rb +19 -4
- data/plugins/synced_folders/rsync/helper.rb +2 -1
- data/templates/commands/ssh_config/config.erb +1 -1
- data/templates/commands/winrm_config/config.erb +11 -0
- data/templates/guests/openbsd/network_static6.erb +1 -0
- data/templates/locales/en.yml +60 -1
- data/templates/locales/providers_docker.yml +11 -3
- data/vagrant.gemspec +3 -1
- data/vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-spec-94a9d31ba18b/vagrant-spec.gemspec +1 -1
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/LICENSE +22 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/README.md +67 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/bin/vagrant_cloud +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/account.rb +190 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/box.rb +185 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/client.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/errors.rb +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/provider.rb +149 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/version.rb +188 -0
- data/vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.gitignore +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.rubocop.yml +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/.travis.yml +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Gemfile +2 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/LICENSE +202 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/README.md +276 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Rakefile +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/Vagrantfile +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/WinrmAppveyor.psm1 +32 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/appveyor.yml +50 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/bin/rwinrm +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/changelog.md +133 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/connection.rb +84 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/connection_opts.rb +90 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/exceptions.rb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/response_handler.rb +127 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/transport.rb +462 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/http/transport_factory.rb +64 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/output.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/create_pipeline.xml.erb +167 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/fragment.rb +68 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/init_runspace_pool.xml.erb +224 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/base.rb +47 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/error_record.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_output.rb +48 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/pipeline_state.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/runspacepool_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/runspacepool_state.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data/session_capability.rb +34 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_data.rb +40 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_defragmenter.rb +62 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_factory.rb +74 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/message_fragmenter.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/powershell_output_decoder.rb +142 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/receive_response_reader.rb +95 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/session_capability.xml.erb +7 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/psrp/uuid.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/base.rb +187 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/cmd.rb +63 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/power_shell.rb +207 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/retryable.rb +44 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/shells/shell_factory.rb +56 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/version.rb +5 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/base.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/cleanup_command.rb +60 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/close_shell.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command.rb +100 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command_output.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/command_output_decoder.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/configuration.rb +44 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/create_pipeline.rb +64 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/create_shell.rb +115 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/header.rb +213 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/init_runspace_pool.rb +96 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/iso8601_duration.rb +58 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/keep_alive.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/receive_response_reader.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/send_data.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/soap.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/wql_pull.rb +54 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/wql_query.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm/wsmv/write_stdin.rb +86 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/lib/winrm.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/preamble +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/auth_timeout_spec.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/cmd_spec.rb +130 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/config-example.yml +16 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/issue_59_spec.rb +25 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/powershell_spec.rb +164 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/spec_helper.rb +62 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/transport_spec.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/integration/wql_spec.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/matchers.rb +59 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/configuration_spec.rb +183 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/connection_spec.rb +37 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/exception_spec.rb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/http/transport_factory_spec.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/http/transport_spec.rb +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/output_spec.rb +128 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/fragment_spec.rb +60 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/base_spec.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/error_record_spec.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_host_call_spec.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_output_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/pipeline_state_spec.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/runspace_pool_host_call_spec.rb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/runspacepool_state_spec.rb +14 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data/session_capability_spec.rb +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_data_spec.rb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_defragmenter_spec.rb +45 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/message_fragmenter_spec.rb +103 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/powershell_output_decoder_spec.rb +98 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/psrp_message_spec.rb +73 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/recieve_response_reader_spec.rb +170 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/psrp/uuid_spec.rb +28 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/response_handler_spec.rb +69 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/base_spec.rb +227 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/cmd_spec.rb +75 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/shells/powershell_spec.rb +221 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/spec_helper.rb +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/clixml/error_record.xml.erb +84 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/clixml/pipeline_state.xml.erb +88 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_command_output_response.xml.erb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_command_output_response_not_done.xml.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_command_output_response.xml.erb +23 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_command_output_response_not_done.xml.erb +24 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_config_response.xml +45 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_omi_powershell_keepalive_response.xml.erb +33 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_keepalive_response.xml.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_output_response.xml.erb +12 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/get_powershell_output_response_not_done.xml.erb +9 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_omi.xml +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_v1.xml +19 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/open_shell_v2.xml +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_omi.xml +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_v1.xml +36 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/soap_fault_v2.xml +42 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/stubs/responses/wmi_error_v2.xml +41 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/cleanup_command_spec.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/close_shell_spec.rb +15 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_output_decoder_spec.rb +35 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_output_spec.rb +43 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/command_spec.rb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/configuration_spec.rb +15 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/create_pipeline_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/create_shell_spec.rb +39 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/init_runspace_pool_spec.rb +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/keep_alive_spec.rb +21 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/receive_response_reader_spec.rb +124 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/send_data_spec.rb +30 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/wql_query_spec.rb +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/tests/spec/wsmv/write_stdin_spec.rb +20 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-2.3.0/winrm.gemspec +46 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.gitignore +11 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rspec +2 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rubocop.yml +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.rubocop_todo.yml +65 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/.travis.yml +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Gemfile +4 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/LICENSE +202 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/README.md +82 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Rakefile +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/VERSION +1 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/Vagrantfile +8 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/appveyor.yml +38 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/bin/rwinrmcp +85 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/changelog.md +74 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/core/file_transporter.rb +566 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/core/tmp_zip.rb +176 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/exceptions.rb +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/file_manager.rb +156 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/check_files.ps1.erb +49 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/checksum.ps1.erb +13 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/create_dir.ps1.erb +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/delete.ps1.erb +6 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/download.ps1.erb +17 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/exists.ps1.erb +10 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/extract_files.ps1.erb +52 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs/scripts/scripts.rb +31 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/lib/winrm-fs.rb +27 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/config-example.yml +3 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/integration/file_manager_spec.rb +303 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/integration/tmp_zip_spec.rb +26 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/matchers.rb +57 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/spec_helper.rb +66 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/spec/unit/tmp_zip_spec.rb +78 -0
- data/vendor/bundle/ruby/2.5.0/gems/winrm-fs-1.3.1/winrm-fs.gemspec +36 -0
- data/vendor/bundle/ruby/2.5.0/specifications/vagrant_cloud-2.0.1.gemspec +45 -0
- data/vendor/bundle/ruby/2.5.0/specifications/winrm-2.3.0.gemspec +73 -0
- data/vendor/bundle/ruby/2.5.0/specifications/winrm-fs-1.3.1.gemspec +57 -0
- data/version.txt +1 -1
- metadata +268 -4
@@ -0,0 +1,303 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
# rubocop:disable BlockLength
|
4
|
+
describe WinRM::FS::FileManager do
|
5
|
+
let(:upload_dir) { "winrm_#{rand(2**16)}" }
|
6
|
+
let(:dest_dir) { File.join(subject.temp_dir, upload_dir) }
|
7
|
+
let(:temp_upload_dir) { '$env:TEMP/winrm-upload' }
|
8
|
+
let(:spec_dir) { File.expand_path(File.dirname(File.dirname(__FILE__))) }
|
9
|
+
let(:this_file) { Pathname.new(__FILE__) }
|
10
|
+
let(:service) { winrm_connection }
|
11
|
+
|
12
|
+
subject { WinRM::FS::FileManager.new(service) }
|
13
|
+
|
14
|
+
before(:each) do
|
15
|
+
expect(subject.delete(dest_dir)).to be true
|
16
|
+
expect(subject.delete(temp_upload_dir)).to be true
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'exists?' do
|
20
|
+
it 'should exist' do
|
21
|
+
expect(subject.exists?('c:/windows')).to be true
|
22
|
+
expect(subject.exists?('c:/foobar')).to be false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'create and delete dir' do
|
27
|
+
it 'should create the directory recursively' do
|
28
|
+
subdir = File.join(dest_dir, 'subdir1', 'subdir2')
|
29
|
+
expect(subject.create_dir(subdir)).to be true
|
30
|
+
expect(subject.exists?(subdir)).to be true
|
31
|
+
expect(subject.create_dir(subdir)).to be true
|
32
|
+
expect(subject.delete(subdir)).to be true
|
33
|
+
expect(subject.exists?(subdir)).to be false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'temp_dir' do
|
38
|
+
it 'should return the remote users temp dir' do
|
39
|
+
expect(subject.temp_dir).to match(%r{C:/Users/\S+/AppData/Local/Temp})
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'download file' do
|
44
|
+
let(:download_dir) { File.join(spec_dir, 'temp') }
|
45
|
+
let(:dest_file) { Pathname.new(File.join(dest_dir, File.basename(this_file))) }
|
46
|
+
let(:download_file) { Pathname.new(File.join(download_dir, File.basename(this_file))) }
|
47
|
+
|
48
|
+
before(:each) do
|
49
|
+
expect(subject.delete(dest_dir)).to be true
|
50
|
+
FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
|
51
|
+
FileUtils.mkdir_p(download_dir)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should download the specified file' do
|
55
|
+
subject.upload(this_file, dest_file)
|
56
|
+
subject.download(dest_file, download_file)
|
57
|
+
expect(File.open(download_file).read).to eq(File.open(this_file).read)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'download file chunked' do
|
62
|
+
let(:download_dir) { File.join(spec_dir, 'temp') }
|
63
|
+
let(:dest_file) { Pathname.new(File.join(dest_dir, File.basename(this_file))) }
|
64
|
+
let(:download_file) { Pathname.new(File.join(download_dir, File.basename(this_file))) }
|
65
|
+
|
66
|
+
before(:each) do
|
67
|
+
expect(subject.delete(dest_dir)).to be true
|
68
|
+
FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
|
69
|
+
FileUtils.mkdir_p(download_dir)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'should download the specified file in 1000 byte chunks' do
|
73
|
+
subject.upload(this_file, dest_file)
|
74
|
+
subject.download(dest_file, download_file, 1000)
|
75
|
+
expect(File.open(download_file).read).to eq(File.open(this_file).read)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context 'download directory' do
|
80
|
+
let(:download_dir) { File.join(spec_dir, 'temp') }
|
81
|
+
let(:dest_file) { Pathname.new(File.join(dest_dir, File.basename(this_file))) }
|
82
|
+
let(:root_dir) { File.expand_path('../../', File.dirname(__FILE__)) }
|
83
|
+
let(:winrm_fs_dir) { File.join(root_dir, 'lib/winrm-fs') }
|
84
|
+
|
85
|
+
before(:each) do
|
86
|
+
expect(subject.delete(dest_dir)).to be true
|
87
|
+
FileUtils.rm_rf(Dir.glob("#{download_dir}/*"))
|
88
|
+
FileUtils.mkdir_p(download_dir)
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'downloads the directory contents recursively' do
|
92
|
+
subject.upload(winrm_fs_dir, dest_dir)
|
93
|
+
subject.download(dest_dir, download_dir)
|
94
|
+
|
95
|
+
Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
|
96
|
+
host_file_rel = Pathname.new(host_file).relative_path_from(
|
97
|
+
Pathname.new(winrm_fs_dir)
|
98
|
+
).to_s
|
99
|
+
download_file = File.join(download_dir, upload_dir, host_file_rel)
|
100
|
+
expect(File.open(download_file).read).to eq(File.open(host_file).read)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'upload file' do
|
106
|
+
let(:dest_file) { Pathname.new(File.join(dest_dir, File.basename(this_file))) }
|
107
|
+
let(:from_memory) { StringIO.new('Upload From Memory') }
|
108
|
+
|
109
|
+
before(:each) do
|
110
|
+
expect(subject.delete(dest_dir)).to be true
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'should upload a single StringIO object to a remote file' do
|
114
|
+
subject.upload(from_memory, dest_file)
|
115
|
+
expect(subject).to have_created(dest_file).with_content(from_memory.string)
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'should error if multiple StringIO objects passed to upload' do
|
119
|
+
expect { subject.upload([from_memory, from_memory], dest_file) }
|
120
|
+
.to raise_error(WinRM::FS::Core::UploadSourceError)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'should error if both a StringIO object and a file path passed to upload' do
|
124
|
+
expect { subject.upload([from_memory, this_file], dest_file) }
|
125
|
+
.to raise_error(WinRM::FS::Core::UploadSourceError)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'should upload the specified file' do
|
129
|
+
subject.upload(this_file, dest_file)
|
130
|
+
expect(subject).to have_created(dest_file).with_content(this_file)
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'should upload to root of the c: drive' do
|
134
|
+
subject.upload(this_file, 'c:/winrmtest.rb')
|
135
|
+
expect(subject).to have_created('c:/winrmtest.rb').with_content(this_file)
|
136
|
+
subject.delete('c:/winrmtest.rb')
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'should upload just filename' do
|
140
|
+
subject.upload(this_file, 'winrmtest.rb')
|
141
|
+
expect(subject).to have_created('winrmtest.rb').with_content(this_file)
|
142
|
+
subject.delete('winrmtest.rb')
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'should upload using relative file path' do
|
146
|
+
subject.upload('./spec/integration/file_manager_spec.rb', dest_file)
|
147
|
+
expect(subject).to have_created(dest_file).with_content(this_file)
|
148
|
+
end
|
149
|
+
|
150
|
+
it 'should upload to the specified directory' do
|
151
|
+
subject.create_dir(dest_dir)
|
152
|
+
subject.upload(this_file, dest_dir)
|
153
|
+
expect(subject).to have_created(dest_file).with_content(this_file)
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'should treat extensionless target as file if not an existing directory' do
|
157
|
+
subject.upload(this_file, dest_dir)
|
158
|
+
expect(subject).to have_created(dest_dir).with_content(this_file)
|
159
|
+
end
|
160
|
+
|
161
|
+
it 'should create extensionless source under target dir if target dir exists' do
|
162
|
+
subject.create_dir(dest_dir)
|
163
|
+
src_file = File.expand_path('../../Gemfile', File.dirname(__FILE__))
|
164
|
+
subject.upload(src_file, dest_dir)
|
165
|
+
expect(subject).to have_created(File.join(dest_dir, 'Gemfile')).with_content(src_file)
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'should upload to the specified directory with env var' do
|
169
|
+
subject.upload(this_file, '$env:Temp')
|
170
|
+
expected_dest_file = File.join(subject.temp_dir, File.basename(this_file))
|
171
|
+
expect(subject).to have_created(expected_dest_file).with_content(this_file)
|
172
|
+
end
|
173
|
+
|
174
|
+
it 'should upload to Program Files sub dir' do
|
175
|
+
subject.create_dir('$env:ProgramFiles/foo')
|
176
|
+
subject.upload(this_file, '$env:ProgramFiles/foo')
|
177
|
+
expect(subject).to have_created('c:/Program Files/foo/file_manager_spec.rb') \
|
178
|
+
.with_content(this_file)
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'should upload to the specified nested directory' do
|
182
|
+
dest_sub_dir = File.join(dest_dir, 'subdir')
|
183
|
+
subject.create_dir(dest_sub_dir)
|
184
|
+
dest_sub_dir_file = File.join(dest_sub_dir, File.basename(this_file))
|
185
|
+
subject.upload(this_file, dest_sub_dir)
|
186
|
+
expect(subject).to have_created(dest_sub_dir_file).with_content(this_file)
|
187
|
+
end
|
188
|
+
|
189
|
+
it 'yields progress data' do
|
190
|
+
block_called = false
|
191
|
+
total_bytes_copied = 0
|
192
|
+
total = subject.upload(this_file, dest_file) do |bytes_copied, total_bytes, local_path, remote_path|
|
193
|
+
expect(total_bytes).to be > 0
|
194
|
+
total_bytes_copied = bytes_copied
|
195
|
+
expect(local_path).to eq(this_file.to_s)
|
196
|
+
expect(remote_path).to eq(dest_file.to_s)
|
197
|
+
block_called = true
|
198
|
+
end
|
199
|
+
expect(total_bytes_copied).to eq(total)
|
200
|
+
expect(block_called).to be true
|
201
|
+
expect(total).to be > 0
|
202
|
+
end
|
203
|
+
|
204
|
+
it 'should not upload when content matches' do
|
205
|
+
subject.upload(this_file, dest_dir)
|
206
|
+
bytes_uploaded = subject.upload(this_file, dest_dir)
|
207
|
+
expect(bytes_uploaded).to eq 0
|
208
|
+
end
|
209
|
+
|
210
|
+
it 'should upload when content differs' do
|
211
|
+
matchers_file = File.join(spec_dir, 'matchers.rb')
|
212
|
+
subject.upload(matchers_file, dest_file)
|
213
|
+
bytes_uploaded = subject.upload(this_file, dest_file)
|
214
|
+
expect(bytes_uploaded).to be > 0
|
215
|
+
end
|
216
|
+
|
217
|
+
it 'raises WinRMUploadError when a bad source path is specified' do
|
218
|
+
expect { subject.upload('c:/some/non-existant/path/foo', dest_file) }.to raise_error
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
context 'upload empty file' do
|
223
|
+
let(:empty_src_file) { Tempfile.new('empty') }
|
224
|
+
let(:dest_file) { File.join(dest_dir, 'emptyfile.txt') }
|
225
|
+
|
226
|
+
it 'creates a new empty file' do
|
227
|
+
expect(subject.upload(empty_src_file.path, dest_file)).to be 0
|
228
|
+
expect(subject).to have_created(dest_file).with_content('')
|
229
|
+
end
|
230
|
+
|
231
|
+
it 'overwrites an existing file' do
|
232
|
+
expect(subject.upload(this_file, dest_file)).to be > 0
|
233
|
+
expect(subject.upload(empty_src_file.path, dest_file)).to be 0
|
234
|
+
expect(subject).to have_created(dest_file).with_content('')
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
context 'upload directory' do
|
239
|
+
let(:root_dir) { File.expand_path('../../', File.dirname(__FILE__)) }
|
240
|
+
let(:winrm_fs_dir) { File.join(root_dir, 'lib/winrm-fs') }
|
241
|
+
let(:core_dir) { File.join(root_dir, 'lib/winrm-fs/core') }
|
242
|
+
let(:scripts_dir) { File.join(root_dir, 'lib/winrm-fs/scripts') }
|
243
|
+
|
244
|
+
it 'copies the directory contents recursively when directory does not exist' do
|
245
|
+
bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
|
246
|
+
expect(bytes_uploaded).to be > 0
|
247
|
+
|
248
|
+
Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
|
249
|
+
host_file_rel = Pathname.new(host_file).relative_path_from(
|
250
|
+
Pathname.new(winrm_fs_dir)
|
251
|
+
).to_s
|
252
|
+
remote_file = File.join(dest_dir, host_file_rel)
|
253
|
+
expect(subject).to have_created(remote_file).with_content(host_file)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
it 'copies the directory recursively when directory does exist' do
|
258
|
+
subject.create_dir(dest_dir)
|
259
|
+
bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
|
260
|
+
expect(bytes_uploaded).to be > 0
|
261
|
+
|
262
|
+
Dir.glob(winrm_fs_dir + '/**/*.rb').each do |host_file|
|
263
|
+
host_file_rel = Pathname.new(host_file).relative_path_from(
|
264
|
+
Pathname.new(winrm_fs_dir).dirname
|
265
|
+
).to_s
|
266
|
+
remote_file = File.join(dest_dir, host_file_rel)
|
267
|
+
expect(subject).to have_created(remote_file).with_content(host_file)
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
it 'does not copy the directory when content is the same' do
|
272
|
+
subject.upload(winrm_fs_dir, dest_dir)
|
273
|
+
bytes_uploaded = subject.upload(winrm_fs_dir, dest_dir)
|
274
|
+
expect(bytes_uploaded).to eq 0
|
275
|
+
end
|
276
|
+
|
277
|
+
it 'unzips the directory when cached content is the same' do
|
278
|
+
subject.upload(winrm_fs_dir, dest_dir)
|
279
|
+
subject.delete(dest_dir)
|
280
|
+
expect(subject.exists?(dest_dir)).to be false
|
281
|
+
subject.upload(winrm_fs_dir, dest_dir)
|
282
|
+
expect(subject.exists?(dest_dir)).to be true
|
283
|
+
end
|
284
|
+
|
285
|
+
it 'unzips multiple directories when cached content is the same for all' do
|
286
|
+
subject.create_dir(dest_dir)
|
287
|
+
subject.upload([core_dir, scripts_dir], dest_dir)
|
288
|
+
subject.delete(dest_dir)
|
289
|
+
expect(subject.exists?(dest_dir)).to be false
|
290
|
+
subject.create_dir(dest_dir)
|
291
|
+
subject.upload([core_dir, scripts_dir], dest_dir)
|
292
|
+
expect(subject.exists?(File.join(dest_dir, 'core'))).to be true
|
293
|
+
expect(subject.exists?(File.join(dest_dir, 'scripts'))).to be true
|
294
|
+
end
|
295
|
+
|
296
|
+
it 'copies the directory when content differs' do
|
297
|
+
subject.upload(winrm_fs_dir, dest_dir)
|
298
|
+
bytes_uploaded = subject.upload(core_dir, dest_dir)
|
299
|
+
expect(bytes_uploaded).to be > 0
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
303
|
+
# rubocop:enable BlockLength
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../../lib/winrm-fs/core/tmp_zip'
|
2
|
+
|
3
|
+
describe WinRM::FS::Core::TmpZip do
|
4
|
+
let(:winrm_fs_dir) { File.expand_path('../../lib/winrm-fs', File.dirname(__FILE__)) }
|
5
|
+
|
6
|
+
subject { WinRM::FS::Core::TmpZip.new(winrm_fs_dir) }
|
7
|
+
|
8
|
+
context 'temp file creation' do
|
9
|
+
it 'should create a temp file on disk' do
|
10
|
+
path = subject.path
|
11
|
+
expect(File.exist?(path)).to be true
|
12
|
+
subject.unlink
|
13
|
+
expect(File.exist?(path)).to be false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'create zip' do
|
18
|
+
it 'should add all files in directory to the zip recursively' do
|
19
|
+
expect(subject).to contain_zip_entries([
|
20
|
+
'exceptions.rb',
|
21
|
+
'core/tmp_zip.rb',
|
22
|
+
'scripts/checksum.ps1.erb'
|
23
|
+
])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rspec/expectations'
|
2
|
+
|
3
|
+
RSpec::Matchers.define :have_created do |remote_file|
|
4
|
+
match do |file_manager|
|
5
|
+
if @expected_content
|
6
|
+
downloaded_file = Tempfile.new('downloaded')
|
7
|
+
downloaded_file.close
|
8
|
+
|
9
|
+
subject.download(remote_file, downloaded_file.path)
|
10
|
+
@actual_content = File.read(downloaded_file.path)
|
11
|
+
downloaded_file.delete
|
12
|
+
|
13
|
+
file_manager.exists?(remote_file) && \
|
14
|
+
@actual_content == @expected_content
|
15
|
+
else
|
16
|
+
file_manager.exists?(remote_file)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
chain :with_content do |expected_content|
|
20
|
+
expected_content = File.read(expected_content) if File.file?(expected_content)
|
21
|
+
@expected_content = expected_content
|
22
|
+
end
|
23
|
+
failure_message do
|
24
|
+
if @expected_content
|
25
|
+
<<-EOH
|
26
|
+
Expected file '#{remote_file}' to exist with content:
|
27
|
+
|
28
|
+
#{@expected_content}
|
29
|
+
|
30
|
+
but instead got content:
|
31
|
+
|
32
|
+
#{@actual_content}
|
33
|
+
EOH
|
34
|
+
else
|
35
|
+
"Expected file '#{remote_file}' to exist"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
RSpec::Matchers.define :contain_zip_entries do |zip_entries|
|
41
|
+
match do |temp_zip_file|
|
42
|
+
zip_entries = [zip_entries] if zip_entries.is_a? String
|
43
|
+
@zip_file = Zip::File.open(temp_zip_file.path)
|
44
|
+
@missing_entries = []
|
45
|
+
zip_entries.each do |entry|
|
46
|
+
@missing_entries << entry unless @zip_file.find_entry(entry)
|
47
|
+
end
|
48
|
+
@missing_entries.empty?
|
49
|
+
end
|
50
|
+
failure_message do |temp_zip_file|
|
51
|
+
msg = "Expected #{temp_zip_file.path} to contain zip entries: #{@missing_entries}\n Got: "
|
52
|
+
@zip_file.each do |entry|
|
53
|
+
msg << entry.name << ', '
|
54
|
+
end
|
55
|
+
msg
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'winrm-fs'
|
4
|
+
require 'json'
|
5
|
+
require_relative 'matchers'
|
6
|
+
|
7
|
+
# Creates a WinRM connection for integration tests
|
8
|
+
module ConnectionHelper
|
9
|
+
def winrm_connection
|
10
|
+
WinRM::Connection.new(config)
|
11
|
+
end
|
12
|
+
|
13
|
+
def config
|
14
|
+
@config ||= begin
|
15
|
+
cfg = symbolize_keys(YAML.safe_load(File.read(winrm_config_path)))
|
16
|
+
cfg[:basic_auth_only] = true unless cfg[:transport].eql? :kerberos
|
17
|
+
merge_environment!(cfg)
|
18
|
+
cfg
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def merge_environment!(config)
|
23
|
+
merge_config_option_from_environment(config, 'user')
|
24
|
+
merge_config_option_from_environment(config, 'password')
|
25
|
+
merge_config_option_from_environment(config, 'no_ssl_peer_verification')
|
26
|
+
config[:options][:ssl_peer_fingerprint] = ENV['winrm_cert'] if ENV['use_ssl_peer_fingerprint']
|
27
|
+
config[:endpoint] = ENV['winrm_endpoint'] if ENV['winrm_endpoint']
|
28
|
+
config[:transport] = ENV['winrm_transport'] if ENV['winrm_transport']
|
29
|
+
end
|
30
|
+
|
31
|
+
def merge_config_option_from_environment(config, key)
|
32
|
+
env_key = 'winrm_' + key
|
33
|
+
config[key.to_sym] = ENV[env_key] if ENV[env_key]
|
34
|
+
end
|
35
|
+
|
36
|
+
def winrm_config_path
|
37
|
+
# Copy config-example.yml to config.yml and edit for your local configuration
|
38
|
+
path = File.expand_path("#{File.dirname(__FILE__)}/config.yml")
|
39
|
+
unless File.exist?(path)
|
40
|
+
# user hasn't done this, so use sane defaults for unit tests
|
41
|
+
path = File.expand_path("#{File.dirname(__FILE__)}/config-example.yml")
|
42
|
+
end
|
43
|
+
path
|
44
|
+
end
|
45
|
+
|
46
|
+
# rubocop:disable Metrics/MethodLength
|
47
|
+
def symbolize_keys(hash)
|
48
|
+
hash.each_with_object({}) do |(key, value), result|
|
49
|
+
new_key = case key
|
50
|
+
when String then key.to_sym
|
51
|
+
else key
|
52
|
+
end
|
53
|
+
new_value = case value
|
54
|
+
when Hash then symbolize_keys(value)
|
55
|
+
else value
|
56
|
+
end
|
57
|
+
result[new_key] = new_value
|
58
|
+
result
|
59
|
+
end
|
60
|
+
end
|
61
|
+
# rubocop:enable Metrics/MethodLength
|
62
|
+
end
|
63
|
+
|
64
|
+
RSpec.configure do |config|
|
65
|
+
config.include(ConnectionHelper)
|
66
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Fletcher (<fnichol@nichol.ca>)
|
3
|
+
#
|
4
|
+
# Copyright (C) 2015, Fletcher Nichol
|
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 'winrm-fs/core/tmp_zip'
|
19
|
+
|
20
|
+
describe WinRM::FS::Core::TmpZip do
|
21
|
+
let(:src_dir) do
|
22
|
+
tmpdir = Pathname.new(Dir.mktmpdir)
|
23
|
+
@tmpdirs << tmpdir
|
24
|
+
src_dir = tmpdir.join('src')
|
25
|
+
sub_dir = src_dir.join('veggies')
|
26
|
+
|
27
|
+
src_dir.mkpath
|
28
|
+
create_local_file(src_dir.join('apple.txt'), 'appleapple')
|
29
|
+
create_local_file(src_dir.join('banana.txt'), 'bananabanana')
|
30
|
+
create_local_file(src_dir.join('cherry.txt'), 'cherrycherry')
|
31
|
+
sub_dir.mkpath
|
32
|
+
create_local_file(sub_dir.join('carrot.txt'), 'carrotcarrot')
|
33
|
+
src_dir
|
34
|
+
end
|
35
|
+
|
36
|
+
let(:tmp_zip) { WinRM::FS::Core::TmpZip.new(src_dir) }
|
37
|
+
|
38
|
+
before { @tmpdirs = [] }
|
39
|
+
|
40
|
+
after do
|
41
|
+
@tmpdirs.each(&:rmtree)
|
42
|
+
tmp_zip.unlink if tmp_zip.path
|
43
|
+
end
|
44
|
+
|
45
|
+
it '#path returns path to created zip file' do
|
46
|
+
expect(tmp_zip.path.file?).to eq true
|
47
|
+
end
|
48
|
+
|
49
|
+
it '#unlink removes the file' do
|
50
|
+
path = tmp_zip.path
|
51
|
+
expect(path.file?).to eq true
|
52
|
+
|
53
|
+
tmp_zip.unlink
|
54
|
+
|
55
|
+
expect(path.file?).to eq false
|
56
|
+
expect(tmp_zip.path).to eq nil
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'for a zip file containing the base directory' do
|
60
|
+
let(:tmp_zip) { WinRM::FS::Core::TmpZip.new(src_dir) }
|
61
|
+
|
62
|
+
it 'contains the input entries' do
|
63
|
+
zip = Zip::File.new(tmp_zip.path)
|
64
|
+
|
65
|
+
expect(zip.map(&:name).sort).to eq(
|
66
|
+
['apple.txt', 'banana.txt', 'cherry.txt', 'veggies/carrot.txt']
|
67
|
+
)
|
68
|
+
expect(zip.read('apple.txt')).to eq 'appleapple'
|
69
|
+
expect(zip.read('banana.txt')).to eq 'bananabanana'
|
70
|
+
expect(zip.read('cherry.txt')).to eq 'cherrycherry'
|
71
|
+
expect(zip.read('veggies/carrot.txt')).to eq 'carrotcarrot'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def create_local_file(path, content)
|
76
|
+
path.open('wb') { |file| file.write(content) }
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
version = File.read(File.expand_path('VERSION', __dir__)).strip
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.name = 'winrm-fs'
|
8
|
+
s.version = version
|
9
|
+
s.date = Date.today.to_s
|
10
|
+
|
11
|
+
s.author = ['Shawn Neal', 'Matt Wrock']
|
12
|
+
s.email = ['sneal@sneal.net', 'matt@mattwrock.com']
|
13
|
+
s.homepage = 'http://github.com/WinRb/winrm-fs'
|
14
|
+
|
15
|
+
s.summary = 'WinRM File System'
|
16
|
+
s.description = <<-EOF
|
17
|
+
Ruby library for file system operations via Windows Remote Management
|
18
|
+
EOF
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split(/\n/)
|
21
|
+
s.require_path = 'lib'
|
22
|
+
s.rdoc_options = %w[-x test/ -x examples/]
|
23
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
24
|
+
|
25
|
+
s.bindir = 'bin'
|
26
|
+
s.executables = ['rwinrmcp']
|
27
|
+
s.required_ruby_version = '>= 2.2.0'
|
28
|
+
s.add_runtime_dependency 'erubis', '~> 2.7'
|
29
|
+
s.add_runtime_dependency 'logging', ['>= 1.6.1', '< 3.0']
|
30
|
+
s.add_runtime_dependency 'rubyzip', '~> 1.1'
|
31
|
+
s.add_runtime_dependency 'winrm', '~> 2.0'
|
32
|
+
s.add_development_dependency 'pry'
|
33
|
+
s.add_development_dependency 'rake', '~> 10.3'
|
34
|
+
s.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
s.add_development_dependency 'rubocop', '~> 0.51'
|
36
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# stub: vagrant_cloud 2.0.1 ruby lib
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "vagrant_cloud".freeze
|
6
|
+
s.version = "2.0.1"
|
7
|
+
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
|
+
s.require_paths = ["lib".freeze]
|
10
|
+
s.authors = ["HashiCorp".freeze, "Cargo Media".freeze]
|
11
|
+
s.date = "2018-10-17"
|
12
|
+
s.description = "Ruby library for the HashiCorp Vagrant Cloud API".freeze
|
13
|
+
s.email = "vagrant@hashicorp.com".freeze
|
14
|
+
s.homepage = "https://github.com/hashicorp/vagrant_cloud".freeze
|
15
|
+
s.licenses = ["MIT".freeze]
|
16
|
+
s.post_install_message = "NOTICE: As of the 2.0.0 release, the vagrant_cloud gem provides library functionality\n and no longer includes a command line client. For a command line client,\n use the `vagrant cloud` subcommand from Vagrant. Vagrant can be downloaded\n from: https://www.vagrantup.com/downloads.html".freeze
|
17
|
+
s.rubygems_version = "2.7.7".freeze
|
18
|
+
s.summary = "Vagrant Cloud API Library".freeze
|
19
|
+
|
20
|
+
s.installed_by_version = "2.7.7" if s.respond_to? :installed_by_version
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
s.specification_version = 4
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
s.add_runtime_dependency(%q<rest-client>.freeze, ["~> 2.0.2"])
|
27
|
+
s.add_development_dependency(%q<rake>.freeze, ["~> 10.4"])
|
28
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.0"])
|
29
|
+
s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.59.1"])
|
30
|
+
s.add_development_dependency(%q<webmock>.freeze, ["~> 3.0"])
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<rest-client>.freeze, ["~> 2.0.2"])
|
33
|
+
s.add_dependency(%q<rake>.freeze, ["~> 10.4"])
|
34
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
|
35
|
+
s.add_dependency(%q<rubocop>.freeze, ["~> 0.59.1"])
|
36
|
+
s.add_dependency(%q<webmock>.freeze, ["~> 3.0"])
|
37
|
+
end
|
38
|
+
else
|
39
|
+
s.add_dependency(%q<rest-client>.freeze, ["~> 2.0.2"])
|
40
|
+
s.add_dependency(%q<rake>.freeze, ["~> 10.4"])
|
41
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.0"])
|
42
|
+
s.add_dependency(%q<rubocop>.freeze, ["~> 0.59.1"])
|
43
|
+
s.add_dependency(%q<webmock>.freeze, ["~> 3.0"])
|
44
|
+
end
|
45
|
+
end
|