From e3e0e8bc042a6f420241576c752a1d43fcb92a37 Mon Sep 17 00:00:00 2001 From: Nick Howes Date: Thu, 1 Sep 2016 17:14:00 +0100 Subject: [PATCH] Smoke test --- tests/init.pp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/init.pp b/tests/init.pp index c1ab813..45c4b91 100644 --- a/tests/init.pp +++ b/tests/init.pp @@ -1,12 +1,10 @@ -# The baseline for module testing used by Puppet Labs is that each manifest -# should have a corresponding test manifest that declares that class or defined -# type. -# -# Tests are then run by using puppet apply --noop (to check for compilation -# errors and view a log of events) or by fully applying the test in a virtual -# environment (to compare the resulting system state to the desired state). -# -# Learn more about module testing here: -# http://docs.puppetlabs.com/guides/tests_smoke.html -# -include ::eyaml_tools +# For these tests to work, a valid hiera.yaml will need to be set up with hiera-eyaml, +# and you'll also need both private and public keys. You can set hiera_config to +# spec/fixtures/hiera.yaml. + +$encrypted = eyaml_tools::encrypt('foo') +$decrypted = eyaml_tools::decrypt($encrypted) + +if ($decrypted != 'foo') { + fail("Decrypted data should have been 'foo' but instead it was '$decrypted'!") +}