Hi,
An approach might be to use test-kitchen + duplicate suite names + a custom chef-handler that writes the number of updated resources to disk + serverspec to verify it. e.g. .kitchen.yaml -8<--- suites: - name: default run_list: - recipe[chef-handler] - recipe[build-essential] attributes: - name: default run_list: - recipe[chef-handler] - recipe[build-essential] attributes: -8<--- this will converge the node twice on „kitchen converge“. An example for a simple chef handler: https://github.com/jtimberman/chef-handler-updated-resources/blob/master/lib/chef/handler/updated_resources.rb - use https://supermarket.chef.io/cookbooks/chef_handler to deploy the handler to your testing node. Instead of logging to Chef::Log you could just write the number of updated resources to a log file e.g. /tmp/updated_resources and use http://serverspec.org/resource_types.html#file to verify. hth best regards Roland |
Archive powered by MHonArc 2.6.16.