aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-24 01:31:26 +0700
committerShulhan <ms@kilabit.info>2023-09-26 00:24:02 +0700
commit8cc52027d243946c03c6b0d1016ca7cc3d7de09a (patch)
treecbb1db5fbc9a5f48e24b64e391ea1d01adffee1c /testdata
parent9c709996d9519d6552e44182440438d080b8789d (diff)
downloadawwan-8cc52027d243946c03c6b0d1016ca7cc3d7de09a.tar.xz
all: make the magic word "#put" able to copy encrypted file
When issuing "#put:" or "#put!" command in the script, if the input file is not exist it will check for the encrypted file, the one with ".vault" extension. If it exists, the encrypted file will be used as input for copy operation.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/encrypt/awwan.env2
-rw-r--r--testdata/encrypt/file.txt.org2
-rw-r--r--testdata/encrypt/file.txt.vault2
-rw-r--r--testdata/encrypt/local.aww2
-rw-r--r--testdata/encrypt/test.data4
5 files changed, 12 insertions, 0 deletions
diff --git a/testdata/encrypt/awwan.env b/testdata/encrypt/awwan.env
new file mode 100644
index 0000000..81b55e7
--- /dev/null
+++ b/testdata/encrypt/awwan.env
@@ -0,0 +1,2 @@
+[host]
+name = encrypt
diff --git a/testdata/encrypt/file.txt.org b/testdata/encrypt/file.txt.org
new file mode 100644
index 0000000..de6797e
--- /dev/null
+++ b/testdata/encrypt/file.txt.org
@@ -0,0 +1,2 @@
+The host name is {{.Val "host::name"}}.
+The secret password is {{.Val "secret::pass"}}.
diff --git a/testdata/encrypt/file.txt.vault b/testdata/encrypt/file.txt.vault
new file mode 100644
index 0000000..43cb223
--- /dev/null
+++ b/testdata/encrypt/file.txt.vault
@@ -0,0 +1,2 @@
+E{
+;_%uۂK?C5+BclP8"b5mD B!PA\`2TW, d<.$V-{S3UTָgjj@*qAXBb42$TTnX@OKwa$}j|Hʹ#Ma15m1M!+(,k:ctsB0l7P췧o6J'<Tqsp`Qo>i;_6zVijS m2D?&73'yf=T&aj~A#!Qu@ Jc?qcp9 (&,ʑoN1BTNN|YG%Xt \ No newline at end of file
diff --git a/testdata/encrypt/local.aww b/testdata/encrypt/local.aww
index d9127db..31e737d 100644
--- a/testdata/encrypt/local.aww
+++ b/testdata/encrypt/local.aww
@@ -1 +1,3 @@
echo {{.Val "secret::pass"}}
+
+#put: {{.ScriptDir}}/file.txt {{.ScriptDir}}/file.txt.decrypted
diff --git a/testdata/encrypt/test.data b/testdata/encrypt/test.data
index 9ecdb9f..40ad1de 100644
--- a/testdata/encrypt/test.data
+++ b/testdata/encrypt/test.data
@@ -7,3 +7,7 @@ this_is_a_secret
--> local: 1: echo this_is_a_secret_in_sub
this_is_a_secret_in_sub
+
+<<< local.aww:3:exp_file_content
+The host name is encrypt.
+The secret password is this_is_a_secret.