From ab6620e7ee80891e43e99d0a6c491e6f802b4dc8 Mon Sep 17 00:00:00 2001 From: meows Date: Thu, 30 Jul 2020 12:22:48 -0500 Subject: [PATCH] main: disable networking for console cmd tests Prevents false-negatives if test environment doesnt have accessible networking, or if a preexiting colliding geth service, eg. port 30303 in use. Signed-off-by: meows --- cmd/geth/consolecmd_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 566242d306..4631e4812a 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -67,6 +67,11 @@ func TestConsoleCmdNetworkIdentities(t *testing.T) { {[]string{"--yolov1"}, 133519467574833, 133519467574833, params.YoloV1GenesisHash.Hex()}, } for i, p := range chainIdentityCases { + + // Disable networking, preventing false-negatives if in an environment without networking service + // or collisions with an existing geth service. + p.flags = append(p.flags, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none") + t.Run(fmt.Sprintf("%d/%v/networkid", i, p.flags), consoleCmdStdoutTest(p.flags, "admin.nodeInfo.protocols.eth.network", p.networkId)) t.Run(fmt.Sprintf("%d/%v/chainid", i, p.flags),