From 038e56d4130d85ef1423df1db26f8b6f96e891f2 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 17 Aug 2023 22:53:35 +0200 Subject: [PATCH] test: Addresses.NoAnnounce overides AppendAnnounce --- test/sharness/t0140-swarm.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/sharness/t0140-swarm.sh b/test/sharness/t0140-swarm.sh index 90bb65fbadd..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,12 +101,11 @@ test_launch_ipfs_daemon test_expect_success "Addresses.NoAnnounce affects addresses from Announce and AppendAnnounce" ' ipfs swarm addrs local >actual && - cat actual && # confirm the bug 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 && 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_should_not_contain "/ip4/10.20.30.40/tcp/4321" actual ' test_kill_ipfs_daemon