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: ipfs/kubo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f417cb5ceb7c
Choose a base ref
...
head repository: ipfs/kubo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 29f67b42758b
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 28, 2015

  1. Add reversible gc test

    License: MIT
    Signed-off-by: rht <rhtbot@gmail.com>
    rht committed Jul 28, 2015

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    eb45082 View commit details
  2. Merge pull request #1523 from rht/reversible-gc

    Add reversible gc test
    jbenet committed Jul 28, 2015
    Copy the full SHA
    29f67b4 View commit details
Showing with 26 additions and 0 deletions.
  1. +16 −0 test/sharness/lib/test-lib.sh
  2. +10 −0 test/sharness/t0080-repo.sh
16 changes: 16 additions & 0 deletions test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
@@ -314,3 +314,19 @@ test_str_contains() {
shift
echo "$@" | grep "$find" >/dev/null
}

disk_usage() {
# normalize du across systems
case $(uname -s) in
Linux)
DU="du -sb"
;;
FreeBSD)
DU="du -s -A -B 1"
;;
Darwin | DragonFly)
DU="du"
;;
esac
$DU "$1" | awk "{print \$1}"
}
10 changes: 10 additions & 0 deletions test/sharness/t0080-repo.sh
Original file line number Diff line number Diff line change
@@ -44,6 +44,16 @@ test_expect_success "'ipfs pin rm' output looks good" '
test_cmp expected1 actual1
'

test_expect_failure "ipfs repo gc fully reverse ipfs add" '
random 100000 41 >gcfile &&
disk_usage "$IPFS_PATH/blocks" >expected &&
hash=`ipfs add -q gcfile` &&
ipfs pin rm -r $hash &&
ipfs repo gc &&
disk_usage "$IPFS_PATH/blocks" >actual &&
test_cmp expected actual
'

test_expect_success "file no longer pinned" '
# we expect the welcome files and gw assets to show up here
echo "$HASH_WELCOME_DOCS" >expected2 &&