test: split 'ipfs config replace' test into parts

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 2a2e3eb1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment