-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
- Loading branch information
1 parent
4dbb084
commit a3b38e8
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2017 Jeromy Johnson | ||
# MIT Licensed; see the LICENSE file in this repository. | ||
# | ||
|
||
test_description="Test keystore commands" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
test_key_cmd() { | ||
test_expect_success "create a new rsa key" ' | ||
rsahash=$(ipfs key gen foobarsa --type=rsa --size=2048) | ||
' | ||
|
||
test_expect_success "create a new ed25519 key" ' | ||
edhash=$(ipfs key gen bazed --type=ed25519) | ||
' | ||
|
||
test_expect_success "both keys show up in list output" ' | ||
echo bazed > list_exp && | ||
echo foobarsa >> list_exp && | ||
ipfs key list | sort > list_out && | ||
test_cmp list_exp list_out | ||
' | ||
|
||
test_expect_success "key hashes show up in long list output" ' | ||
ipfs key list -l | grep $edhash > /dev/null && | ||
ipfs key list -l | grep $rsahash > /dev/null | ||
' | ||
} | ||
|
||
test_key_cmd | ||
|
||
test_done |