Recipe attributes with Inspec


#1

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?

Thanks!


#2

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:

P.S.

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.