Ok, i managed to provide a repro, here: https://github.com/LongLiveCHIEF/eyaml-rspec-example-failure
The master branch is project state before adding a eyaml data source, and then there's a branch for `add-eyaml-data-source` which contains the reproduced error.
I may have actually made some progress on the pinpoint the issue in the process though, as I discovered that even my branch passed, until i added the very last commit, which added a `lookup` hiera interpolation in one of the hiera data sources: https://github.com/LongLiveCHIEF/eyaml-rspec-example-failure/blob/add-eyaml-data-source/data/sector/alpha.yaml#L5
For convenience, I've dockerized this entire reproduction, and assuming you have docker installed, you can run it simply with:
``` git clone g...@github.com:LongLiveCHIEF/eyaml-rspec-example-failure.git cd eyaml-rspec-example-failure make build make test // will build the entire env, install all testing deps/puppet/etc, and then execute pdk test unit ``` Then to view the repoduction, just checkout the `add-eyaml-data-source` and run `make test` again.
However, I found that when I initially tried to reproduce the issue, I wasn't getting any errors, even using a fake pkcs7 key pair. (note, I'm not testing any of the eyaml decryption outcomes)
so, if you are on the `add-eyaml-data-source` branch, and rewind one commit, and run `make test` again... everything works.
This docker environment contains both a set of "fake" keys, to simulate what i'm doing to test, as well as the real keys used to create the encrypted value in `secrets/sector/alpha.eyaml`.
I guess what my next question is, and I using the `lookup` improperly in the `data/sector/alpha.yaml` file? Or am i using it correctly, and I have now uncovered the function to mock to prevent the `bad interpolation` error?
|