Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: shawkhawk/go-ipfs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: shawkhawk/go-ipfs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feat/test-config-replace
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Aug 15, 2016

  1. sharness: add test for 'ipfs config replace'

    License: MIT
    Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
    Kubuxu committed Aug 15, 2016
    Copy the full SHA
    8ac5237 View commit details
  2. sharness: remove mixed indentation

    License: MIT
    Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
    Kubuxu committed Aug 15, 2016
    Copy the full SHA
    27cc473 View commit details
Showing with 14 additions and 3 deletions.
  1. +14 −3 test/sharness/t0021-config.sh
17 changes: 14 additions & 3 deletions test/sharness/t0021-config.sh
Original file line number Diff line number Diff line change
@@ -72,6 +72,19 @@ test_config_cmd() {
grep "\"beep3\": false," actual
'

test_expect_success "'ipfs config replace' works" '
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 -e /PrivKey/d "$IPFS_PATH/config" > replconfig.json &&
sed -i -e'"'"'/PeerID/ { s/,$// } '"'"' replconfig.json &&
test_cmp replconfig.json newconfig.json
'

# SECURITY
# Those tests are here to prevent exposing the PrivKey on the network

test_expect_success "'ipfs config Identity' fails" '
test_expect_code 1 ipfs config Identity 2> ident_out
'
@@ -81,8 +94,6 @@ test_config_cmd() {
test_cmp ident_exp ident_out
'

# SECURITY
# Those tests are here to prevent exposing the PrivKey on the network
test_expect_success "'ipfs config Identity.PrivKey' fails" '
test_expect_code 1 ipfs config Identity.PrivKey 2> ident_out
'
@@ -111,7 +122,7 @@ 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" '