Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix "invert" commands in sharness tests #9652

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/sharness/t0046-id-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" '
Expand Down Expand Up @@ -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)" '
Expand Down
30 changes: 15 additions & 15 deletions test/sharness/t0140-swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"<addrs>" | 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
Expand All @@ -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"<addrs>" | 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'
"
Expand All @@ -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"<addrs>" | 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
Expand All @@ -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"<addrs>" | 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
Expand Down