test: split 'ipfs config replace' test into parts

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2016-09-08 11:13:28 +02:00
parent 2a2e3eb185
commit a680b1bd7b
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -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