From 3e5587edc90c48964d8c5ae4552603c053336885 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Thu, 10 May 2018 01:22:53 +0200 Subject: [PATCH] Sharness: add tests for ipfs repo stat --size-only License: MIT Signed-off-by: Hector Sanjuan --- test/sharness/t0080-repo.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/sharness/t0080-repo.sh b/test/sharness/t0080-repo.sh index 175069b1968..25c5ce714c8 100755 --- a/test/sharness/t0080-repo.sh +++ b/test/sharness/t0080-repo.sh @@ -245,6 +245,18 @@ test_expect_success "repo stats are updated correctly" ' test $(get_field_num "RepoSize" repo-stats-2) -ge $(get_field_num "RepoSize" repo-stats) ' +test_expect_success "'ipfs repo stat --size-only' succeeds" ' + ipfs repo stat --size-only > repo-stats-size-only +' + +test_expect_success "repo stats came out correct for --size-only" ' + grep "RepoSize" repo-stats-size-only && + grep "StorageMax" repo-stats-size-only && + grep -v "RepoPath" repo-stats-size-only && + grep -v "NumObjects" repo-stats-size-only && + grep -v "Version" repo-stats-size-only +' + test_expect_success "'ipfs repo version' succeeds" ' ipfs repo version > repo-version '