Skip to content

Commit

Permalink
test: add test for lower case privkey in config replace
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Aug 29, 2016
1 parent 3207a5d commit 481f9b2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/sharness/t0021-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ test_config_cmd() {

test_expect_success "'ipfs config replace' injects privkey back" '
ipfs config replace show_config &&
grep "\"PrivKey\":" "$IPFS_PATH/config" | grep -e ": \".\+\"" >/dev/null
grep "\"PrivKey\":" "$IPFS_PATH/config" | grep -e ": \".\+\"" >/dev/null
'

test_expect_success "'ipfs config replace' with privkey erors out" '
test_expect_success "'ipfs config replace' with privkey errors out" '
cp "$IPFS_PATH/config" real_config &&
test_expect_code 1 ipfs config replace - < real_config 2> replace_out
'
Expand All @@ -124,6 +124,16 @@ test_config_cmd() {
test_cmp replace_out replace_expected
'

test_expect_success "'ipfs config replace' with lower case privkey errors out" '
cp "$IPFS_PATH/config" real_config &&
sed -e '\''s/PrivKey/privkey/'\'' -i real_config &&
test_expect_code 1 ipfs config replace - < real_config 2> replace_out
'

test_expect_success "output looks good" '
echo "Error: setting private key with API is not supported" > replace_expected
test_cmp replace_out replace_expected
'
}

test_init_ipfs
Expand Down

0 comments on commit 481f9b2

Please sign in to comment.