Version:
2.2.2
Environment:
Host system - macOS 10.15, guest OS CentOS 7
Scenario:
Make kitchen pass inputs to inspec, specifically an array of values that inspec will later iterate over. It seems like the array type is crucial here.
Steps to Reproduce:
My kitchen.yml, under the suite, contains this inspec config:
verifier:
inspec_tests:
...
inputs:
- name: domains
type: array
value: ['foo.com', 'bar.com']
now run kitchen verify against this setup.
Expected Result:
The domains array should be iterable in an inspec test
Actual Result:
The execution never makes it to inspec proper. It looks like kitchen-inspec is (always?) expecting to get a hash. When it gets an array instead, and then tries to access its hash keys, it errors out:
Message: Failed to complete #verify action: [undefined method 'keys' for #<Array:memaddr>]
I believe this is where things break:
if config[:inputs]
...
opts[inputs_key] = Hashie.stringify_keys config[:inputs]
end
A work around is to move the inputs config from kitchen.yml into the inspec profile's inspec.yml file.
Version:
2.2.2
Environment:
Host system - macOS 10.15, guest OS CentOS 7
Scenario:
Make kitchen pass inputs to inspec, specifically an array of values that inspec will later iterate over. It seems like the array type is crucial here.
Steps to Reproduce:
My kitchen.yml, under the suite, contains this inspec config:
now run
kitchen verifyagainst this setup.Expected Result:
The
domainsarray should be iterable in an inspec testActual Result:
The execution never makes it to inspec proper. It looks like kitchen-inspec is (always?) expecting to get a hash. When it gets an array instead, and then tries to access its hash keys, it errors out:
Message: Failed to complete #verify action: [undefined method 'keys' for #<Array:memaddr>]I believe this is where things break:
A work around is to move the
inputsconfig fromkitchen.ymlinto the inspec profile'sinspec.ymlfile.