我玩弄嘗試和minitests在測試廚房與vagrant工作。廚師客戶端啓動失敗minitest使用vagrant和測試廚房
我自己的測試成功,但廚師客戶食譜包括一個測試,以啓動廚師客戶端,其中測試運行失敗。主廚客戶端啓動失敗的原因是因爲它無法與我的主廚服務器進行身份驗證,因爲該框沒有我的客戶端驗證密鑰。
# Running tests:
chef-client::service#test_0001_starts the chef-client service = 0.03 s = F
ntp::default#test_0001_starts the NTP daemon = 0.15 s = .
ntp::default#test_0003_creates the ntp.conf = 0.01 s = .
ntp::default#test_0002_creates the leapfile = 0.00 s = .
recipe::my_cookbook::default::greeting file#test_0001_creates the greeting file = 0.00 s = .
recipe::my_cookbook::default::greeting file#test_0002_continas what's stored in the 'greeting' node attribute = 0.00 s = .
Finished tests in 0.199086s, 30.1377 tests/s, 55.2525 assertions/s.
1) Failure:
chef-client::service#test_0001_starts the chef-client service [/var/chef/minitest/chef-client/service_test.rb:25]:
Expected: true
Actual: false
6 tests, 11 assertions, 1 failures, 0 errors, 0 skips
[2013-11-24T13:07:45+00:00] INFO: Report handlers complete
[2013-11-24T13:07:45+00:00] ERROR: Running exception handlers
[2013-11-24T13:07:45+00:00] ERROR: Exception handlers complete
[2013-11-24T13:07:45+00:00] FATAL: Stacktrace dumped to /tmp/kitchen-chef-solo/cache/chef-stacktrace.out
Chef Client failed. 38 resources updated
[2013-11-24T13:07:45+00:00] ERROR: MiniTest failed with 1 failure(s) and 0 error(s).
Failure:
chef-client::service#test_0001_starts the chef-client service [/var/chef/minitest/chef-client/service_test.rb:25]:
Expected: true
Actual: false
[2013-11-24T13:07:45+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <default-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/default-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-solo --config /tmp/kitchen-chef-solo/solo.rb --json-attributes /tmp/kitchen-chef-solo/dna.json --log_level info]
>>>>>> ----------------------
這裏是一個手動廚師客戶端運行的輸出在漂浮的盒子被試廚紡起來:
[email protected]:~$ sudo chef-client
[2013-11-24T18:29:21+00:00] WARN: *****************************************
[2013-11-24T18:29:21+00:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2013-11-24T18:29:21+00:00] WARN: *****************************************
Starting Chef Client, version 11.8.0
Creating a new client identity for default-ubuntu-1204.vagrantup.com using the validator key.
[2013-11-24T18:29:21+00:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/validation.pem>
================================================================================
Chef encountered an error attempting to create the client "default-ubuntu-1204.vagrantup.com"
================================================================================
Private Key Not Found:
----------------------
Your private key could not be loaded. If the key file exists, ensure that it is
readable by chef-client.
Relevant Config Settings:
-------------------------
validation_key "/etc/chef/validation.pem"
[2013-11-24T18:29:21+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated
[2013-11-24T18:29:21+00:00] ERROR: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
[2013-11-24T18:29:21+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
我試圖找到一個辦法讓我的客戶端密鑰到由測試廚房創建的流浪盒,我認爲這將通過.kitchen.yml,因爲這是用來創建VagrantFile的文件。我配置了我的其他流浪者以找到我的客戶端身份驗證密鑰與VagrantFile,所以我認爲這種方法應該工作。
測試廚房之類的似乎支持遊民規定,但它不是我很清楚這是怎麼應該做只是通過設置use_vagrant_provision: true
https://github.com/test-kitchen/kitchen-vagrant#-use_vagrant_provision
我覺得我失去了一些東西很明顯這裏有沒有發生過我呢......?
不要忘記接受正確的答案! – Robert