Recipe attributes with Inspec


Hello all,

I wrote some control test for Mysql cookbook and i'd like to run some queries using mysql cli, but, for that, i need to insert root password first. I have this pass stored in a attribute but and don't know how use in my inspec profile. Any idea?



Inspec should be totally independent from your implementation with Chef/Ansible/whatever, even if you know that it will be Chef.

During TEST you have test scenario, which mean you already know some inputs, like password for MySQL.

Actually I already did tests for mysql cookbook, you can check them here:


In worst of the worst of the worst case, you can load inside inspec /tmp/kitchen/nodes/node-name.json with node attrs. But its ugly and contradicts idea of InSpec itself and integration testing specifically.