Skip to content

Commit

Permalink
test: split 'ipfs config replace' test into parts
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Kubuxu committed Sep 8, 2016
1 parent 2a2e3eb commit a680b1b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/sharness/t0021-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,17 @@ test_config_cmd() {
grep "\"beep3\": false," actual
'

test_expect_success "'ipfs config replace' works" '
test_expect_success "setup for config replace test" '
cp "$IPFS_PATH/config" newconfig.json &&
sed -i -e /PrivKey/d -e s/10GB/11GB/ newconfig.json &&
sed -i '"'"'/PeerID/ { s/,$// } '"'"' newconfig.json &&
ipfs config replace - < newconfig.json &&
sed -i '"'"'/PeerID/ { s/,$// } '"'"' newconfig.json
'

test_expect_success "run 'ipfs config replace'" '
ipfs config replace - < newconfig.json
'

test_expect_success "check resulting config after 'ipfs config replace'" '
sed -e /PrivKey/d "$IPFS_PATH/config" > replconfig.json &&
sed -i -e'"'"'/PeerID/ { s/,$// } '"'"' replconfig.json &&
test_cmp replconfig.json newconfig.json
Expand Down

0 comments on commit a680b1b

Please sign in to comment.