mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
test: fix "invert" commands in sharness tests (#9652)
Some checks failed
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
CodeQL / codeql (push) Has been cancelled
Some checks failed
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
CodeQL / codeql (push) Has been cancelled
* test: fix the grep in t0046 * test: fix grep -v in t0140 * test: Addresses.NoAnnounce overides AppendAnnounce * fix t0080-repo.sh * fix t0060.sh --------- Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
This commit is contained in:
parent
4dd0990745
commit
df2d1c77ae
@ -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)" '
|
||||
|
||||
@ -195,7 +195,7 @@ TEST_ULIMIT_PRESET=1
|
||||
test_launch_ipfs_daemon
|
||||
|
||||
test_expect_success "daemon raised its fd limit" '
|
||||
grep -v "setting file descriptor limit" actual_daemon > /dev/null
|
||||
test_should_not_contain "setting file descriptor limit" actual_daemon
|
||||
'
|
||||
|
||||
test_expect_success "daemon actually can handle 2048 file descriptors" '
|
||||
|
||||
@ -30,7 +30,7 @@ test_expect_success "'ipfs repo gc' succeeds" '
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs repo gc' looks good (patch root)" '
|
||||
grep -v "removed $HASH" gc_out_actual
|
||||
test_should_not_contain "removed $HASH" gc_out_actual
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs repo gc' doesn't remove file" '
|
||||
@ -284,11 +284,11 @@ test_expect_success "'ipfs repo stat --size-only' succeeds" '
|
||||
'
|
||||
|
||||
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_should_contain "RepoSize" repo-stats-size-only &&
|
||||
test_should_contain "StorageMax" repo-stats-size-only &&
|
||||
test_should_not_contain "RepoPath" repo-stats-size-only &&
|
||||
test_should_not_contain "NumObjects" repo-stats-size-only &&
|
||||
test_should_not_contain "Version" repo-stats-size-only
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs repo version' succeeds" '
|
||||
|
||||
@ -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
|
||||
@ -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'
|
||||
"
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user