test: split 'ipfs config replace' test into parts
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Sep 8, 2016 at 11:13 UTC
a680b1bd7b8cea48dadb6913ffe07906b8ae4173
1 file changed
+9
-3
test/sharness/t0021-config.sh
+9
-3
@@ -72,11 +72,17 @@ test_config_cmd() {
72
grep "\"beep3\": false," actual
73
'
74
75
- test_expect_success "'ipfs config replace' works" '
75
+ test_expect_success "setup for config replace test" '
76
cp "$IPFS_PATH/config" newconfig.json &&
77
sed -i -e /PrivKey/d -e s/10GB/11GB/ newconfig.json &&
78
- sed -i '"'"'/PeerID/ { s/,$// } '"'"' newconfig.json &&
79
- ipfs config replace - < newconfig.json &&
78
+ sed -i '"'"'/PeerID/ { s/,$// } '"'"' newconfig.json
79
+ '
80
+
81
+ test_expect_success "run 'ipfs config replace'" '
82
+ ipfs config replace - < newconfig.json
83
+ '
84
+
85
+ test_expect_success "check resulting config after 'ipfs config replace'" '
86
sed -e /PrivKey/d "$IPFS_PATH/config" > replconfig.json &&
87
sed -i -e'"'"'/PeerID/ { s/,$// } '"'"' replconfig.json &&
88
test_cmp replconfig.json newconfig.json