diff --git a/test/sharness/t0046-id-hash.sh b/test/sharness/t0046-id-hash.sh index d4c28f21507..89518274642 100755 --- a/test/sharness/t0046-id-hash.sh +++ b/test/sharness/t0046-id-hash.sh @@ -25,7 +25,8 @@ test_expect_success "ipfs add succeeds with identity hash" ' ' test_expect_success "content not actually added" ' - ipfs refs local | fgrep -q -v $HASH + ipfs refs local > locals && + test_should_not_contain $HASH locals ' test_expect_success "but can fetch it anyway" ' @@ -98,7 +99,8 @@ test_expect_success "ipfs add succeeds with identity hash and --nocopy" ' ' test_expect_success "content not actually added (filestore enabled)" ' - ipfs refs local | fgrep -q -v $HASH + ipfs refs local > locals && + test_should_not_contain $HASH locals ' test_expect_success "but can fetch it anyway (filestore enabled)" ' diff --git a/test/sharness/t0140-swarm.sh b/test/sharness/t0140-swarm.sh index d65831d3e22..37bb44b6440 100755 --- a/test/sharness/t0140-swarm.sh +++ b/test/sharness/t0140-swarm.sh @@ -58,9 +58,9 @@ test_launch_ipfs_daemon test_expect_success 'Addresses.Announce affects addresses' ' ipfs swarm addrs local >actual && - grep "/ip4/1.2.3.4/tcp/1234" actual && + test_should_contain "/ip4/1.2.3.4/tcp/1234" actual && ipfs id -f"" | xargs -n1 echo >actual && - grep "/ip4/1.2.3.4/tcp/1234" actual + test_should_contain "/ip4/1.2.3.4/tcp/1234" actual ' test_kill_ipfs_daemon @@ -81,18 +81,18 @@ test_launch_ipfs_daemon test_expect_success 'Addresses.AppendAnnounce is applied on top of Announce' ' ipfs swarm addrs local >actual && - grep "/ip4/1.2.3.4/tcp/1234" actual && - grep "/dnsaddr/dynamic.example.com" actual && - grep "/ip4/10.20.30.40/tcp/4321" actual && + test_should_contain "/ip4/1.2.3.4/tcp/1234" actual && + test_should_contain "/dnsaddr/dynamic.example.com" actual && + test_should_contain "/ip4/10.20.30.40/tcp/4321" actual && ipfs id -f"" | xargs -n1 echo | tee actual && - grep "/ip4/1.2.3.4/tcp/1234/p2p" actual && - grep "/dnsaddr/dynamic.example.com/p2p/" actual && - grep "/ip4/10.20.30.40/tcp/4321/p2p/" actual + test_should_contain "/ip4/1.2.3.4/tcp/1234/p2p" actual && + test_should_contain "/dnsaddr/dynamic.example.com/p2p/" actual && + test_should_contain "/ip4/10.20.30.40/tcp/4321/p2p/" actual ' test_kill_ipfs_daemon -noAnnounceCfg='["/ip4/1.2.3.4/tcp/1234"]' +noAnnounceCfg='["/ip4/1.2.3.4/tcp/1234", "/ip4/10.20.30.40/tcp/4321"]' test_expect_success "test_config_set succeeds" " ipfs config --json Addresses.NoAnnounce '$noAnnounceCfg' " @@ -101,11 +101,11 @@ test_launch_ipfs_daemon test_expect_success "Addresses.NoAnnounce affects addresses from Announce and AppendAnnounce" ' ipfs swarm addrs local >actual && - grep -v "/ip4/1.2.3.4/tcp/1234" actual && - grep -v "/ip4/10.20.30.40/tcp/4321" actual && + test_should_not_contain "/ip4/1.2.3.4/tcp/1234" actual && + test_should_not_contain "/ip4/10.20.30.40/tcp/4321" actual && ipfs id -f"" | xargs -n1 echo >actual && - grep -v "/ip4/1.2.3.4/tcp/1234" actual && - grep -v "//ip4/10.20.30.40/tcp/4321" actual + test_should_not_contain "/ip4/1.2.3.4/tcp/1234" actual && + test_should_not_contain "/ip4/10.20.30.40/tcp/4321" actual ' test_kill_ipfs_daemon @@ -119,9 +119,9 @@ test_launch_ipfs_daemon test_expect_success "Addresses.NoAnnounce with /ipcidr affects addresses" ' ipfs swarm addrs local >actual && - grep -v "/ip4/1.2.3.4/tcp/1234" actual && + test_should_not_contain "/ip4/1.2.3.4/tcp/1234" actual && ipfs id -f"" | xargs -n1 echo >actual && - grep -v "/ip4/1.2.3.4/tcp/1234" actual + test_should_not_contain "/ip4/1.2.3.4/tcp/1234" actual ' test_kill_ipfs_daemon