diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-27 00:21:18 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-27 00:54:10 +0700 |
| commit | c595d849701d35e81c02e4a834abb4cd2d0a5933 (patch) | |
| tree | 534e2dad5633945661101dc86e8c05e070c3cad2 /testdata | |
| parent | d1b393b0d4ca75c8d81d051a332597b7aa3f0ab0 (diff) | |
| download | awwan-c595d849701d35e81c02e4a834abb4cd2d0a5933.tar.xz | |
all: add tests for local with empty and invalid passphrase
While at it, rename the script for testing encrypted value to allow
other tests without encryption later.
Diffstat (limited to 'testdata')
| -rw-r--r-- | testdata/local/local.data | 9 | ||||
| -rw-r--r-- | testdata/local/local_encrypted.aww | 5 | ||||
| -rw-r--r-- | testdata/local/local_encrypted.data | 15 | ||||
| -rw-r--r-- | testdata/local/sub/local.aww | 1 | ||||
| -rw-r--r-- | testdata/local/sub/local_encrypted.aww (renamed from testdata/local/local.aww) | 0 |
5 files changed, 20 insertions, 10 deletions
diff --git a/testdata/local/local.data b/testdata/local/local.data deleted file mode 100644 index 9ecdb9f..0000000 --- a/testdata/local/local.data +++ /dev/null @@ -1,9 +0,0 @@ -<<< local.aww:1 - ---> local: 1: echo this_is_a_secret -this_is_a_secret - -<<< sub/local.aww:1 - ---> local: 1: echo this_is_a_secret_in_sub -this_is_a_secret_in_sub diff --git a/testdata/local/local_encrypted.aww b/testdata/local/local_encrypted.aww new file mode 100644 index 0000000..7655b28 --- /dev/null +++ b/testdata/local/local_encrypted.aww @@ -0,0 +1,5 @@ +echp {{.Val "host::name"}} + +echo {{.Val "secret::pass"}} + +echo {{.Val "host::name"}} {{.Val "secret::pass"}} diff --git a/testdata/local/local_encrypted.data b/testdata/local/local_encrypted.data new file mode 100644 index 0000000..d4e27b0 --- /dev/null +++ b/testdata/local/local_encrypted.data @@ -0,0 +1,15 @@ +<<< echo_encrypted + +--> local: 3: echo this_is_a_secret +this_is_a_secret + +<<< echo_encrypted_no_pass +Local: NewScript: ParseScript: template: local_encrypted.aww:3:7: executing "local_encrypted.aww" at <.Val>: error calling Val: "secret::pass" is empty + +<<< echo_encrypted_invalid_pass +Local: NewSession: loadEnvFromPaths: LoadPrivateKeyInteractive: x509: decryption password incorrect + +<<< sub_echo_encrypted + +--> local: 1: echo this_is_a_secret_in_sub +this_is_a_secret_in_sub diff --git a/testdata/local/sub/local.aww b/testdata/local/sub/local.aww deleted file mode 100644 index d9127db..0000000 --- a/testdata/local/sub/local.aww +++ /dev/null @@ -1 +0,0 @@ -echo {{.Val "secret::pass"}} diff --git a/testdata/local/local.aww b/testdata/local/sub/local_encrypted.aww index d9127db..d9127db 100644 --- a/testdata/local/local.aww +++ b/testdata/local/sub/local_encrypted.aww |
