aboutsummaryrefslogtreecommitdiff
path: root/tests/data
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-05-05 08:29:24 -0300
committerSean Whitton <spwhitton@spwhitton.name>2022-05-05 12:26:10 -0700
commit7712c51df4f60d134451a9da3f11bb3f006991a0 (patch)
tree282318f231232ff360a73de033f2d6a1d86d7512 /tests/data
parent4b0625d744e73e9e7ad3708320fba7fa2cab21ae (diff)
downloadconsfigurator-7712c51df4f60d134451a9da3f11bb3f006991a0.tar.gz
initial tests for CONSFIGURATOR.DATA.PGP
Define some simple regression tests to guard against breakage due to the refactoring of gnupg usage. Signed-off-by: David Bremner <david@tethera.net>
Diffstat (limited to 'tests/data')
-rw-r--r--tests/data/pgp.lisp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/data/pgp.lisp b/tests/data/pgp.lisp
new file mode 100644
index 0000000..21ba60c
--- /dev/null
+++ b/tests/data/pgp.lisp
@@ -0,0 +1,21 @@
+(in-package :consfigurator/tests)
+(named-readtables:in-readtable :consfigurator)
+(in-consfig "consfigurator/tests")
+
+(defun populate-data-pgp ()
+ "Invoked by test runner before data source is registered."
+ (data.pgp:set-data *test-pgp-file* "_secrets" "test" "this is a sekrit")
+ (data.pgp:set-data *test-pgp-file* "host.example.com" "/etc/foo.conf"
+ "secret file content"))
+
+(deftest data.pgp.1
+ (data.pgp:get-data *test-pgp-file* "_secrets" "test")
+ "this is a sekrit")
+
+(deftest data.pgp.2
+ (get-data-string "_secrets" "test")
+ "this is a sekrit")
+
+(deftest data.pgp.3
+ (get-data-string "host.example.com" "/etc/foo.conf")
+ "secret file content")