style: renames testdata so tests can actually be parsed at a glance
This commit is contained in:
parent
a4d2e919dc
commit
3c2a0129c0
83 changed files with 122 additions and 131 deletions
7
testdata/cp-encrypt.ct
vendored
Normal file
7
testdata/cp-encrypt.ct
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Copy an encrypted key; both keys should decrypt.
|
||||
$ pda set --encrypt secret-key@cpe hidden-value
|
||||
$ pda cp secret-key@cpe copied-key@cpe
|
||||
$ pda get secret-key@cpe
|
||||
hidden-value
|
||||
$ pda get copied-key@cpe
|
||||
hidden-value
|
||||
0
testdata/cp__ok.ct → testdata/cp.ct
vendored
0
testdata/cp__ok.ct → testdata/cp.ct
vendored
7
testdata/cp__encrypt__ok.ct
vendored
7
testdata/cp__encrypt__ok.ct
vendored
|
|
@ -1,7 +0,0 @@
|
|||
# Copy an encrypted key; both keys should decrypt.
|
||||
$ pda set --encrypt secret-key hidden-value
|
||||
$ pda cp secret-key copied-key
|
||||
$ pda get secret-key
|
||||
hidden-value
|
||||
$ pda get copied-key
|
||||
hidden-value
|
||||
8
testdata/dump__key__ok.ct
vendored
8
testdata/dump__key__ok.ct
vendored
|
|
@ -1,8 +0,0 @@
|
|||
$ pda set a1 1
|
||||
$ pda set a2 2
|
||||
$ pda set b1 3
|
||||
$ pda export --key "a*"
|
||||
{"key":"a1","value":"1","encoding":"text"}
|
||||
{"key":"a2","value":"2","encoding":"text"}
|
||||
$ pda export --key "c*" --> FAIL
|
||||
FAIL cannot ls '@default': no matches for key pattern 'c*'
|
||||
8
testdata/dump__value__ok.ct
vendored
8
testdata/dump__value__ok.ct
vendored
|
|
@ -1,8 +0,0 @@
|
|||
$ pda set url https://example.com
|
||||
$ fecho tmpval hello world
|
||||
$ pda set greeting < tmpval
|
||||
$ pda set number 42
|
||||
$ pda export --value "**https**"
|
||||
{"key":"url","value":"https://example.com","encoding":"text"}
|
||||
$ pda export --value "**world**"
|
||||
{"key":"greeting","value":"hello world\n","encoding":"text"}
|
||||
8
testdata/export-key-filter.ct
vendored
Normal file
8
testdata/export-key-filter.ct
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
$ pda set a1@ekf 1
|
||||
$ pda set a2@ekf 2
|
||||
$ pda set b1@ekf 3
|
||||
$ pda export ekf --key "a*"
|
||||
{"key":"a1","value":"1","encoding":"text"}
|
||||
{"key":"a2","value":"2","encoding":"text"}
|
||||
$ pda export ekf --key "c*" --> FAIL
|
||||
FAIL cannot ls '@ekf': no matches for key pattern 'c*'
|
||||
8
testdata/export-value-filter.ct
vendored
Normal file
8
testdata/export-value-filter.ct
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
$ pda set url@evf https://example.com
|
||||
$ fecho tmpval hello world
|
||||
$ pda set greeting@evf < tmpval
|
||||
$ pda set number@evf 42
|
||||
$ pda export evf --value "**https**"
|
||||
{"key":"url","value":"https://example.com","encoding":"text"}
|
||||
$ pda export evf --value "**world**"
|
||||
{"key":"greeting","value":"hello world\n","encoding":"text"}
|
||||
0
testdata/export__ok.ct → testdata/export.ct
vendored
0
testdata/export__ok.ct → testdata/export.ct
vendored
4
testdata/get-base64-run.ct
vendored
Normal file
4
testdata/get-base64-run.ct
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$ fecho cmd echo hello
|
||||
$ pda set foo@gbr < cmd
|
||||
$ pda get foo@gbr --base64 --run
|
||||
hello
|
||||
3
testdata/get-base64.ct
vendored
Normal file
3
testdata/get-base64.ct
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$ pda set a@gb b
|
||||
$ pda get a@gb --base64
|
||||
b
|
||||
6
testdata/get-run.ct
vendored
Normal file
6
testdata/get-run.ct
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ fecho cmd echo hello
|
||||
$ pda set a@gr < cmd
|
||||
$ pda get a@gr
|
||||
echo hello
|
||||
$ pda get a@gr --run
|
||||
hello
|
||||
3
testdata/get.ct
vendored
Normal file
3
testdata/get.ct
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$ pda set foo@g bar
|
||||
$ pda get foo@g
|
||||
bar
|
||||
3
testdata/get__ok.ct
vendored
3
testdata/get__ok.ct
vendored
|
|
@ -1,3 +0,0 @@
|
|||
$ pda set foo bar
|
||||
$ pda get foo
|
||||
bar
|
||||
3
testdata/get__ok__with__binary.ct
vendored
3
testdata/get__ok__with__binary.ct
vendored
|
|
@ -1,3 +0,0 @@
|
|||
$ pda set a b
|
||||
$ pda get a --base64
|
||||
b
|
||||
4
testdata/get__ok__with__binary_run.ct
vendored
4
testdata/get__ok__with__binary_run.ct
vendored
|
|
@ -1,4 +0,0 @@
|
|||
$ fecho cmd echo hello
|
||||
$ pda set foo < cmd
|
||||
$ pda get foo --base64 --run
|
||||
hello
|
||||
6
testdata/get__ok__with__run.ct
vendored
6
testdata/get__ok__with__run.ct
vendored
|
|
@ -1,6 +0,0 @@
|
|||
$ fecho cmd echo hello
|
||||
$ pda set a < cmd
|
||||
$ pda get a
|
||||
echo hello
|
||||
$ pda get a --run
|
||||
hello
|
||||
0
testdata/help__ok.ct → testdata/help.ct
vendored
0
testdata/help__ok.ct → testdata/help.ct
vendored
9
testdata/import-drop.ct
vendored
Normal file
9
testdata/import-drop.ct
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$ pda set existing@idr keep-me
|
||||
$ pda set other@idr also-keep
|
||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda import idr --drop --file dumpfile
|
||||
ok restored 1 entries into @idr
|
||||
$ pda get new@idr
|
||||
hello
|
||||
$ pda get existing@idr --> FAIL
|
||||
FAIL cannot get 'existing@idr': no such key
|
||||
16
testdata/import-key-filter.ct
vendored
Normal file
16
testdata/import-key-filter.ct
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
$ pda set a1@ikf 1
|
||||
$ pda set a2@ikf 2
|
||||
$ pda set b1@ikf 3
|
||||
$ fecho dumpfile {"key":"a1","value":"1","encoding":"text"} {"key":"a2","value":"2","encoding":"text"} {"key":"b1","value":"3","encoding":"text"}
|
||||
$ pda rm a1@ikf a2@ikf b1@ikf
|
||||
$ pda import ikf --key "a*" --file dumpfile
|
||||
ok restored 2 entries into @ikf
|
||||
$ pda get a1@ikf
|
||||
1
|
||||
$ pda get a2@ikf
|
||||
2
|
||||
$ pda get b1@ikf --> FAIL
|
||||
FAIL cannot get 'b1@ikf': no such key
|
||||
hint did you mean 'a1'?
|
||||
$ pda import ikf --key "c*" --file dumpfile --> FAIL
|
||||
FAIL cannot restore '@ikf': no matches for key pattern 'c*'
|
||||
7
testdata/mv-encrypt.ct
vendored
Normal file
7
testdata/mv-encrypt.ct
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Move an encrypted key; the new key should still decrypt.
|
||||
$ pda set --encrypt secret-key@mve hidden-value
|
||||
$ pda mv secret-key@mve moved-key@mve
|
||||
$ pda get moved-key@mve
|
||||
hidden-value
|
||||
$ pda get secret-key@mve --> FAIL
|
||||
FAIL cannot get 'secret-key@mve': no such key
|
||||
0
testdata/mv__ok.ct → testdata/mv.ct
vendored
0
testdata/mv__ok.ct → testdata/mv.ct
vendored
7
testdata/mv__encrypt__ok.ct
vendored
7
testdata/mv__encrypt__ok.ct
vendored
|
|
@ -1,7 +0,0 @@
|
|||
# Move an encrypted key; the new key should still decrypt.
|
||||
$ pda set --encrypt secret-key hidden-value
|
||||
$ pda mv secret-key moved-key
|
||||
$ pda get moved-key
|
||||
hidden-value
|
||||
$ pda get secret-key --> FAIL
|
||||
FAIL cannot get 'secret-key': no such key
|
||||
12
testdata/remove-dedupe.ct
vendored
Normal file
12
testdata/remove-dedupe.ct
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Remove deduplicates positional args and glob matches
|
||||
$ pda set foo@rdd 1
|
||||
$ pda set bar@rdd 2
|
||||
$ pda ls rdd --format tsv
|
||||
Key Value TTL
|
||||
bar 2 no expiry
|
||||
foo 1 no expiry
|
||||
$ pda rm foo@rdd --key "*@rdd"
|
||||
$ pda get bar@rdd --> FAIL
|
||||
FAIL cannot get 'bar@rdd': no such key
|
||||
$ pda get foo@rdd --> FAIL
|
||||
FAIL cannot get 'foo@rdd': no such key
|
||||
11
testdata/remove-key-glob.ct
vendored
Normal file
11
testdata/remove-key-glob.ct
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
$ pda set a1@rkg 1
|
||||
$ pda set a2@rkg 2
|
||||
$ pda set b1@rkg 3
|
||||
$ pda rm --key "a*@rkg"
|
||||
$ pda get a1@rkg --> FAIL
|
||||
FAIL cannot get 'a1@rkg': no such key
|
||||
hint did you mean 'b1'?
|
||||
$ pda get a2@rkg --> FAIL
|
||||
FAIL cannot get 'a2@rkg': no such key
|
||||
$ pda get b1@rkg
|
||||
3
|
||||
10
testdata/remove-key-mixed.ct
vendored
Normal file
10
testdata/remove-key-mixed.ct
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
$ pda set foo@rkm 1
|
||||
$ pda set bar1@rkm 2
|
||||
$ pda set bar2@rkm 3
|
||||
$ pda rm foo@rkm --key "bar*@rkm"
|
||||
$ pda get foo@rkm --> FAIL
|
||||
FAIL cannot get 'foo@rkm': no such key
|
||||
$ pda get bar1@rkm --> FAIL
|
||||
FAIL cannot get 'bar1@rkm': no such key
|
||||
$ pda get bar2@rkm --> FAIL
|
||||
FAIL cannot get 'bar2@rkm': no such key
|
||||
7
testdata/remove-multiple.ct
vendored
Normal file
7
testdata/remove-multiple.ct
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
$ pda set a@rmm 1
|
||||
$ pda set b@rmm 2
|
||||
$ pda rm a@rmm b@rmm
|
||||
$ pda get a@rmm --> FAIL
|
||||
FAIL cannot get 'a@rmm': no such key
|
||||
$ pda get b@rmm --> FAIL
|
||||
FAIL cannot get 'b@rmm': no such key
|
||||
2
testdata/remove.ct
vendored
Normal file
2
testdata/remove.ct
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$ pda set a@rm b
|
||||
$ pda rm a@rm
|
||||
20
testdata/remove__dedupe__ok.ct
vendored
20
testdata/remove__dedupe__ok.ct
vendored
|
|
@ -1,20 +0,0 @@
|
|||
$ pda set foo 1
|
||||
$ pda set bar 2
|
||||
$ pda ls
|
||||
Key Value TTL
|
||||
a echo hello (..1 more chars) no expiry
|
||||
a1 1 no expiry
|
||||
a2 2 no expiry
|
||||
b1 3 no expiry
|
||||
bar 2 no expiry
|
||||
copied-key hidden-value no expiry
|
||||
foo 1 no expiry
|
||||
greeting hello world (..1 more chars) no expiry
|
||||
moved-key hidden-value no expiry
|
||||
number 42 no expiry
|
||||
url https://example.com no expiry
|
||||
$ pda rm foo --key "*"
|
||||
$ pda get bar --> FAIL
|
||||
FAIL cannot get 'bar': no such key
|
||||
$ pda get foo --> FAIL
|
||||
FAIL cannot get 'foo': no such key
|
||||
10
testdata/remove__key__mixed__ok.ct
vendored
10
testdata/remove__key__mixed__ok.ct
vendored
|
|
@ -1,10 +0,0 @@
|
|||
$ pda set foo 1
|
||||
$ pda set bar1 2
|
||||
$ pda set bar2 3
|
||||
$ pda rm foo --key "bar*"
|
||||
$ pda get foo --> FAIL
|
||||
FAIL cannot get 'foo': no such key
|
||||
$ pda get bar1 --> FAIL
|
||||
FAIL cannot get 'bar1': no such key
|
||||
$ pda get bar2 --> FAIL
|
||||
FAIL cannot get 'bar2': no such key
|
||||
11
testdata/remove__key__ok.ct
vendored
11
testdata/remove__key__ok.ct
vendored
|
|
@ -1,11 +0,0 @@
|
|||
$ pda set a1 1
|
||||
$ pda set a2 2
|
||||
$ pda set b1 3
|
||||
$ pda rm --key "a*"
|
||||
$ pda get a1 --> FAIL
|
||||
FAIL cannot get 'a1': no such key
|
||||
hint did you mean 'b1'?
|
||||
$ pda get a2 --> FAIL
|
||||
FAIL cannot get 'a2': no such key
|
||||
$ pda get b1
|
||||
3
|
||||
8
testdata/remove__multiple__ok.ct
vendored
8
testdata/remove__multiple__ok.ct
vendored
|
|
@ -1,8 +0,0 @@
|
|||
$ pda set a 1
|
||||
$ pda set b 2
|
||||
$ pda rm a b
|
||||
$ pda get a --> FAIL
|
||||
FAIL cannot get 'a': no such key
|
||||
$ pda get b --> FAIL
|
||||
FAIL cannot get 'b': no such key
|
||||
hint did you mean 'b1'?
|
||||
2
testdata/remove__ok.ct
vendored
2
testdata/remove__ok.ct
vendored
|
|
@ -1,2 +0,0 @@
|
|||
$ pda set a b
|
||||
$ pda rm a
|
||||
9
testdata/restore__drop__ok.ct
vendored
9
testdata/restore__drop__ok.ct
vendored
|
|
@ -1,9 +0,0 @@
|
|||
$ pda set existing keep-me
|
||||
$ pda set other also-keep
|
||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda import --drop --file dumpfile
|
||||
ok restored 1 entries into @default
|
||||
$ pda get new
|
||||
hello
|
||||
$ pda get existing --> FAIL
|
||||
FAIL cannot get 'existing': no such key
|
||||
16
testdata/restore__key__ok.ct
vendored
16
testdata/restore__key__ok.ct
vendored
|
|
@ -1,16 +0,0 @@
|
|||
$ pda set a1 1
|
||||
$ pda set a2 2
|
||||
$ pda set b1 3
|
||||
$ fecho dumpfile {"key":"a1","value":"1","encoding":"text"} {"key":"a2","value":"2","encoding":"text"} {"key":"b1","value":"3","encoding":"text"}
|
||||
$ pda rm a1 a2 b1
|
||||
$ pda import --key "a*" --file dumpfile
|
||||
ok restored 2 entries into @default
|
||||
$ pda get a1
|
||||
1
|
||||
$ pda get a2
|
||||
2
|
||||
$ pda get b1 --> FAIL
|
||||
FAIL cannot get 'b1': no such key
|
||||
hint did you mean 'a1'?
|
||||
$ pda import --key "c*" --file dumpfile --> FAIL
|
||||
FAIL cannot restore '@default': no matches for key pattern 'c*'
|
||||
0
testdata/root__ok.ct → testdata/root.ct
vendored
0
testdata/root__ok.ct → testdata/root.ct
vendored
4
testdata/set-encrypt-ttl.ct
vendored
Normal file
4
testdata/set-encrypt-ttl.ct
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Set an encrypted key with TTL, then retrieve it.
|
||||
$ pda set --encrypt --ttl 1h api-key@set sk-ttl-test
|
||||
$ pda get api-key@set
|
||||
sk-ttl-test
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Set an encrypted key, then retrieve it (transparent decryption).
|
||||
$ pda set --encrypt api-key sk-test-123
|
||||
$ pda get api-key
|
||||
$ pda set --encrypt api-key@se sk-test-123
|
||||
$ pda get api-key@se
|
||||
sk-test-123
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
$ fecho cmd hello world
|
||||
$ pda set foo < cmd
|
||||
$ pda set foo@ss < cmd
|
||||
1
testdata/set-ttl.ct
vendored
Normal file
1
testdata/set-ttl.ct
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
$ pda set a@st b --ttl 30m
|
||||
1
testdata/set.ct
vendored
Normal file
1
testdata/set.ct
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
$ pda set a@s b
|
||||
4
testdata/set__encrypt__ok__with__ttl.ct
vendored
4
testdata/set__encrypt__ok__with__ttl.ct
vendored
|
|
@ -1,4 +0,0 @@
|
|||
# Set an encrypted key with TTL, then retrieve it.
|
||||
$ pda set --encrypt --ttl 1h api-key sk-ttl-test
|
||||
$ pda get api-key
|
||||
sk-ttl-test
|
||||
1
testdata/set__ok.ct
vendored
1
testdata/set__ok.ct
vendored
|
|
@ -1 +0,0 @@
|
|||
$ pda set a b
|
||||
1
testdata/set__ok__with__ttl.ct
vendored
1
testdata/set__ok__with__ttl.ct
vendored
|
|
@ -1 +0,0 @@
|
|||
$ pda set a b --ttl 30m
|
||||
Loading…
Add table
Add a link
Reference in a new issue