![测试厨房与 Windows 客户机融合失败,出现 WinRMAuthorizationError](https://linux22.com/image/651186/%E6%B5%8B%E8%AF%95%E5%8E%A8%E6%88%BF%E4%B8%8E%20Windows%20%E5%AE%A2%E6%88%B7%E6%9C%BA%E8%9E%8D%E5%90%88%E5%A4%B1%E8%B4%A5%EF%BC%8C%E5%87%BA%E7%8E%B0%20WinRMAuthorizationError.png)
我正在尝试让 test-kitchen 与客户 Windows VM 一起工作。我关注了很多 Matt Wrock 的优秀博客文章。我设置了一个正在运行的 Windows Vagrant 框,使用了正确的 test-kitchen 和 kitchen-vagrant 分支并设法开始kitchen create
工作。
这时,我被困在kitchen converge
工作中。我会进行聚合并遇到:
$ kitchen converge
-----> Starting Kitchen (v1.3.2.dev)
-----> Converging <default-windows-7>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 3.1.3...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #converge action: [[Kitchen::Transport::Winrm] WinRM::WinRMAuthorizationError using shell: [powershell] and command: [ $ProgressPreference='SilentlyContinue'; if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };
if (-Not (Test-Path "/tmp/kitchen")) {
mkdir "/tmp/kitchen" | Out-Null
}
if ( Test-Path '/tmp/kitchen/data' ) { rm -r '/tmp/kitchen/data' };if ( Test-Path '/tmp/kitchen/data_bags' ) { rm -r '/tmp/kitchen/data_bags' };if ( Test-Path '/tmp/kitchen/environments' ) { rm -r '/tmp/kitchen/environments' };if ( Test-Path '/tmp/kitchen/roles' ) { rm -r '/tmp/kitchen/roles' };if ( Test-Path '/tmp/kitchen/clients' ) { rm -r '/tmp/kitchen/clients' };]]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
此时我不知所措,我能够运行vagrant up
并让 shell 配置程序创建一个文件,因此 powershell 权限似乎设置正确。我有更多关于所有配置文件概要。
答案1
Windows 支持的分支最近已合并到最新版本中。我的 Gemfile(如下)指向 test-kitchen 和 kitchen-vagrant 的测试主分支,对我来说是有效的。希望它也能为您服务。
附言:经过多年的使用,我终于登录了,这是我的第一条回复:-)
source 'https://rubygems.org'
group :development do
gem "test-kitchen", :git => 'https://github.com/test-kitchen/test-kitchen.git', :branch => 'master'
gem 'kitchen-vagrant', git: 'https://github.com/test-kitchen/kitchen-vagrant.git', :branch => 'master'
gem "berkshelf"
gem "vagrant-wrapper", ">= 2.0"
end
答案2
我遇到了完全相同的问题。 kitchen create 工作正常,但 converge 因该错误而失败。我运行的是 Vagrant 1.7.2 版本。我降级到 Vagrant 1.6.3,这似乎解决了这个问题。