test-kitchen

systemctl error in docker 'Failed to connect to bus: No such file or directory'

混江龙づ霸主 提交于 2020-12-31 13:59:06
问题 I am using Ubuntu-16.04 image with docker to test my cookbook in local. While doing kitchen converge , I am getting the following error. I figured out systemctl is not working properly. Can someone please help me to fix this problem OR any other way to achieve the same thing? [2017-11-30T15:22:30+00:00] INFO: Running queued delayed notifications before re-raising exception Running handlers: [2017-11-30T15:22:30+00:00] ERROR: Running exception handlers Running handlers complete [2017-11-30T15

Virtualbox is locked when I try to destroy a kitchen instance

£可爱£侵袭症+ 提交于 2020-12-02 10:36:22
问题 I ran a test-kitchen instance and all was fine, but at the end when I did try to destroy it kitchen with: roberto@pc:~$ kitchen destroy Virtualbox gave me this error. -----> Starting Kitchen (v1.1.1) -----> Destroying <default-ubuntu-1204>... [default] Destroying VM and associated drives... >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: Failed to complete #destroy action: [Expected process to exit with [0], but received '1' ---- Begin output of vagrant

Virtualbox is locked when I try to destroy a kitchen instance

瘦欲@ 提交于 2020-12-02 10:36:02
问题 I ran a test-kitchen instance and all was fine, but at the end when I did try to destroy it kitchen with: roberto@pc:~$ kitchen destroy Virtualbox gave me this error. -----> Starting Kitchen (v1.1.1) -----> Destroying <default-ubuntu-1204>... [default] Destroying VM and associated drives... >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: Failed to complete #destroy action: [Expected process to exit with [0], but received '1' ---- Begin output of vagrant

How do I get log output in test kitchen?

馋奶兔 提交于 2020-01-14 03:50:10
问题 I have this in my recipe: log mylog1 do level :info message 'WHY I NO SEE THIS?' end log mylog2 do level :info message 'WHY I NO SEE THIS?' end This is what I see when doing kitchen converge -l debug : ... Converging 3 resources Recipe: mybook::myrecipe * log[mylog1] action write * log[mylog1] action write ... 回答1: There are two parts of this question: First, The log level passed to kitchen with "-l debug" is for the kitchen executable and not for the provisioner , in this case " chef-solo ".

Kitchen/berkshelf wants old gem?

半世苍凉 提交于 2020-01-06 14:14:31
问题 I want to test some changes to a cookbook, so I did what I used to do, but the result was far from normal: $ ../gem-sucks/bin/kitchen converge -----> Starting Kitchen (v1.2.1) !!!!!! The `berkshelf' gem is missing and must be installed or cannot be properly activated. Run `gem install berkshelf` or add the following to your Gemfile if you are using Bundler: `gem 'berkshelf'`. >>>>>> ------Exception------- >>>>>> Class: Kitchen::UserError >>>>>> Message: Could not load or activate Berkshelf

How to provide a condition within Chef recipe to see if it running under test kitchen?

北城以北 提交于 2019-12-24 09:49:28
问题 I am using encrypted data bags within Chef and I want to add a condition within my Chef recipe as follows: If (test kitchen) then encryptkey = data_bag_item("tokens", "encryptkey") If ( not test kitchen ) then secret = Chef::EncryptedDataBagItem.load_secret("/etc/chef/encrypted_data_bag_secret") encryptkey = Chef::EncryptedDataBagItem.load("tokens", "encryptkey", secret) I have added data_bags_path and encrypted_data_bag_secret_key_path within kitchen.yml as follows: provisioner: name: chef

How do I use roles in test kitchen?

孤街醉人 提交于 2019-12-24 06:51:21
问题 I can't figure out how to run roles in a run list in test kitchen. I did a knife download roles to my chef repo ( C:\.chef\roles ). I also did a knife download cookbooks to c:\.chef\cookbooks Here is the .kitchen.yml for a cookbook I want to test which I plan to run with a particular role ( C:\.chef\cookbooks\mybook\.kitchen.yml ): --- driver: name: hyperv parent_vhd_folder: c:\HyperV\VHDs\ parent_vhd_name: 2012R2_Fresh_Gen1.vhdx vm_switch: NAT memory_startup_bytes: 2GB provisioner: name:

How do I use roles in test kitchen?

陌路散爱 提交于 2019-12-24 06:51:09
问题 I can't figure out how to run roles in a run list in test kitchen. I did a knife download roles to my chef repo ( C:\.chef\roles ). I also did a knife download cookbooks to c:\.chef\cookbooks Here is the .kitchen.yml for a cookbook I want to test which I plan to run with a particular role ( C:\.chef\cookbooks\mybook\.kitchen.yml ): --- driver: name: hyperv parent_vhd_folder: c:\HyperV\VHDs\ parent_vhd_name: 2012R2_Fresh_Gen1.vhdx vm_switch: NAT memory_startup_bytes: 2GB provisioner: name:

How to specify cookbook path in .kitchen.yml file?

别来无恙 提交于 2019-12-18 18:55:57
问题 I have my Chef cookbooks stored in chef/cookbooks/ folder. When running kitchen converge I am still getting notice Berksfile, Cheffile, cookbooks/, or metadata.rb not found so Chef will run with effectively no cookbooks. Is this intended? I tried many options, for example: suites: - name: default run_list: recipe[git] cookbook_path: "chef/cookbooks" but I can't find the proper solution. How to specify the cookbooks' and roles' paths? 回答1: You'll want to put the path in your berksfile, which